chrome-devtools-frontend 1.0.1550444 → 1.0.1553956
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/styleguide/ux/components.md +34 -8
- package/eslint.config.mjs +7 -0
- package/front_end/Images/generate-css-vars.js +8 -4
- package/front_end/core/common/Settings.ts +20 -8
- package/front_end/core/host/UserMetrics.ts +3 -1
- package/front_end/core/i18n/collect-ui-strings.js +19 -10
- package/front_end/core/i18n/generate-locales-js.js +4 -4
- package/front_end/core/protocol_client/CDPConnection.ts +1 -0
- package/front_end/core/protocol_client/InspectorBackend.ts +5 -1
- package/front_end/core/root/Runtime.ts +0 -12
- package/front_end/core/sdk/DOMModel.ts +38 -3
- package/front_end/core/sdk/DebuggerModel.ts +9 -4
- package/front_end/core/sdk/IsolateManager.ts +7 -0
- package/front_end/core/sdk/PageResourceLoader.ts +3 -3
- package/front_end/core/sdk/RehydratingConnection.ts +5 -2
- package/front_end/entrypoints/main/MainImpl.ts +28 -10
- package/front_end/generated/SupportedCSSProperties.js +14 -0
- package/front_end/models/ai_assistance/AiConversation.ts +94 -4
- package/front_end/models/ai_assistance/agents/AiAgent.ts +30 -15
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +179 -41
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +5 -0
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +62 -0
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +2 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +1 -7
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +124 -12
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +125 -30
- package/front_end/models/ai_assistance/performance/AICallTree.ts +42 -0
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +12 -0
- package/front_end/models/issues_manager/Issue.ts +1 -0
- package/front_end/models/issues_manager/IssueAggregator.ts +9 -0
- package/front_end/models/issues_manager/IssuesManager.ts +5 -0
- package/front_end/models/issues_manager/PermissionElementIssue.ts +262 -0
- package/front_end/models/issues_manager/descriptions/permissionElementActivationDisabled.md +7 -0
- package/front_end/models/issues_manager/descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
- package/front_end/models/issues_manager/descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
- package/front_end/models/issues_manager/descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementFencedFrameDisallowed.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementFontSizeTooLarge.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementFontSizeTooSmall.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementGeolocationDeprecated.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInvalidDisplayStyle.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInvalidSizeValue.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInvalidType.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementInvalidTypeActivation.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementLowContrast.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementNonOpaqueColor.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
- package/front_end/models/issues_manager/descriptions/permissionElementPaddingRightUnsupported.md +6 -0
- package/front_end/models/issues_manager/descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementRegistrationFailed.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementRequestInProgress.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementSecurityChecksFailed.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementTypeNotSupported.md +5 -0
- package/front_end/models/issues_manager/descriptions/permissionElementUntrustedEvent.md +7 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +8 -0
- package/front_end/models/stack_trace/StackTraceModel.ts +37 -18
- package/front_end/models/trace/Processor.ts +14 -15
- package/front_end/models/trace/insights/Common.ts +2 -8
- package/front_end/models/trace/insights/types.ts +12 -2
- package/front_end/models/trace/types/TraceEvents.ts +4 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +28 -6
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +9 -23
- package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +78 -2
- package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +71 -0
- package/front_end/panels/ai_assistance/components/PerformanceAgentFlameChart.ts +126 -0
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +131 -2
- package/front_end/panels/ai_assistance/components/chatView.css +28 -0
- package/front_end/panels/ai_assistance/components/collapsibleAssistanceContentWidget.css +33 -0
- package/front_end/panels/application/AppManifestView.ts +1007 -521
- package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -17
- package/front_end/panels/application/ExtensionStorageItemsView.ts +3 -5
- package/front_end/panels/application/KeyValueStorageItemsView.ts +3 -2
- package/front_end/panels/application/components/BackForwardCacheView.ts +2 -2
- package/front_end/panels/application/preloading/PreloadingView.ts +46 -45
- package/front_end/panels/application/preloading/components/MismatchedPreloadingGrid.ts +80 -75
- package/front_end/panels/application/preloading/components/PreloadingDisabledInfobar.ts +169 -133
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +74 -93
- package/front_end/panels/application/preloading/components/RuleSetGrid.ts +142 -117
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +51 -11
- package/front_end/panels/application/preloading/components/components.ts +0 -2
- package/front_end/panels/common/Annotation.ts +184 -0
- package/front_end/panels/common/AnnotationManager.ts +148 -11
- package/front_end/panels/common/ExtensionView.ts +47 -0
- package/front_end/panels/common/PersistenceUtils.ts +22 -25
- package/front_end/panels/common/annotation.css +40 -0
- package/front_end/panels/common/common.ts +1 -0
- package/front_end/panels/console/ConsoleInsightTeaser.ts +187 -5
- package/front_end/panels/console/ConsolePinPane.ts +437 -217
- package/front_end/panels/console/ConsolePrompt.ts +32 -223
- package/front_end/panels/console/ConsoleView.ts +67 -66
- package/front_end/panels/console/ConsoleViewMessage.ts +8 -3
- package/front_end/panels/console/consoleInsightTeaser.css +23 -0
- package/front_end/panels/console/consoleView.css +1 -1
- package/front_end/panels/elements/AdoptedStyleSheetTreeElement.ts +89 -0
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +2 -2
- package/front_end/panels/elements/ComputedStyleWidget.ts +16 -5
- package/front_end/panels/elements/ElementsPanel.ts +38 -12
- package/front_end/panels/elements/ElementsSidebarPane.ts +1 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +313 -353
- package/front_end/panels/elements/ElementsTreeOutline.ts +39 -13
- package/front_end/panels/elements/StylePropertyTreeElement.ts +15 -14
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/emulation/MediaQueryInspector.ts +171 -125
- package/front_end/panels/explain/components/ConsoleInsight.ts +175 -150
- package/front_end/panels/explain/components/consoleInsight.css +348 -347
- package/front_end/panels/issues/AffectedPermissionElementsView.ts +46 -0
- package/front_end/panels/issues/IssueView.ts +2 -0
- package/front_end/panels/issues/IssuesPane.ts +6 -0
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +165 -149
- package/front_end/panels/layer_viewer/Layers3DView.ts +131 -78
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +149 -100
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +90 -64
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +25 -34
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +60 -44
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +170 -151
- package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +50 -51
- package/front_end/panels/linear_memory_inspector/components/valueInterpreterDisplay.css +0 -13
- package/front_end/panels/linear_memory_inspector/components/valueInterpreterSettings.css +20 -18
- package/front_end/panels/mobile_throttling/CalibrationController.ts +3 -1
- package/front_end/panels/network/NetworkDataGridNode.ts +14 -6
- package/front_end/panels/network/NetworkItemView.ts +42 -3
- package/front_end/panels/network/NetworkLogView.ts +10 -11
- package/front_end/panels/network/NetworkPanel.ts +63 -1
- package/front_end/panels/network/RequestInitiatorView.ts +146 -113
- package/front_end/panels/network/components/RequestHeaderSection.css +51 -50
- package/front_end/panels/network/components/RequestHeaderSection.ts +81 -71
- package/front_end/panels/network/components/RequestHeadersView.css +1 -1
- package/front_end/panels/network/components/RequestHeadersView.ts +26 -11
- package/front_end/panels/network/components/RequestTrustTokensView.css +24 -14
- package/front_end/panels/network/components/RequestTrustTokensView.ts +144 -140
- package/front_end/panels/profiler/IsolateSelector.ts +2 -1
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +49 -33
- package/front_end/panels/recorder/RecorderController.ts +2 -3
- package/front_end/panels/recorder/components/ControlButton.ts +68 -34
- package/front_end/panels/recorder/components/CreateRecordingView.ts +9 -6
- package/front_end/panels/recorder/components/RecordingView.ts +81 -88
- package/front_end/panels/recorder/components/ReplaySection.ts +226 -145
- package/front_end/panels/recorder/{controllers → components}/SelectorPicker.ts +129 -52
- package/front_end/panels/recorder/components/StepEditor.ts +21 -67
- package/front_end/panels/recorder/components/StepView.ts +222 -180
- package/front_end/panels/recorder/components/TimelineSection.ts +69 -48
- package/front_end/panels/recorder/components/components.ts +2 -2
- package/front_end/panels/recorder/components/selectorPicker.css +14 -0
- package/front_end/panels/recorder/components/stepEditor.css +0 -5
- package/front_end/panels/recorder/components/stepView.css +196 -198
- package/front_end/panels/recorder/extensions/ExtensionManager.ts +4 -48
- package/front_end/panels/recorder/models/ScreenshotUtils.ts +17 -11
- package/front_end/panels/security/CookieControlsView.ts +9 -16
- package/front_end/panels/settings/components/SyncSection.ts +0 -1
- package/front_end/panels/sources/CSSPlugin.ts +3 -3
- package/front_end/panels/sources/CallStackSidebarPane.ts +60 -75
- package/front_end/panels/sources/SourcesPanel.ts +1 -11
- package/front_end/panels/sources/TabbedEditorContainer.ts +11 -8
- package/front_end/panels/sources/ThreadsSidebarPane.ts +96 -101
- package/front_end/panels/sources/threadsSidebarPane.css +6 -5
- package/front_end/panels/timeline/InteractionsTrackAppender.ts +2 -3
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +23 -33
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +4 -3
- package/front_end/panels/timeline/TimelineFlameChartView.ts +12 -0
- package/front_end/panels/timeline/TimelinePanel.ts +3 -5
- package/front_end/panels/timeline/components/IgnoreListSetting.ts +164 -142
- package/front_end/panels/timeline/components/InteractionBreakdown.ts +48 -28
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +18 -23
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +98 -73
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +9 -12
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +262 -291
- package/front_end/panels/timeline/components/Utils.ts +25 -0
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +210 -146
- package/front_end/panels/timeline/components/insights/CLSCulprits.ts +8 -20
- package/front_end/panels/timeline/components/insights/Cache.ts +0 -9
- package/front_end/panels/timeline/components/insights/DOMSize.ts +11 -33
- package/front_end/panels/timeline/components/insights/DocumentLatency.ts +0 -9
- package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +0 -9
- package/front_end/panels/timeline/components/insights/EventRef.ts +47 -109
- package/front_end/panels/timeline/components/insights/FontDisplay.ts +0 -9
- package/front_end/panels/timeline/components/insights/ForcedReflow.ts +0 -9
- package/front_end/panels/timeline/components/insights/INPBreakdown.ts +0 -9
- package/front_end/panels/timeline/components/insights/ImageDelivery.ts +1 -10
- package/front_end/panels/timeline/components/insights/ImageRef.ts +112 -0
- package/front_end/panels/timeline/components/insights/InsightRenderer.ts +91 -0
- package/front_end/panels/timeline/components/insights/LCPBreakdown.ts +0 -9
- package/front_end/panels/timeline/components/insights/LCPDiscovery.ts +4 -11
- package/front_end/panels/timeline/components/insights/LegacyJavaScript.ts +0 -9
- package/front_end/panels/timeline/components/insights/ModernHTTP.ts +0 -9
- package/front_end/panels/timeline/components/insights/NetworkDependencyTree.ts +6 -21
- package/front_end/panels/timeline/components/insights/NodeLink.ts +68 -43
- package/front_end/panels/timeline/components/insights/README.md +2 -3
- package/front_end/panels/timeline/components/insights/RenderBlocking.ts +0 -9
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +0 -9
- package/front_end/panels/timeline/components/insights/ThirdParties.ts +0 -9
- package/front_end/panels/timeline/components/insights/Viewport.ts +7 -19
- package/front_end/panels/timeline/components/insights/baseInsightComponent.css +5 -0
- package/front_end/panels/timeline/components/insights/insights.ts +2 -0
- package/front_end/panels/timeline/components/interactionBreakdown.css +15 -13
- package/front_end/panels/timeline/enable-easter-egg.js +7 -3
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.d.ts +96 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.js +8 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +87 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts +2 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js +5 -24
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/DeviceRequestPrompt.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/api.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.d.ts +18 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.js +42 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +4 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +10 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.d.ts +27 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.js +90 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/DeviceRequestPrompt.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +4 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +14 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.d.ts +18 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.js +30 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +5 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +22 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts +2 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js +4 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +8 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js +8 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/cdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +30 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts +15 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js +2 -13
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +5 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.js +17 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +221 -4
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +182 -95
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.d.ts +96 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +87 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts +2 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js +4 -22
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/DeviceRequestPrompt.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/api.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.d.ts +18 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.js +38 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +4 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +10 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.d.ts +27 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.js +85 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/DeviceRequestPrompt.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +4 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts +4 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +14 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.js +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.d.ts +18 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.js +26 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BluetoothEmulation.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +5 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +22 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/CdpSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts +2 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js +2 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/DeviceRequestPrompt.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +8 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js +8 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.js +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/cdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +31 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts +15 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js +2 -13
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +5 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.js +16 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +221 -4
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/BluetoothEmulation.ts +103 -0
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +96 -1
- package/front_end/third_party/puppeteer/package/src/api/DeviceRequestPrompt.ts +2 -10
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +6 -0
- package/front_end/third_party/puppeteer/package/src/api/api.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/bidi/BluetoothEmulation.ts +52 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +15 -0
- package/front_end/third_party/puppeteer/package/src/bidi/DeviceRequestPrompt.ts +138 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +7 -3
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +10 -2
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +30 -2
- package/front_end/third_party/puppeteer/package/src/bidi/util.ts +8 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/BluetoothEmulation.ts +47 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +33 -3
- package/front_end/third_party/puppeteer/package/src/cdp/CdpSession.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/DeviceRequestPrompt.ts +3 -8
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +9 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +13 -0
- package/front_end/third_party/puppeteer/package/src/cdp/WebWorker.ts +8 -3
- package/front_end/third_party/puppeteer/package/src/cdp/cdp.ts +1 -0
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +45 -1
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +20 -0
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +5 -17
- package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +23 -7
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +4 -0
- package/front_end/ui/components/annotations/AnnotationRepository.ts +153 -13
- package/front_end/ui/components/snackbars/Snackbars.docs.ts +0 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionTeaserPlaceholder.ts +12 -3
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +182 -0
- package/front_end/ui/components/text_editor/text_editor.ts +1 -0
- package/front_end/ui/helpers/OpenInNewTab.ts +5 -1
- package/front_end/ui/i18n/i18n.ts +9 -9
- package/front_end/ui/kit/icons/Icon.docs.ts +22 -65
- package/front_end/ui/kit/kit.ts +1 -0
- package/front_end/ui/kit/link/Link.docs.ts +15 -0
- package/front_end/ui/kit/link/Link.ts +151 -0
- package/front_end/ui/kit/link/link.css +27 -0
- package/front_end/ui/legacy/EmptyWidget.ts +6 -0
- package/front_end/ui/legacy/Floaty.ts +442 -0
- package/front_end/ui/legacy/InspectorView.ts +12 -0
- package/front_end/ui/legacy/ReportView.ts +1 -1
- package/front_end/ui/legacy/SelectMenu.docs.ts +0 -1
- package/front_end/ui/legacy/TabbedPane.ts +131 -53
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +36 -36
- package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +22 -37
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +31 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +2 -2
- package/front_end/ui/legacy/components/utils/Linkifier.ts +7 -11
- package/front_end/ui/legacy/floaty.css +77 -0
- package/front_end/ui/legacy/legacy.ts +2 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +6 -0
- package/inspector_overlay/loadCSS.rollup.js +5 -4
- package/package.json +2 -2
- package/front_end/panels/application/preloading/components/PreloadingMismatchedHeadersGrid.ts +0 -99
- package/front_end/panels/recorder/components/SelectButton.ts +0 -304
- package/front_end/panels/recorder/controllers/controllers.ts +0 -7
- package/front_end/ui/components/chrome_link/ChromeLink.ts +0 -76
- package/front_end/ui/components/chrome_link/chromeLink.css +0 -12
- package/front_end/ui/components/chrome_link/chrome_link.ts +0 -9
- /package/front_end/panels/recorder/components/{selectButton.css → replaySection.css} +0 -0
|
@@ -6,12 +6,20 @@ import type * as Common from '../../core/common/common.js';
|
|
|
6
6
|
import type * as SDK from '../../core/sdk/sdk.js';
|
|
7
7
|
import * as Annotations from '../../ui/components/annotations/annotations.js';
|
|
8
8
|
|
|
9
|
+
import {Annotation} from './Annotation.js';
|
|
10
|
+
|
|
11
|
+
interface AnnotationData {
|
|
12
|
+
id: number;
|
|
13
|
+
type: Annotations.AnnotationType;
|
|
14
|
+
annotation: Annotation;
|
|
15
|
+
}
|
|
16
|
+
|
|
9
17
|
interface AnnotationPlacement {
|
|
10
18
|
parentElement: Element;
|
|
11
19
|
insertBefore?: Node|null;
|
|
12
|
-
|
|
13
|
-
(parentElement: Element,
|
|
14
|
-
|
|
20
|
+
resolveInitialState:
|
|
21
|
+
(parentElement: Element, reveal: boolean, lookupId: string,
|
|
22
|
+
anchor?: SDK.DOMModel.DOMNode|SDK.NetworkRequest.NetworkRequest) => Promise<{x: number, y: number}|null>;
|
|
15
23
|
}
|
|
16
24
|
|
|
17
25
|
// This class handles general management of Annotations, the data needed to display them and any panel-specific things
|
|
@@ -23,6 +31,8 @@ export class AnnotationManager {
|
|
|
23
31
|
static #instance: AnnotationManager|null = null;
|
|
24
32
|
|
|
25
33
|
#annotationPlacements: Map<Annotations.AnnotationType, AnnotationPlacement>|null = null;
|
|
34
|
+
#annotations = new Map<number, AnnotationData>();
|
|
35
|
+
#synced = false;
|
|
26
36
|
|
|
27
37
|
constructor() {
|
|
28
38
|
if (!Annotations.AnnotationRepository.annotationsEnabled()) {
|
|
@@ -32,6 +42,10 @@ export class AnnotationManager {
|
|
|
32
42
|
|
|
33
43
|
Annotations.AnnotationRepository.instance().addEventListener(
|
|
34
44
|
Annotations.Events.ANNOTATION_ADDED, this.#onAnnotationAdded, this);
|
|
45
|
+
Annotations.AnnotationRepository.instance().addEventListener(
|
|
46
|
+
Annotations.Events.ANNOTATION_DELETED, this.#onAnnotationDeleted, this);
|
|
47
|
+
Annotations.AnnotationRepository.instance().addEventListener(
|
|
48
|
+
Annotations.Events.ALL_ANNOTATIONS_DELETED, this.#onAllAnnotationsDeleted, this);
|
|
35
49
|
}
|
|
36
50
|
|
|
37
51
|
static instance(): AnnotationManager {
|
|
@@ -43,9 +57,9 @@ export class AnnotationManager {
|
|
|
43
57
|
|
|
44
58
|
initializePlacementForAnnotationType(
|
|
45
59
|
type: Annotations.AnnotationType,
|
|
46
|
-
|
|
47
|
-
(parentElement: Element,
|
|
48
|
-
|
|
60
|
+
resolveInitialState:
|
|
61
|
+
(parentElement: Element, reveal: boolean, lookupId: string,
|
|
62
|
+
anchor?: SDK.DOMModel.DOMNode|SDK.NetworkRequest.NetworkRequest) => Promise<{x: number, y: number}|null>,
|
|
49
63
|
parentElement: Element, insertBefore: Node|null = null): void {
|
|
50
64
|
if (!Annotations.AnnotationRepository.annotationsEnabled()) {
|
|
51
65
|
return;
|
|
@@ -54,18 +68,141 @@ export class AnnotationManager {
|
|
|
54
68
|
if (!this.#annotationPlacements) {
|
|
55
69
|
this.#annotationPlacements = new Map();
|
|
56
70
|
}
|
|
57
|
-
this.#annotationPlacements.set(type, {parentElement, insertBefore,
|
|
71
|
+
this.#annotationPlacements.set(type, {parentElement, insertBefore, resolveInitialState});
|
|
58
72
|
|
|
59
73
|
// eslint-disable-next-line no-console
|
|
60
74
|
console.log(
|
|
61
75
|
`[AnnotationManager] initializing placement for ${Annotations.AnnotationType[type]}`, {parentElement},
|
|
62
76
|
'placement count:', this.#annotationPlacements);
|
|
77
|
+
|
|
78
|
+
this.#syncAnnotations();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
#syncAnnotations(): void {
|
|
82
|
+
if (this.#synced) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// eslint-disable-next-line no-console
|
|
87
|
+
console.log('[AnnotationManager] **** SYNC STARTED ***');
|
|
88
|
+
const repository = Annotations.AnnotationRepository.instance();
|
|
89
|
+
for (const type of Object.values(Annotations.AnnotationType)) {
|
|
90
|
+
for (const annotation of repository.getAnnotationDataByType(type as Annotations.AnnotationType)) {
|
|
91
|
+
// eslint-disable-next-line no-console
|
|
92
|
+
console.log(
|
|
93
|
+
'[AnnotationManager] Available annotation:', annotation,
|
|
94
|
+
'need sync:', !this.#annotations.has(annotation.id));
|
|
95
|
+
if (!this.#annotations.has(annotation.id)) {
|
|
96
|
+
this.#addAnnotation(annotation);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
this.#synced = true;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
#onAllAnnotationsDeleted(): void {
|
|
104
|
+
for (const annotation of this.#annotations.values()) {
|
|
105
|
+
annotation.annotation.hide();
|
|
106
|
+
}
|
|
107
|
+
this.#annotations = new Map();
|
|
108
|
+
// eslint-disable-next-line no-console
|
|
109
|
+
console.log('[AnnotationManager] deleted all annotations');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
#onAnnotationDeleted(
|
|
113
|
+
event: Common.EventTarget.EventTargetEvent<Annotations.EventTypes[Annotations.Events.ANNOTATION_DELETED]>): void {
|
|
114
|
+
const {id} = event.data;
|
|
115
|
+
const annotation = this.#annotations.get(id);
|
|
116
|
+
if (annotation) {
|
|
117
|
+
annotation.annotation.hide();
|
|
118
|
+
this.#annotations.delete(id);
|
|
119
|
+
}
|
|
120
|
+
// eslint-disable-next-line no-console
|
|
121
|
+
console.log(`[AnnotationManager] Deleted annotation with id ${id}`);
|
|
63
122
|
}
|
|
64
123
|
|
|
65
|
-
|
|
66
|
-
event: Common.EventTarget.EventTargetEvent<Annotations.EventTypes[Annotations.Events.ANNOTATION_ADDED]>):
|
|
67
|
-
|
|
124
|
+
#onAnnotationAdded(
|
|
125
|
+
event: Common.EventTarget.EventTargetEvent<Annotations.EventTypes[Annotations.Events.ANNOTATION_ADDED]>): void {
|
|
126
|
+
const annotationData = event.data;
|
|
68
127
|
// eslint-disable-next-line no-console
|
|
69
|
-
console.log('[AnnotationManager]
|
|
128
|
+
console.log('[AnnotationManager] handleAddAnnotation', annotationData);
|
|
129
|
+
this.#addAnnotation(annotationData);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
#addAnnotation(annotationData: Annotations.BaseAnnotationData): void {
|
|
133
|
+
const expandable = annotationData.type !== Annotations.AnnotationType.NETWORK_REQUEST;
|
|
134
|
+
const showExpanded = annotationData.type !== Annotations.AnnotationType.NETWORK_REQUEST;
|
|
135
|
+
const showAnchored = annotationData.type !== Annotations.AnnotationType.NETWORK_REQUEST;
|
|
136
|
+
const showCloseButton = annotationData.type !== Annotations.AnnotationType.NETWORK_REQUEST;
|
|
137
|
+
const annotation = new Annotation(
|
|
138
|
+
annotationData.id, annotationData.message, showExpanded, showAnchored, expandable, showCloseButton);
|
|
139
|
+
this.#annotations.set(annotationData.id, {id: annotationData.id, type: annotationData.type, annotation});
|
|
140
|
+
// eslint-disable-next-line no-console
|
|
141
|
+
console.log('[AnnotationManager] addAnnotation called. Annotations now', this.#annotations);
|
|
142
|
+
requestAnimationFrame(async () => {
|
|
143
|
+
await this.#resolveAnnotationWithId(annotationData.id);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
async resolveAnnotationsOfType(type: Annotations.AnnotationType): Promise<void> {
|
|
148
|
+
for (const annotationData of this.#annotations.values()) {
|
|
149
|
+
if (annotationData.type === type) {
|
|
150
|
+
await this.#resolveAnnotationWithId(annotationData.id);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
async #resolveAnnotationWithId(id: number): Promise<void> {
|
|
156
|
+
const annotation = this.#annotations.get(id);
|
|
157
|
+
if (!annotation) {
|
|
158
|
+
console.warn('Unable to find annotation with id', id, ' in annotations map', this.#annotations);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const placement = this.#annotationPlacements?.get(annotation.type);
|
|
163
|
+
if (!placement) {
|
|
164
|
+
console.warn(
|
|
165
|
+
'Unable to find placement for annotation with id', id,
|
|
166
|
+
'(note: this is expected if its panel hasn\'t been shown yet).');
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
let position = undefined;
|
|
171
|
+
const annotationRegistration = Annotations.AnnotationRepository.instance().getAnnotationDataById(id);
|
|
172
|
+
const reveal = !annotation.annotation.hasShown();
|
|
173
|
+
switch (annotationRegistration?.type) {
|
|
174
|
+
case Annotations.AnnotationType.ELEMENT_NODE: {
|
|
175
|
+
const elementData = annotationRegistration as Annotations.ElementsAnnotationData;
|
|
176
|
+
position = await placement.resolveInitialState(
|
|
177
|
+
placement.parentElement, reveal, elementData.lookupId, elementData.anchor);
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
case Annotations.AnnotationType.NETWORK_REQUEST: {
|
|
181
|
+
const networkRequestData = annotationRegistration as Annotations.NetworkRequestAnnotationData;
|
|
182
|
+
position = await placement.resolveInitialState(
|
|
183
|
+
placement.parentElement, reveal, networkRequestData.lookupId, networkRequestData.anchor);
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
case Annotations.AnnotationType.NETWORK_REQUEST_SUBPANEL_HEADERS: {
|
|
187
|
+
const networkRequestDetailsData = annotationRegistration as Annotations.NetworkRequestDetailsAnnotationData;
|
|
188
|
+
position = await placement.resolveInitialState(
|
|
189
|
+
placement.parentElement, reveal, networkRequestDetailsData.lookupId, networkRequestDetailsData.anchor);
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
default:
|
|
193
|
+
console.warn('[AnnotationManager] Unknown AnnotationType', annotationRegistration?.type);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
if (!position) {
|
|
197
|
+
// eslint-disable-next-line no-console
|
|
198
|
+
console.log(`Unable to calculate position for annotation with id ${annotationRegistration?.id}`);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
annotation.annotation.setCoordinates(position.x, position.y);
|
|
203
|
+
|
|
204
|
+
if (!annotation.annotation.isShowing()) {
|
|
205
|
+
annotation.annotation.show(placement.parentElement, placement.insertBefore);
|
|
206
|
+
}
|
|
70
207
|
}
|
|
71
208
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
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 type * as Extensions from '../../models/extensions/extensions.js';
|
|
5
6
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
6
7
|
import * as Lit from '../../ui/lit/lit.js';
|
|
7
8
|
|
|
@@ -110,3 +111,49 @@ export class ExtensionNotifierView extends UI.Widget.VBox {
|
|
|
110
111
|
this.server.notifyViewHidden(this.id);
|
|
111
112
|
}
|
|
112
113
|
}
|
|
114
|
+
|
|
115
|
+
export class ExtensionIframe {
|
|
116
|
+
#descriptor: Extensions.RecorderPluginManager.ViewDescriptor;
|
|
117
|
+
#iframe: HTMLIFrameElement;
|
|
118
|
+
#isShowing = false;
|
|
119
|
+
#isLoaded = false;
|
|
120
|
+
|
|
121
|
+
constructor(descriptor: Extensions.RecorderPluginManager.ViewDescriptor) {
|
|
122
|
+
this.#descriptor = descriptor;
|
|
123
|
+
// We are creating a single iframe here.
|
|
124
|
+
/* eslint-disable-next-line @devtools/no-imperative-dom-api */
|
|
125
|
+
this.#iframe = document.createElement('iframe');
|
|
126
|
+
this.#iframe.src = descriptor.pagePath;
|
|
127
|
+
this.#iframe.onload = this.#onIframeLoad;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
#onIframeLoad = (): void => {
|
|
131
|
+
this.#isLoaded = true;
|
|
132
|
+
if (this.#isShowing) {
|
|
133
|
+
this.#descriptor.onShown();
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
show(): void {
|
|
138
|
+
if (this.#isShowing) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
this.#isShowing = true;
|
|
142
|
+
if (this.#isLoaded) {
|
|
143
|
+
this.#descriptor.onShown();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
hide(): void {
|
|
148
|
+
if (!this.#isShowing) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
this.#isShowing = false;
|
|
152
|
+
this.#isLoaded = false;
|
|
153
|
+
this.#descriptor.onHidden();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
frame(): HTMLIFrameElement {
|
|
157
|
+
return this.#iframe;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -2,14 +2,15 @@
|
|
|
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 '../../ui/kit/kit.js';
|
|
6
|
+
|
|
5
7
|
import * as Common from '../../core/common/common.js';
|
|
6
8
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
7
9
|
import * as Platform from '../../core/platform/platform.js';
|
|
8
10
|
import * as Persistence from '../../models/persistence/persistence.js';
|
|
9
11
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
10
|
-
import {Icon} from '../../ui/kit/kit.js';
|
|
11
12
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
12
|
-
import
|
|
13
|
+
import {html, type LitTemplate} from '../../ui/lit/lit.js';
|
|
13
14
|
|
|
14
15
|
const UIStrings = {
|
|
15
16
|
/**
|
|
@@ -42,23 +43,21 @@ export class PersistenceUtils {
|
|
|
42
43
|
return i18nString(UIStrings.linkedToS, {PH1: Platform.StringUtilities.trimMiddle(binding.network.url(), 150)});
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
static iconForUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode):
|
|
46
|
+
static iconForUISourceCode(uiSourceCode: Workspace.UISourceCode.UISourceCode): LitTemplate|null {
|
|
46
47
|
const binding = Persistence.Persistence.PersistenceImpl.instance().binding(uiSourceCode);
|
|
47
48
|
if (binding) {
|
|
48
49
|
if (!Common.ParsedURL.schemeIs(binding.fileSystem.url(), 'file:')) {
|
|
49
50
|
return null;
|
|
50
51
|
}
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
return icon;
|
|
52
|
+
const dotClass = Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance().project() ===
|
|
53
|
+
binding.fileSystem.project() ?
|
|
54
|
+
'purple' :
|
|
55
|
+
'green';
|
|
56
|
+
// clang-format off
|
|
57
|
+
return html`<devtools-icon class="small dot ${dotClass}" name="document"
|
|
58
|
+
title=${PersistenceUtils.tooltipForUISourceCode(binding.network)}>
|
|
59
|
+
</devtools-icon>`;
|
|
60
|
+
// clang-format on
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
if (uiSourceCode.project().type() !== Workspace.Workspace.projectTypes.FileSystem ||
|
|
@@ -68,18 +67,16 @@ export class PersistenceUtils {
|
|
|
68
67
|
|
|
69
68
|
if (Persistence.NetworkPersistenceManager.NetworkPersistenceManager.instance().isActiveHeaderOverrides(
|
|
70
69
|
uiSourceCode)) {
|
|
71
|
-
|
|
72
|
-
icon
|
|
73
|
-
|
|
74
|
-
icon.classList.add('dot', 'purple');
|
|
75
|
-
return icon;
|
|
70
|
+
// clang-format off
|
|
71
|
+
return html`<devtools-icon class="small dot purple" name="document"></devtools-icon>`;
|
|
72
|
+
// clang-format on
|
|
76
73
|
}
|
|
77
74
|
|
|
78
|
-
|
|
79
|
-
icon
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
// clang-format off
|
|
76
|
+
return html`<devtools-icon class="small" name="document"
|
|
77
|
+
title=${PersistenceUtils.tooltipForUISourceCode(uiSourceCode)}>
|
|
78
|
+
</devtools-icon>`;
|
|
79
|
+
// clang-format on
|
|
83
80
|
}
|
|
84
81
|
}
|
|
85
82
|
|
|
@@ -96,7 +93,7 @@ export class LinkDecorator extends Common.ObjectWrapper.ObjectWrapper<Components
|
|
|
96
93
|
this.dispatchEventToListeners(Components.Linkifier.LinkDecorator.Events.LINK_ICON_CHANGED, binding.network);
|
|
97
94
|
}
|
|
98
95
|
|
|
99
|
-
linkIcon(uiSourceCode: Workspace.UISourceCode.UISourceCode):
|
|
96
|
+
linkIcon(uiSourceCode: Workspace.UISourceCode.UISourceCode): LitTemplate|null {
|
|
100
97
|
return PersistenceUtils.iconForUISourceCode(uiSourceCode);
|
|
101
98
|
}
|
|
102
99
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2025 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
|
+
.overlay {
|
|
8
|
+
position: absolute;
|
|
9
|
+
z-index: 1000;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
align-items: center;
|
|
13
|
+
|
|
14
|
+
/* From the other bubble */
|
|
15
|
+
background-color: var(--color-background-inverted);
|
|
16
|
+
color: var(--color-background);
|
|
17
|
+
pointer-events: auto;
|
|
18
|
+
border-radius: var(--sys-shape-corner-extra-small);
|
|
19
|
+
white-space: pre-wrap;
|
|
20
|
+
max-width: 300px;
|
|
21
|
+
width: max-content;
|
|
22
|
+
padding: var(--sys-size-3) var(--sys-size-4);
|
|
23
|
+
font-family: var(--default-font-family);
|
|
24
|
+
font-size: var(--sys-typescale-body2-size);
|
|
25
|
+
font-weight: var(--ref-typeface-weight-medium);
|
|
26
|
+
outline: 2px solid var(--color-background);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.connectorContainer {
|
|
30
|
+
z-index: 1000;
|
|
31
|
+
overflow: visible;
|
|
32
|
+
pointer-events: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.close-button {
|
|
36
|
+
position: absolute;
|
|
37
|
+
top:1px;
|
|
38
|
+
z-index: 1000;
|
|
39
|
+
cursor: pointer;
|
|
40
|
+
}
|
|
@@ -107,3 +107,4 @@ export * as ExtensionServer from './ExtensionServer.js';
|
|
|
107
107
|
export * as ExtensionView from './ExtensionView.js';
|
|
108
108
|
export * as PersistenceUtils from './PersistenceUtils.js';
|
|
109
109
|
export * as DOMLinkifier from './DOMLinkifier.js';
|
|
110
|
+
export * as ExtensionIframe from './ExtensionView.js';
|
|
@@ -8,6 +8,7 @@ import * as Common from '../../core/common/common.js';
|
|
|
8
8
|
import * as Host from '../../core/host/host.js';
|
|
9
9
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
10
10
|
import * as Root from '../../core/root/root.js';
|
|
11
|
+
import * as Protocol from '../../generated/protocol.js';
|
|
11
12
|
import * as AiAssistanceModel from '../../models/ai_assistance/ai_assistance.js';
|
|
12
13
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
13
14
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
@@ -21,6 +22,8 @@ import {PromptBuilder} from './PromptBuilder.js';
|
|
|
21
22
|
|
|
22
23
|
const {render, html} = Lit;
|
|
23
24
|
|
|
25
|
+
const BUILT_IN_AI_DOCUMENTATION = 'https://developer.chrome.com/docs/ai/built-in';
|
|
26
|
+
|
|
24
27
|
const UIStringsNotTranslate = {
|
|
25
28
|
/**
|
|
26
29
|
* @description Link text in the disclaimer dialog, linking to a settings page containing more information
|
|
@@ -85,6 +88,35 @@ const UIStringsNotTranslate = {
|
|
|
85
88
|
* @description Header text if there was an error during AI summary generation
|
|
86
89
|
*/
|
|
87
90
|
summaryNotAvailable: 'Summary not available',
|
|
91
|
+
/**
|
|
92
|
+
* @description Header text informing the user that they can get an AI-generated explanation
|
|
93
|
+
*/
|
|
94
|
+
getHelpForWarning: 'Get help understanding this warning',
|
|
95
|
+
/**
|
|
96
|
+
* @description Header text informing the user that they can get an AI-generated explanation
|
|
97
|
+
*/
|
|
98
|
+
getHelpForError: 'Get help understanding this error',
|
|
99
|
+
/**
|
|
100
|
+
* @description Call to action for downloading an AI model
|
|
101
|
+
*/
|
|
102
|
+
toUseDownload: 'To use Chrome’s Built-in AI here and elsewhere, download the AI model (~4 GB).',
|
|
103
|
+
/**
|
|
104
|
+
* @description Button text to trigger model download
|
|
105
|
+
*/
|
|
106
|
+
downloadModel: 'Download model',
|
|
107
|
+
/**
|
|
108
|
+
* @description Header text while the model download is in progress
|
|
109
|
+
*/
|
|
110
|
+
downloadingAiModel: 'Downloading AI model',
|
|
111
|
+
/**
|
|
112
|
+
* @description Label for a progress bar for the AI model download
|
|
113
|
+
*/
|
|
114
|
+
progress: 'Progress',
|
|
115
|
+
/**
|
|
116
|
+
* @description Progress indicator when the progress status is unknown. If the
|
|
117
|
+
* progress status is known, this is replaced by a progress bar.
|
|
118
|
+
*/
|
|
119
|
+
progressUnknown: 'Progress: unknown',
|
|
88
120
|
} as const;
|
|
89
121
|
|
|
90
122
|
const lockedString = i18n.i18n.lockedString;
|
|
@@ -95,6 +127,8 @@ const EXPLAIN_TEASER_ACTION_ID = 'explain.console-message.teaser';
|
|
|
95
127
|
const SLOW_GENERATION_CUTOFF_MILLISECONDS = 3500;
|
|
96
128
|
|
|
97
129
|
const enum State {
|
|
130
|
+
NO_MODEL = 'no-model',
|
|
131
|
+
DOWNLOADING = 'downloading',
|
|
98
132
|
READY = 'ready',
|
|
99
133
|
GENERATING = 'generating', // Before receiving first chunk
|
|
100
134
|
PARTIAL_TEASER = 'partial-teaser', // After receiving first chunk
|
|
@@ -113,7 +147,91 @@ interface ViewInput {
|
|
|
113
147
|
dontShowChanged: (e: Event) => void;
|
|
114
148
|
hasTellMeMoreButton: boolean;
|
|
115
149
|
isSlowGeneration: boolean;
|
|
150
|
+
onDownloadModelClick: (event: Event) => void;
|
|
151
|
+
downloadProgress: number|null;
|
|
116
152
|
state: State;
|
|
153
|
+
isForWarning: boolean;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function renderNoModel(input: ViewInput): Lit.TemplateResult {
|
|
157
|
+
// clang-format off
|
|
158
|
+
return html`
|
|
159
|
+
<div class="teaser-tooltip-container">
|
|
160
|
+
<div class="response-container">
|
|
161
|
+
<h2>${input.isForWarning ?
|
|
162
|
+
lockedString(UIStringsNotTranslate.getHelpForWarning) :
|
|
163
|
+
lockedString(UIStringsNotTranslate.getHelpForError)}
|
|
164
|
+
</h2>
|
|
165
|
+
<div>You can get quick answers from
|
|
166
|
+
<x-link
|
|
167
|
+
.jslog=${VisualLogging.link().track({click: true, keydown: 'Enter|Space'}).context('insights-teaser-built-in-ai-documentation')}
|
|
168
|
+
class="link"
|
|
169
|
+
href=${BUILT_IN_AI_DOCUMENTATION}
|
|
170
|
+
>
|
|
171
|
+
Chrome’s Built-in AI
|
|
172
|
+
</x-link>
|
|
173
|
+
, without any data leaving your device.
|
|
174
|
+
</div>
|
|
175
|
+
<div>${lockedString(UIStringsNotTranslate.toUseDownload)}</div>
|
|
176
|
+
</div>
|
|
177
|
+
<div class="tooltip-footer">
|
|
178
|
+
<devtools-button
|
|
179
|
+
title=${lockedString(UIStringsNotTranslate.downloadModel)}
|
|
180
|
+
.jslogContext=${'insights-teaser-download-model'}
|
|
181
|
+
.variant=${Buttons.Button.Variant.PRIMARY}
|
|
182
|
+
@click=${input.onDownloadModelClick}
|
|
183
|
+
@focusout=${(e: Event) => {
|
|
184
|
+
e.stopPropagation();
|
|
185
|
+
}}
|
|
186
|
+
>
|
|
187
|
+
${lockedString(UIStringsNotTranslate.downloadModel)}
|
|
188
|
+
</devtools-button>
|
|
189
|
+
${renderDontShowCheckbox(input)}
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
`;
|
|
193
|
+
// clang-format on
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function renderDownloading(input: ViewInput): Lit.TemplateResult {
|
|
197
|
+
const percent = ((input.downloadProgress || 0) * 100).toFixed(0);
|
|
198
|
+
// clang-format off
|
|
199
|
+
return html`
|
|
200
|
+
<div class="teaser-tooltip-container">
|
|
201
|
+
<div class="response-container">
|
|
202
|
+
<h2>${lockedString(UIStringsNotTranslate.downloadingAiModel)}</h2>
|
|
203
|
+
<div class="progress-line">
|
|
204
|
+
${input.downloadProgress === null ?
|
|
205
|
+
html`
|
|
206
|
+
<div class="label">${lockedString(UIStringsNotTranslate.progressUnknown)}</div>
|
|
207
|
+
` : html`
|
|
208
|
+
<div class="label">${lockedString(UIStringsNotTranslate.progress)}</div>
|
|
209
|
+
<div class="indicator-container">
|
|
210
|
+
<div
|
|
211
|
+
class="indicator"
|
|
212
|
+
role="progressbar"
|
|
213
|
+
aria-valuemin="0"
|
|
214
|
+
aria-valuemax="100"
|
|
215
|
+
aria-valuenow=${percent}
|
|
216
|
+
style="width: ${percent}%"
|
|
217
|
+
></div>
|
|
218
|
+
</div>
|
|
219
|
+
`}
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
<div class="tooltip-footer">
|
|
223
|
+
<devtools-button
|
|
224
|
+
title=${lockedString(UIStringsNotTranslate.downloadModel)}
|
|
225
|
+
.jslogContext=${'insights-teaser-download-model'}
|
|
226
|
+
.variant=${Buttons.Button.Variant.PRIMARY}
|
|
227
|
+
.disabled=${true}
|
|
228
|
+
>
|
|
229
|
+
${lockedString(UIStringsNotTranslate.downloadModel)}
|
|
230
|
+
</devtools-button>
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
`;
|
|
234
|
+
// clang-format on
|
|
117
235
|
}
|
|
118
236
|
|
|
119
237
|
function renderGenerating(input: ViewInput): Lit.TemplateResult {
|
|
@@ -249,6 +367,10 @@ export const DEFAULT_VIEW = (input: ViewInput, _output: undefined, target: HTMLE
|
|
|
249
367
|
>
|
|
250
368
|
${(() => {
|
|
251
369
|
switch (input.state) {
|
|
370
|
+
case State.NO_MODEL:
|
|
371
|
+
return renderNoModel(input);
|
|
372
|
+
case State.DOWNLOADING:
|
|
373
|
+
return renderDownloading(input);
|
|
252
374
|
case State.READY:
|
|
253
375
|
case State.GENERATING:
|
|
254
376
|
return renderGenerating(input);
|
|
@@ -280,7 +402,12 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
|
|
|
280
402
|
#timeoutId: ReturnType<typeof setTimeout>|null = null;
|
|
281
403
|
#aidaAvailability?: Host.AidaClient.AidaAccessPreconditions;
|
|
282
404
|
#boundOnAidaAvailabilityChange: () => Promise<void>;
|
|
405
|
+
#boundOnDownloadProgressChange: (event: Common.EventTarget.EventTargetEvent<number>) => void;
|
|
406
|
+
#boundOnSessionCreation: () => void;
|
|
407
|
+
#downloadProgress: number|null = null;
|
|
283
408
|
#state: State;
|
|
409
|
+
#eventListeners: Common.EventTarget.EventDescriptor[] = [];
|
|
410
|
+
#isForWarning: boolean;
|
|
284
411
|
|
|
285
412
|
constructor(uuid: string, consoleViewMessage: ConsoleViewMessage, element?: HTMLElement, view?: View) {
|
|
286
413
|
super(element);
|
|
@@ -288,9 +415,12 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
|
|
|
288
415
|
this.#uuid = uuid;
|
|
289
416
|
this.#promptBuilder = new PromptBuilder(consoleViewMessage);
|
|
290
417
|
this.#consoleViewMessage = consoleViewMessage;
|
|
418
|
+
this.#isForWarning = this.#consoleViewMessage.consoleMessage().level === Protocol.Log.LogEntryLevel.Warning;
|
|
291
419
|
this.#boundOnAidaAvailabilityChange = this.#onAidaAvailabilityChange.bind(this);
|
|
420
|
+
this.#boundOnDownloadProgressChange = this.#onDownloadProgressChange.bind(this);
|
|
421
|
+
this.#boundOnSessionCreation = this.#onSessionCreation.bind(this);
|
|
292
422
|
this.#builtInAi = AiAssistanceModel.BuiltInAi.BuiltInAi.instance();
|
|
293
|
-
this.#state = State.READY;
|
|
423
|
+
this.#state = this.#builtInAi.hasSession() ? State.READY : State.NO_MODEL;
|
|
294
424
|
this.requestUpdate();
|
|
295
425
|
}
|
|
296
426
|
|
|
@@ -330,6 +460,27 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
|
|
|
330
460
|
void this.#showFreDialog();
|
|
331
461
|
}
|
|
332
462
|
|
|
463
|
+
#onDownloadModelClick(event: Event): void {
|
|
464
|
+
event.stopPropagation();
|
|
465
|
+
this.#state = State.DOWNLOADING;
|
|
466
|
+
this.#builtInAi.startDownloadingModel();
|
|
467
|
+
Host.userMetrics.actionTaken(Host.UserMetrics.Action.InsightTeaserModelDownloadStarted);
|
|
468
|
+
this.requestUpdate();
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
#onDownloadProgressChange(event: Common.EventTarget.EventTargetEvent<number>): void {
|
|
472
|
+
this.#downloadProgress = event.data;
|
|
473
|
+
this.requestUpdate();
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
#onSessionCreation(): void {
|
|
477
|
+
if (this.#builtInAi.hasSession() && (this.#state === State.NO_MODEL || this.#state === State.DOWNLOADING)) {
|
|
478
|
+
this.#state = State.READY;
|
|
479
|
+
Host.userMetrics.actionTaken(Host.UserMetrics.Action.InsightTeaserModelDownloadCompleted);
|
|
480
|
+
this.maybeGenerateTeaser();
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
333
484
|
async #showFreDialog(): Promise<void> {
|
|
334
485
|
const noLogging = Root.Runtime.hostConfig.aidaAvailability?.enterprisePolicyValue ===
|
|
335
486
|
Root.Runtime.GenAiEnterprisePolicyValue.ALLOW_WITHOUT_LOGGING;
|
|
@@ -373,14 +524,41 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
|
|
|
373
524
|
}
|
|
374
525
|
|
|
375
526
|
maybeGenerateTeaser(): void {
|
|
527
|
+
const startGeneratingTeaser = (): void => {
|
|
528
|
+
if (!this.#isInactive &&
|
|
529
|
+
Common.Settings.Settings.instance().moduleSetting('console-insight-teasers-enabled').get()) {
|
|
530
|
+
void this.#generateTeaserText();
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
const hasSession = this.#builtInAi.hasSession();
|
|
535
|
+
|
|
376
536
|
switch (this.#state) {
|
|
377
|
-
case State.
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
537
|
+
case State.NO_MODEL:
|
|
538
|
+
case State.DOWNLOADING:
|
|
539
|
+
if (hasSession) {
|
|
540
|
+
this.#state = State.READY;
|
|
541
|
+
startGeneratingTeaser();
|
|
542
|
+
} else {
|
|
543
|
+
if (this.#eventListeners.length === 0) {
|
|
544
|
+
this.#eventListeners = [
|
|
545
|
+
this.#builtInAi.addEventListener(
|
|
546
|
+
AiAssistanceModel.BuiltInAi.Events.DOWNLOAD_PROGRESS_CHANGED, this.#boundOnDownloadProgressChange),
|
|
547
|
+
this.#builtInAi.addEventListener(
|
|
548
|
+
AiAssistanceModel.BuiltInAi.Events.DOWNLOADED_AND_SESSION_CREATED, this.#boundOnSessionCreation),
|
|
549
|
+
];
|
|
550
|
+
}
|
|
551
|
+
if (this.#builtInAi.isDownloading()) {
|
|
552
|
+
this.#state = State.DOWNLOADING;
|
|
553
|
+
this.#downloadProgress = this.#builtInAi.getDownloadProgress();
|
|
554
|
+
}
|
|
381
555
|
}
|
|
382
556
|
this.requestUpdate();
|
|
383
557
|
return;
|
|
558
|
+
case State.READY:
|
|
559
|
+
startGeneratingTeaser();
|
|
560
|
+
this.requestUpdate();
|
|
561
|
+
return;
|
|
384
562
|
case State.GENERATING:
|
|
385
563
|
console.error('Trying trigger teaser generation when state is "GENERATING"');
|
|
386
564
|
return;
|
|
@@ -406,6 +584,7 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
|
|
|
406
584
|
if (this.#timeoutId) {
|
|
407
585
|
clearTimeout(this.#timeoutId);
|
|
408
586
|
}
|
|
587
|
+
Common.EventTarget.removeEventListeners(this.#eventListeners);
|
|
409
588
|
}
|
|
410
589
|
|
|
411
590
|
setInactive(isInactive: boolean): void {
|
|
@@ -502,7 +681,10 @@ export class ConsoleInsightTeaser extends UI.Widget.Widget {
|
|
|
502
681
|
dontShowChanged: this.#dontShowChanged.bind(this),
|
|
503
682
|
hasTellMeMoreButton: this.#hasTellMeMoreButton(),
|
|
504
683
|
isSlowGeneration: this.#isSlow,
|
|
684
|
+
onDownloadModelClick: this.#onDownloadModelClick.bind(this),
|
|
685
|
+
downloadProgress: this.#downloadProgress,
|
|
505
686
|
state: this.#state,
|
|
687
|
+
isForWarning: this.#isForWarning,
|
|
506
688
|
},
|
|
507
689
|
undefined, this.contentElement);
|
|
508
690
|
}
|