chrome-devtools-frontend 1.0.1555430 → 1.0.1558690
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/front_end/core/common/Object.ts +5 -1
- package/front_end/core/host/ResourceLoader.ts +1 -1
- package/front_end/core/host/UserMetrics.ts +3 -1
- package/front_end/core/sdk/DOMModel.ts +7 -0
- package/front_end/core/sdk/NetworkManager.ts +0 -7
- package/front_end/core/sdk/SourceMap.ts +16 -2
- package/front_end/core/sdk/SourceMapManager.ts +1 -1
- package/front_end/core/sdk/SourceMapScopesInfo.ts +11 -4
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +3 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +119 -8
- package/front_end/entrypoints/formatter_worker/Substitute.ts +1 -1
- package/front_end/entrypoints/main/GlobalAiButton.ts +5 -1
- package/front_end/generated/Deprecation.ts +0 -7
- package/front_end/generated/InspectorBackendCommands.ts +4 -4
- package/front_end/generated/protocol.ts +9 -1
- package/front_end/models/ai_assistance/AiConversation.ts +71 -10
- package/front_end/models/ai_assistance/ArtifactsManager.ts +67 -0
- package/front_end/models/ai_assistance/ConversationHandler.ts +3 -2
- package/front_end/models/ai_assistance/agents/AiAgent.ts +17 -27
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +151 -3
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -1
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +0 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +3 -3
- package/front_end/models/annotations/AnnotationRepository.ts +2 -2
- package/front_end/models/bindings/CompilerScriptMapping.ts +7 -6
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +4 -4
- package/front_end/models/greendev/Prototypes.ts +56 -0
- package/front_end/models/greendev/README.md +5 -0
- package/front_end/models/greendev/greendev.ts +5 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +2 -2
- package/front_end/models/stack_trace/StackTraceImpl.ts +5 -3
- package/front_end/models/stack_trace/StackTraceModel.ts +53 -40
- package/front_end/models/trace/EventsSerializer.ts +8 -2
- package/front_end/models/trace/extras/TraceTree.ts +4 -2
- package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +2 -2
- package/front_end/models/trace/insights/LCPDiscovery.ts +0 -2
- package/front_end/models/trace/types/TraceEvents.ts +0 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +96 -91
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +16 -0
- package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +109 -7
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -2
- package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +7 -8
- package/front_end/panels/ai_assistance/components/PerformanceAgentFlameChart.ts +15 -8
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +9 -9
- package/front_end/panels/ai_assistance/components/artifactsViewer.css +6 -1
- package/front_end/panels/ai_assistance/components/collapsibleAssistanceContentWidget.css +5 -6
- package/front_end/panels/application/AppManifestView.ts +360 -391
- package/front_end/panels/application/ApplicationPanelSidebar.ts +24 -57
- package/front_end/panels/application/CookieItemsView.ts +1 -0
- package/front_end/panels/application/OpenedWindowDetailsView.ts +2 -0
- package/front_end/panels/application/ServiceWorkersView.ts +2 -0
- package/front_end/panels/application/SharedStorageTreeElement.ts +3 -0
- package/front_end/panels/application/StorageView.ts +1 -0
- package/front_end/panels/application/appManifestView.css +49 -1
- package/front_end/panels/application/components/ProtocolHandlersView.ts +2 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +4 -3
- package/front_end/panels/elements/ElementsTreeElement.ts +30 -1
- package/front_end/panels/elements/ElementsTreeOutline.ts +1 -1
- package/front_end/panels/elements/ElementsTreeOutlineRenderer.ts +7 -1
- package/front_end/panels/elements/components/AdornerManager.ts +8 -0
- package/front_end/panels/emulation/DeviceModeToolbar.ts +3 -1
- package/front_end/panels/issues/AffectedResourcesView.ts +0 -1
- package/front_end/panels/lighthouse/LighthousePanel.ts +10 -0
- package/front_end/panels/lighthouse/lighthousePanel.css +46 -3
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +4 -8
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +148 -97
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryViewer.ts +1 -1
- package/front_end/panels/linear_memory_inspector/components/linearMemoryValueInterpreter.css +37 -35
- package/front_end/panels/network/NetworkLogViewColumns.ts +9 -9
- package/front_end/panels/network/RequestCookiesView.ts +125 -141
- package/front_end/panels/network/components/RequestHeadersView.ts +2 -2
- package/front_end/panels/network/requestCookiesView.css +22 -20
- package/front_end/panels/recorder/components/RecordingView.ts +3 -3
- package/front_end/panels/recorder/components/StepView.ts +2 -1
- package/front_end/panels/settings/SettingsScreen.ts +133 -1
- package/front_end/panels/settings/keybindsSettingsTab.css +4 -0
- package/front_end/panels/settings/settings-meta.ts +24 -0
- package/front_end/panels/settings/settingsScreen.css +4 -0
- package/front_end/panels/sources/CallStackSidebarPane.ts +7 -3
- package/front_end/panels/sources/DebuggerPausedMessage.ts +125 -90
- package/front_end/panels/sources/SourcesPanel.ts +10 -7
- package/front_end/panels/sources/UISourceCodeFrame.ts +3 -17
- package/front_end/panels/sources/debuggerPausedMessage.css +8 -0
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +2 -1
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +2 -0
- package/front_end/third_party/acorn/estree-legacy.d.ts +4 -0
- 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/Browser.d.ts +12 -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/CDPSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/CDPSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +14 -2
- 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/bidi/Browser.d.ts +3 -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 +6 -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/HTTPRequest.d.ts +0 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js +0 -20
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +3 -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 +10 -14
- 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 +1 -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 -0
- 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/core/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +3 -1
- 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 +12 -0
- 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/EmulationManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +3 -1
- 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 +9 -2
- 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/common/BrowserConnector.js +21 -7
- 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/EventEmitter.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/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 +26 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +86 -20
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +12 -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/CDPSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/CDPSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +14 -2
- 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/bidi/Browser.d.ts +3 -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 +6 -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/HTTPRequest.d.ts +0 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js +0 -20
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +3 -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 +11 -15
- 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 +1 -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 -0
- 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/core/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +3 -1
- 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 +12 -0
- 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/EmulationManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.js +22 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +3 -1
- 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 +9 -2
- 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/common/BrowserConnector.js +21 -7
- 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/EventEmitter.d.ts.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 +26 -0
- package/front_end/third_party/puppeteer/package/package.json +2 -2
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +18 -0
- package/front_end/third_party/puppeteer/package/src/api/CDPSession.ts +1 -2
- package/front_end/third_party/puppeteer/package/src/api/ElementHandle.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/api/Frame.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +18 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +13 -0
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPRequest.ts +0 -33
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +14 -28
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +19 -0
- package/front_end/third_party/puppeteer/package/src/bidi/core/Connection.ts +3 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +19 -0
- package/front_end/third_party/puppeteer/package/src/cdp/EmulationManager.ts +30 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +15 -6
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +29 -10
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +3 -3
- 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/ui/components/icon_button/iconButton.css +3 -1
- package/front_end/ui/components/report_view/ReportView.docs.ts +37 -0
- package/front_end/ui/components/report_view/ReportView.ts +12 -6
- package/front_end/ui/components/report_view/report.css +16 -0
- package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +135 -7
- package/front_end/ui/components/text_editor/config.ts +6 -6
- package/front_end/ui/legacy/ContextMenu.ts +11 -2
- package/front_end/ui/legacy/Floaty.ts +5 -9
- package/front_end/ui/legacy/InspectorView.ts +2 -1
- package/front_end/ui/legacy/ReportView.ts +5 -4
- package/front_end/ui/legacy/TextPrompt.ts +1 -1
- package/front_end/ui/legacy/Toolbar.ts +4 -0
- package/front_end/ui/legacy/UIUtils.ts +0 -2
- package/front_end/ui/legacy/Widget.ts +7 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +18 -3
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +3 -3
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +6 -0
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +0 -1
- package/front_end/ui/legacy/reportView.css +0 -24
- package/front_end/ui/visual_logging/KnownContextValues.ts +7 -0
- package/package.json +1 -1
|
@@ -12,6 +12,13 @@ import * as UI from '../../../ui/legacy/legacy.js';
|
|
|
12
12
|
import * as VisualLogging from '../../visual_logging/visual_logging.js';
|
|
13
13
|
|
|
14
14
|
import {AiCodeCompletionTeaserPlaceholder} from './AiCodeCompletionTeaserPlaceholder.js';
|
|
15
|
+
import {
|
|
16
|
+
acceptAiAutoCompleteSuggestion,
|
|
17
|
+
aiAutoCompleteSuggestion,
|
|
18
|
+
aiAutoCompleteSuggestionState,
|
|
19
|
+
hasActiveAiSuggestion,
|
|
20
|
+
setAiAutoCompleteSuggestion,
|
|
21
|
+
} from './config.js';
|
|
15
22
|
import type {TextEditor} from './TextEditor.js';
|
|
16
23
|
|
|
17
24
|
export enum AiCodeGenerationTeaserMode {
|
|
@@ -28,30 +35,47 @@ const aiCodeGenerationTeaserModeState = CodeMirror.StateField.define<AiCodeGener
|
|
|
28
35
|
},
|
|
29
36
|
});
|
|
30
37
|
|
|
38
|
+
export interface AiCodeGenerationConfig {
|
|
39
|
+
generationContext: {
|
|
40
|
+
inferenceLanguage?: Host.AidaClient.AidaInferenceLanguage,
|
|
41
|
+
};
|
|
42
|
+
onSuggestionAccepted: () => void;
|
|
43
|
+
onRequestTriggered: () => void;
|
|
44
|
+
// TODO(b/445394511): Move exposing citations to onSuggestionAccepted
|
|
45
|
+
onResponseReceived: (citations: Host.AidaClient.Citation[]) => void;
|
|
46
|
+
}
|
|
47
|
+
|
|
31
48
|
export class AiCodeGenerationProvider {
|
|
32
49
|
#devtoolsLocale: string;
|
|
33
50
|
#aiCodeCompletionSetting = Common.Settings.Settings.instance().createSetting('ai-code-completion-enabled', false);
|
|
34
51
|
#generationTeaserCompartment = new CodeMirror.Compartment();
|
|
35
52
|
#generationTeaser: PanelCommon.AiCodeGenerationTeaser;
|
|
36
53
|
#editor?: TextEditor;
|
|
54
|
+
#aiCodeGenerationConfig: AiCodeGenerationConfig;
|
|
55
|
+
#aiCodeGeneration?: AiCodeGeneration.AiCodeGeneration.AiCodeGeneration;
|
|
37
56
|
|
|
57
|
+
#aidaClient: Host.AidaClient.AidaClient = new Host.AidaClient.AidaClient();
|
|
38
58
|
#boundOnUpdateAiCodeGenerationState = this.#updateAiCodeGenerationState.bind(this);
|
|
59
|
+
#controller = new AbortController();
|
|
39
60
|
|
|
40
|
-
private constructor() {
|
|
61
|
+
private constructor(aiCodeGenerationConfig: AiCodeGenerationConfig) {
|
|
41
62
|
this.#devtoolsLocale = i18n.DevToolsLocale.DevToolsLocale.instance().locale;
|
|
42
63
|
if (!AiCodeGeneration.AiCodeGeneration.AiCodeGeneration.isAiCodeGenerationEnabled(this.#devtoolsLocale)) {
|
|
43
64
|
throw new Error('AI code generation feature is not enabled.');
|
|
44
65
|
}
|
|
45
66
|
this.#generationTeaser = new PanelCommon.AiCodeGenerationTeaser();
|
|
67
|
+
this.#aiCodeGenerationConfig = aiCodeGenerationConfig;
|
|
46
68
|
}
|
|
47
69
|
|
|
48
|
-
static createInstance(): AiCodeGenerationProvider {
|
|
49
|
-
return new AiCodeGenerationProvider();
|
|
70
|
+
static createInstance(aiCodeGenerationConfig: AiCodeGenerationConfig): AiCodeGenerationProvider {
|
|
71
|
+
return new AiCodeGenerationProvider(aiCodeGenerationConfig);
|
|
50
72
|
}
|
|
51
73
|
|
|
52
74
|
extension(): CodeMirror.Extension[] {
|
|
53
75
|
return [
|
|
54
76
|
CodeMirror.EditorView.updateListener.of(update => this.activateTeaser(update)),
|
|
77
|
+
aiAutoCompleteSuggestion,
|
|
78
|
+
aiAutoCompleteSuggestionState,
|
|
55
79
|
aiCodeGenerationTeaserModeState,
|
|
56
80
|
this.#generationTeaserCompartment.of([]),
|
|
57
81
|
CodeMirror.Prec.highest(CodeMirror.keymap.of(this.#editorKeymap())),
|
|
@@ -59,6 +83,7 @@ export class AiCodeGenerationProvider {
|
|
|
59
83
|
}
|
|
60
84
|
|
|
61
85
|
dispose(): void {
|
|
86
|
+
this.#controller.abort();
|
|
62
87
|
this.#cleanupAiCodeGeneration();
|
|
63
88
|
}
|
|
64
89
|
|
|
@@ -71,6 +96,10 @@ export class AiCodeGenerationProvider {
|
|
|
71
96
|
}
|
|
72
97
|
|
|
73
98
|
#setupAiCodeGeneration(): void {
|
|
99
|
+
if (this.#aiCodeGeneration) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
this.#aiCodeGeneration = new AiCodeGeneration.AiCodeGeneration.AiCodeGeneration({aidaClient: this.#aidaClient});
|
|
74
103
|
this.#editor?.dispatch({
|
|
75
104
|
effects:
|
|
76
105
|
[this.#generationTeaserCompartment.reconfigure([aiCodeGenerationTeaserExtension(this.#generationTeaser)])],
|
|
@@ -78,6 +107,10 @@ export class AiCodeGenerationProvider {
|
|
|
78
107
|
}
|
|
79
108
|
|
|
80
109
|
#cleanupAiCodeGeneration(): void {
|
|
110
|
+
if (!this.#aiCodeGeneration) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
this.#aiCodeGeneration = undefined;
|
|
81
114
|
this.#editor?.dispatch({
|
|
82
115
|
effects: [this.#generationTeaserCompartment.reconfigure([])],
|
|
83
116
|
});
|
|
@@ -99,23 +132,51 @@ export class AiCodeGenerationProvider {
|
|
|
99
132
|
{
|
|
100
133
|
key: 'Escape',
|
|
101
134
|
run: (): boolean => {
|
|
102
|
-
if (!this.#editor || !this.#
|
|
135
|
+
if (!this.#editor || !this.#aiCodeGeneration) {
|
|
103
136
|
return false;
|
|
104
137
|
}
|
|
105
|
-
this.#editor.
|
|
138
|
+
if (hasActiveAiSuggestion(this.#editor.state)) {
|
|
139
|
+
this.#editor.dispatch({
|
|
140
|
+
effects: setAiAutoCompleteSuggestion.of(null),
|
|
141
|
+
});
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
144
|
+
if (this.#generationTeaser.isShowing() && this.#generationTeaser.loading) {
|
|
145
|
+
this.#controller.abort();
|
|
146
|
+
this.#controller = new AbortController();
|
|
147
|
+
this.#dismissTeaser();
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
return false;
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
key: 'Tab',
|
|
155
|
+
run: (): boolean => {
|
|
156
|
+
if (!this.#aiCodeGeneration || !this.#editor || !hasActiveAiSuggestion(this.#editor.state)) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
const {accepted, suggestion} = acceptAiAutoCompleteSuggestion(this.#editor.editor);
|
|
160
|
+
if (!accepted) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
if (suggestion?.rpcGlobalId) {
|
|
164
|
+
this.#aiCodeGeneration.registerUserAcceptance(suggestion.rpcGlobalId, suggestion.sampleId);
|
|
165
|
+
}
|
|
166
|
+
this.#aiCodeGenerationConfig?.onSuggestionAccepted();
|
|
106
167
|
return true;
|
|
107
168
|
},
|
|
108
169
|
},
|
|
109
170
|
{
|
|
110
171
|
any: (_view: unknown, event: KeyboardEvent) => {
|
|
111
|
-
if (!this.#editor || !this.#generationTeaser.isShowing()) {
|
|
172
|
+
if (!this.#editor || !this.#aiCodeGeneration || !this.#generationTeaser.isShowing()) {
|
|
112
173
|
return false;
|
|
113
174
|
}
|
|
114
175
|
if (UI.KeyboardShortcut.KeyboardShortcut.eventHasCtrlEquivalentKey(event)) {
|
|
115
176
|
if (event.key === 'i') {
|
|
116
177
|
event.consume(true);
|
|
117
178
|
void VisualLogging.logKeyDown(event.currentTarget, event, 'ai-code-generation.triggered');
|
|
118
|
-
this.#
|
|
179
|
+
void this.#triggerAiCodeGeneration({signal: this.#controller.signal});
|
|
119
180
|
return true;
|
|
120
181
|
}
|
|
121
182
|
}
|
|
@@ -125,6 +186,11 @@ export class AiCodeGenerationProvider {
|
|
|
125
186
|
];
|
|
126
187
|
}
|
|
127
188
|
|
|
189
|
+
#dismissTeaser(): void {
|
|
190
|
+
this.#generationTeaser.loading = false;
|
|
191
|
+
this.#editor?.dispatch({effects: setAiCodeGenerationTeaserMode.of(AiCodeGenerationTeaserMode.DISMISSED)});
|
|
192
|
+
}
|
|
193
|
+
|
|
128
194
|
async activateTeaser(update: CodeMirror.ViewUpdate): Promise<void> {
|
|
129
195
|
const currentTeaserMode = update.state.field(aiCodeGenerationTeaserModeState);
|
|
130
196
|
if (currentTeaserMode === AiCodeGenerationTeaserMode.ACTIVE) {
|
|
@@ -135,6 +201,68 @@ export class AiCodeGenerationProvider {
|
|
|
135
201
|
}
|
|
136
202
|
update.view.dispatch({effects: setAiCodeGenerationTeaserMode.of(AiCodeGenerationTeaserMode.ACTIVE)});
|
|
137
203
|
}
|
|
204
|
+
|
|
205
|
+
async #triggerAiCodeGeneration(options?: {signal?: AbortSignal}): Promise<void> {
|
|
206
|
+
if (!this.#editor || !this.#aiCodeGeneration) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
this.#generationTeaser.loading = true;
|
|
211
|
+
const cursor = this.#editor.state.selection.main.head;
|
|
212
|
+
// TODO(b/445899453): Detect all types of comments
|
|
213
|
+
const query = this.#editor.state.doc.lineAt(cursor).text;
|
|
214
|
+
if (query.trim().length === 0) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
try {
|
|
219
|
+
const startTime = performance.now();
|
|
220
|
+
this.#aiCodeGenerationConfig?.onRequestTriggered();
|
|
221
|
+
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiCodeGenerationRequestTriggered);
|
|
222
|
+
|
|
223
|
+
const generationResponse = await this.#aiCodeGeneration.generateCode(
|
|
224
|
+
query, AiCodeGeneration.AiCodeGeneration.basePreamble,
|
|
225
|
+
this.#aiCodeGenerationConfig?.generationContext.inferenceLanguage, options);
|
|
226
|
+
|
|
227
|
+
if (this.#generationTeaser) {
|
|
228
|
+
this.#dismissTeaser();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (!generationResponse || generationResponse.samples.length === 0) {
|
|
232
|
+
this.#aiCodeGenerationConfig?.onResponseReceived([]);
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const topSample = generationResponse.samples[0];
|
|
236
|
+
|
|
237
|
+
const shouldBlock = topSample.attributionMetadata?.attributionAction === Host.AidaClient.RecitationAction.BLOCK;
|
|
238
|
+
if (shouldBlock) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
this.#editor.dispatch({
|
|
243
|
+
effects: setAiAutoCompleteSuggestion.of({
|
|
244
|
+
text: '\n' + topSample.generationString,
|
|
245
|
+
from: cursor,
|
|
246
|
+
rpcGlobalId: generationResponse.metadata.rpcGlobalId,
|
|
247
|
+
sampleId: topSample.sampleId,
|
|
248
|
+
startTime,
|
|
249
|
+
onImpression: this.#aiCodeGeneration?.registerUserImpression.bind(this.#aiCodeGeneration),
|
|
250
|
+
})
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
AiCodeGeneration.debugLog('Suggestion dispatched to the editor', topSample.generationString);
|
|
254
|
+
const citations = topSample.attributionMetadata?.citations ?? [];
|
|
255
|
+
this.#aiCodeGenerationConfig?.onResponseReceived(citations);
|
|
256
|
+
} catch (e) {
|
|
257
|
+
AiCodeGeneration.debugLog('Error while fetching code generation suggestions from AIDA', e);
|
|
258
|
+
this.#aiCodeGenerationConfig?.onResponseReceived([]);
|
|
259
|
+
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiCodeGenerationError);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (this.#generationTeaser) {
|
|
263
|
+
this.#dismissTeaser();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
138
266
|
}
|
|
139
267
|
|
|
140
268
|
// TODO(b/445899453): Handle teaser's discovery mode
|
|
@@ -490,7 +490,7 @@ export interface ActiveSuggestion {
|
|
|
490
490
|
rpcGlobalId?: Host.AidaClient.RpcGlobalId;
|
|
491
491
|
startTime: number;
|
|
492
492
|
onImpression: (rpcGlobalId: Host.AidaClient.RpcGlobalId, latency: number, sampleId?: number) => void;
|
|
493
|
-
clearCachedRequest
|
|
493
|
+
clearCachedRequest?: () => void;
|
|
494
494
|
}
|
|
495
495
|
|
|
496
496
|
export const aiAutoCompleteSuggestionState = CM.StateField.define<ActiveSuggestion|null>({
|
|
@@ -501,7 +501,7 @@ export const aiAutoCompleteSuggestionState = CM.StateField.define<ActiveSuggesti
|
|
|
501
501
|
if (effect.value) {
|
|
502
502
|
return effect.value;
|
|
503
503
|
}
|
|
504
|
-
value?.clearCachedRequest();
|
|
504
|
+
value?.clearCachedRequest?.();
|
|
505
505
|
return null;
|
|
506
506
|
}
|
|
507
507
|
}
|
|
@@ -514,14 +514,14 @@ export const aiAutoCompleteSuggestionState = CM.StateField.define<ActiveSuggesti
|
|
|
514
514
|
// between when the request was sent and the response was received.
|
|
515
515
|
// We check if the position is still valid before trying to map it.
|
|
516
516
|
if (value.from > tr.state.doc.length) {
|
|
517
|
-
value.clearCachedRequest();
|
|
517
|
+
value.clearCachedRequest?.();
|
|
518
518
|
return null;
|
|
519
519
|
}
|
|
520
520
|
|
|
521
521
|
// If deletion occurs, set to null. Otherwise, the mapping might fail if
|
|
522
522
|
// the position is inside the deleted range.
|
|
523
523
|
if (tr.docChanged && tr.state.doc.length < tr.startState.doc.length) {
|
|
524
|
-
value.clearCachedRequest();
|
|
524
|
+
value.clearCachedRequest?.();
|
|
525
525
|
return null;
|
|
526
526
|
}
|
|
527
527
|
|
|
@@ -530,7 +530,7 @@ export const aiAutoCompleteSuggestionState = CM.StateField.define<ActiveSuggesti
|
|
|
530
530
|
|
|
531
531
|
// If a change happened before the position from which suggestion was generated, set to null.
|
|
532
532
|
if (tr.docChanged && head < from) {
|
|
533
|
-
value.clearCachedRequest();
|
|
533
|
+
value.clearCachedRequest?.();
|
|
534
534
|
return null;
|
|
535
535
|
}
|
|
536
536
|
|
|
@@ -571,7 +571,7 @@ export function acceptAiAutoCompleteSuggestion(view: CM.EditorView):
|
|
|
571
571
|
userEvent: 'input.complete',
|
|
572
572
|
});
|
|
573
573
|
|
|
574
|
-
suggestion.clearCachedRequest();
|
|
574
|
+
suggestion.clearCachedRequest?.();
|
|
575
575
|
return {accepted: true, suggestion};
|
|
576
576
|
}
|
|
577
577
|
|
|
@@ -787,8 +787,17 @@ export class ContextMenu extends SubMenu {
|
|
|
787
787
|
|
|
788
788
|
const menuObject = this.buildMenuDescriptors();
|
|
789
789
|
const ownerDocument = (this.eventTarget as HTMLElement).ownerDocument;
|
|
790
|
-
|
|
791
|
-
|
|
790
|
+
|
|
791
|
+
let useSoftMenu = this.useSoftMenu || ContextMenu.useSoftMenu ||
|
|
792
|
+
Host.InspectorFrontendHost.InspectorFrontendHostInstance.isHostedMode();
|
|
793
|
+
|
|
794
|
+
// Allow force opening a Native menu when DevTools is under test.
|
|
795
|
+
// This allows opening DevTools on DevTools
|
|
796
|
+
if (!this.useSoftMenu && ContextMenu.useSoftMenu && this.event.altKey) {
|
|
797
|
+
useSoftMenu = false;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
if (useSoftMenu) {
|
|
792
801
|
this.softMenu = new SoftContextMenu(
|
|
793
802
|
(menuObject as SoftContextMenuDescriptor[]), this.itemSelected.bind(this), this.keepOpen, undefined,
|
|
794
803
|
this.onSoftMenuClosed, this.loggableParent);
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
6
|
import * as Platform from '../../core/platform/platform.js';
|
|
7
|
-
import * as Root from '../../core/root/root.js';
|
|
8
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
9
8
|
import type * as Protocol from '../../generated/protocol.js';
|
|
9
|
+
import * as GreenDev from '../../models/greendev/greendev.js';
|
|
10
10
|
import * as Logs from '../../models/logs/logs.js';
|
|
11
11
|
import * as Trace from '../../models/trace/trace.js';
|
|
12
12
|
import * as Buttons from '../components/buttons/buttons.js';
|
|
@@ -89,7 +89,7 @@ export class Floaty {
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
#insertIntoDOM(): void {
|
|
92
|
-
if (
|
|
92
|
+
if (GreenDev.Prototypes.instance().isEnabled('inDevToolsFloaty')) {
|
|
93
93
|
this.#floaty.show(this.#container);
|
|
94
94
|
document.body.appendChild(this.#container);
|
|
95
95
|
document.body.addEventListener('keydown', this.#boundKeyDown);
|
|
@@ -169,19 +169,15 @@ type FloatyClickInput = {
|
|
|
169
169
|
},
|
|
170
170
|
};
|
|
171
171
|
|
|
172
|
-
export function enabled(): boolean {
|
|
173
|
-
return Root.Runtime.hostConfig.devToolsGreenDevUi?.enabled === true;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
172
|
export function onFloatyOpen(): void {
|
|
177
|
-
if (!
|
|
173
|
+
if (!GreenDev.Prototypes.instance().isEnabled('inDevToolsFloaty')) {
|
|
178
174
|
return;
|
|
179
175
|
}
|
|
180
176
|
Floaty.instance().open();
|
|
181
177
|
}
|
|
182
178
|
|
|
183
179
|
export function onFloatyContextDelete(context: FloatyContextSelection): void {
|
|
184
|
-
if (!
|
|
180
|
+
if (!GreenDev.Prototypes.instance().isEnabled('inDevToolsFloaty')) {
|
|
185
181
|
return;
|
|
186
182
|
}
|
|
187
183
|
Floaty.instance().deleteContext(context);
|
|
@@ -194,7 +190,7 @@ export function onFloatyContextDelete(context: FloatyContextSelection): void {
|
|
|
194
190
|
* click behaviour.
|
|
195
191
|
*/
|
|
196
192
|
export function onFloatyClick(input: FloatyClickInput): boolean {
|
|
197
|
-
if (!
|
|
193
|
+
if (!GreenDev.Prototypes.instance().isEnabled('inDevToolsFloaty')) {
|
|
198
194
|
return false;
|
|
199
195
|
}
|
|
200
196
|
const floaty = Floaty.instance();
|
|
@@ -8,6 +8,7 @@ import * as Host from '../../core/host/host.js';
|
|
|
8
8
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
9
9
|
import * as Root from '../../core/root/root.js';
|
|
10
10
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
11
|
+
import * as GreenDev from '../../models/greendev/greendev.js';
|
|
11
12
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
12
13
|
import {createIcon, type Icon} from '../kit/kit.js';
|
|
13
14
|
import * as VisualLogging from '../visual_logging/visual_logging.js';
|
|
@@ -375,7 +376,7 @@ export class InspectorView extends VBox implements ViewLocationResolver {
|
|
|
375
376
|
DockControllerEvents.DOCK_SIDE_CHANGED, this.#applyDrawerOrientationForDockSide, this);
|
|
376
377
|
this.#applyDrawerOrientationForDockSide();
|
|
377
378
|
|
|
378
|
-
if (
|
|
379
|
+
if (GreenDev.Prototypes.instance().isEnabled('inDevToolsFloaty')) {
|
|
379
380
|
Floaty.instance({
|
|
380
381
|
forceNew: true,
|
|
381
382
|
document: this.element.ownerDocument,
|
|
@@ -13,6 +13,11 @@ import reportViewStyles from './reportView.css.js';
|
|
|
13
13
|
import type {Toolbar} from './Toolbar.js';
|
|
14
14
|
import {Tooltip} from './Tooltip.js';
|
|
15
15
|
import {VBox} from './Widget.js';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Please consider using the web component version of this widget
|
|
19
|
+
* (`ui/components/report_view/ReportView.ts`) for new code.
|
|
20
|
+
*/
|
|
16
21
|
export class ReportView extends VBox {
|
|
17
22
|
private readonly contentBox: HTMLElement;
|
|
18
23
|
private headerElement: HTMLElement;
|
|
@@ -225,8 +230,4 @@ export class Section extends VBox {
|
|
|
225
230
|
ARIAUtils.markAsGroup(this.fieldList);
|
|
226
231
|
ARIAUtils.setLabel(this.fieldList, this.title());
|
|
227
232
|
}
|
|
228
|
-
|
|
229
|
-
setIconMasked(masked: boolean): void {
|
|
230
|
-
this.element.classList.toggle('show-mask', masked);
|
|
231
|
-
}
|
|
232
233
|
}
|
|
@@ -327,7 +327,7 @@ export class TextPrompt extends Common.ObjectWrapper.ObjectWrapper<EventTypes> i
|
|
|
327
327
|
* or the |blurListener| parameter to register a "blur" event listener on the |element|
|
|
328
328
|
* (since the "blur" event does not bubble.)
|
|
329
329
|
*/
|
|
330
|
-
attachAndStartEditing(element: Element, blurListener
|
|
330
|
+
attachAndStartEditing(element: Element, blurListener?: (arg0: Event) => void): Element {
|
|
331
331
|
const proxyElement = this.#attach(element);
|
|
332
332
|
this.startEditing(blurListener);
|
|
333
333
|
return proxyElement;
|
|
@@ -1166,6 +1166,10 @@ export class ToolbarComboBox extends ToolbarItem<void, HTMLSelectElement> {
|
|
|
1166
1166
|
}
|
|
1167
1167
|
}
|
|
1168
1168
|
|
|
1169
|
+
turnShrinkable(): void {
|
|
1170
|
+
this.element.classList.add('toolbar-has-dropdown-shrinkable');
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1169
1173
|
size(): number {
|
|
1170
1174
|
return this.element.childElementCount;
|
|
1171
1175
|
}
|
|
@@ -1295,8 +1295,6 @@ export class DevToolsIconLabel extends HTMLElement {
|
|
|
1295
1295
|
|
|
1296
1296
|
set data(data: IconData) {
|
|
1297
1297
|
this.#icon.data = data;
|
|
1298
|
-
// TODO(crbug.com/1427397): Clean this up. This was necessary so `DevToolsIconLabel` can use Lit icon
|
|
1299
|
-
// while being backwards-compatible with the legacy Icon while working for both small and large icons.
|
|
1300
1298
|
if (data.height === '14px') {
|
|
1301
1299
|
this.#icon.style.setProperty('margin-bottom', '-2px');
|
|
1302
1300
|
} else if (data.height === '20px') {
|
|
@@ -247,6 +247,13 @@ export class WidgetElement<WidgetT extends Widget> extends HTMLElement {
|
|
|
247
247
|
};
|
|
248
248
|
return clone;
|
|
249
249
|
}
|
|
250
|
+
|
|
251
|
+
override focus(): void {
|
|
252
|
+
const widget = Widget.get(this);
|
|
253
|
+
if (widget) {
|
|
254
|
+
widget.focus();
|
|
255
|
+
}
|
|
256
|
+
}
|
|
250
257
|
}
|
|
251
258
|
|
|
252
259
|
customElements.define('devtools-widget', WidgetElement);
|
|
@@ -176,6 +176,12 @@ const i18nLazyString = i18n.i18n.getLazilyComputedLocalizedString.bind(undefined
|
|
|
176
176
|
|
|
177
177
|
const expiresSessionValue = i18nLazyString(UIStrings.session);
|
|
178
178
|
|
|
179
|
+
export interface CookiesTableData {
|
|
180
|
+
cookies: SDK.Cookie.Cookie[];
|
|
181
|
+
cookieToBlockedReasons?: ReadonlyMap<SDK.Cookie.Cookie, SDK.CookieModel.BlockedReason[]>;
|
|
182
|
+
cookieToExemptionReason?: ReadonlyMap<SDK.Cookie.Cookie, SDK.CookieModel.ExemptionReason>;
|
|
183
|
+
}
|
|
184
|
+
|
|
179
185
|
export class CookiesTable extends UI.Widget.VBox {
|
|
180
186
|
private saveCallback?: ((arg0: SDK.Cookie.Cookie, arg1: SDK.Cookie.Cookie|null) => Promise<boolean>);
|
|
181
187
|
private readonly refreshCallback?: (() => void);
|
|
@@ -190,15 +196,15 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
190
196
|
private readonly view: ViewFunction;
|
|
191
197
|
private selectedKey?: string;
|
|
192
198
|
private readonly editable: boolean;
|
|
193
|
-
private
|
|
199
|
+
private renderInline: boolean;
|
|
194
200
|
private readonly schemeBindingEnabled: boolean;
|
|
195
201
|
private readonly portBindingEnabled: boolean;
|
|
196
202
|
constructor(
|
|
197
|
-
renderInline?: boolean,
|
|
203
|
+
element?: HTMLElement, renderInline?: boolean,
|
|
198
204
|
saveCallback?: ((arg0: SDK.Cookie.Cookie, arg1: SDK.Cookie.Cookie|null) => Promise<boolean>),
|
|
199
205
|
refreshCallback?: (() => void), selectedCallback?: (() => void),
|
|
200
206
|
deleteCallback?: ((arg0: SDK.Cookie.Cookie, arg1: () => void) => void), view?: ViewFunction) {
|
|
201
|
-
super();
|
|
207
|
+
super(element);
|
|
202
208
|
if (!view) {
|
|
203
209
|
view = (input, _, target) => {
|
|
204
210
|
// clang-format off
|
|
@@ -325,6 +331,15 @@ export class CookiesTable extends UI.Widget.VBox {
|
|
|
325
331
|
this.requestUpdate();
|
|
326
332
|
}
|
|
327
333
|
|
|
334
|
+
set cookiesData(data: CookiesTableData) {
|
|
335
|
+
this.setCookies(data.cookies, data.cookieToBlockedReasons, data.cookieToExemptionReason);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
set inline(value: boolean) {
|
|
339
|
+
this.renderInline = value;
|
|
340
|
+
this.requestUpdate();
|
|
341
|
+
}
|
|
342
|
+
|
|
328
343
|
setCookies(
|
|
329
344
|
cookies: SDK.Cookie.Cookie[],
|
|
330
345
|
cookieToBlockedReasons?: ReadonlyMap<SDK.Cookie.Cookie, SDK.CookieModel.BlockedReason[]>,
|
|
@@ -68,15 +68,15 @@ const UIStrings = {
|
|
|
68
68
|
/**
|
|
69
69
|
* @description A context menu item in the Data Grid of a data grid
|
|
70
70
|
*/
|
|
71
|
-
sortByString: 'Sort
|
|
71
|
+
sortByString: 'Sort by',
|
|
72
72
|
/**
|
|
73
73
|
* @description A context menu item in data grids to reset the columns to their default weight
|
|
74
74
|
*/
|
|
75
|
-
resetColumns: 'Reset
|
|
75
|
+
resetColumns: 'Reset columns',
|
|
76
76
|
/**
|
|
77
77
|
* @description A context menu item in data grids to list header options.
|
|
78
78
|
*/
|
|
79
|
-
headerOptions: 'Header
|
|
79
|
+
headerOptions: 'Header options',
|
|
80
80
|
/**
|
|
81
81
|
* @description Text to refresh the page
|
|
82
82
|
*/
|
|
@@ -1697,6 +1697,12 @@ export class Renderer implements UI.UIUtils.Renderer {
|
|
|
1697
1697
|
if (options?.expand) {
|
|
1698
1698
|
section.firstChild()?.expand();
|
|
1699
1699
|
}
|
|
1700
|
+
const dispatchDimensionChange = (): void => {
|
|
1701
|
+
section.element.dispatchEvent(new CustomEvent('dimensionschanged'));
|
|
1702
|
+
};
|
|
1703
|
+
section.addEventListener(UI.TreeOutline.Events.ElementAttached, dispatchDimensionChange);
|
|
1704
|
+
section.addEventListener(UI.TreeOutline.Events.ElementExpanded, dispatchDimensionChange);
|
|
1705
|
+
section.addEventListener(UI.TreeOutline.Events.ElementCollapsed, dispatchDimensionChange);
|
|
1700
1706
|
return {
|
|
1701
1707
|
element: section.element,
|
|
1702
1708
|
forceSelect: section.forceSelect.bind(section),
|
|
@@ -1513,7 +1513,6 @@ export class FlameChart extends Common.ObjectWrapper.eventMixin<EventTypes, type
|
|
|
1513
1513
|
}
|
|
1514
1514
|
|
|
1515
1515
|
#handleFlameChartTransformEvent(event: KeyboardEvent): void {
|
|
1516
|
-
// TODO(crbug.com/1469887): Indicate Shortcuts to the user when the designs are complete.
|
|
1517
1516
|
if (this.selectedEntryIndex === -1) {
|
|
1518
1517
|
return;
|
|
1519
1518
|
}
|
|
@@ -123,30 +123,6 @@
|
|
|
123
123
|
user-select: text;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
.image-wrapper,
|
|
127
|
-
.image-wrapper img {
|
|
128
|
-
max-width: 200px;
|
|
129
|
-
max-height: 200px;
|
|
130
|
-
display: block;
|
|
131
|
-
object-fit: contain;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.image-wrapper {
|
|
135
|
-
height: fit-content;
|
|
136
|
-
margin-right: 8px;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.show-mask img {
|
|
140
|
-
/* The safe zone is a centrally positioned circle, with radius 2/5
|
|
141
|
-
* (40%) of the minimum of the icon's width and height.
|
|
142
|
-
* https://w3c.github.io/manifest/#icon-masks */
|
|
143
|
-
clip-path: circle(40% at 50% 50%);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.show-mask .image-wrapper {
|
|
147
|
-
background: var(--image-file-checker);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
126
|
@media (forced-colors: active) {
|
|
151
127
|
.report-field-value .inline-icon {
|
|
152
128
|
color: ButtonText;
|
|
@@ -1742,6 +1742,11 @@ export const knownContextValues = new Set([
|
|
|
1742
1742
|
'gotpointercapture',
|
|
1743
1743
|
'grace-period-link',
|
|
1744
1744
|
'grace-period-mitigation-disabled',
|
|
1745
|
+
'greendev-ai-annotations-enabled',
|
|
1746
|
+
'greendev-artifact-viewer-enabled',
|
|
1747
|
+
'greendev-in-devtools-floaty-enabled',
|
|
1748
|
+
'greendev-inline-widgets-enabled',
|
|
1749
|
+
'greendev-prototypes',
|
|
1745
1750
|
'grid',
|
|
1746
1751
|
'grid-align',
|
|
1747
1752
|
'grid-area',
|
|
@@ -3234,6 +3239,7 @@ export const knownContextValues = new Set([
|
|
|
3234
3239
|
'screen',
|
|
3235
3240
|
'screen-rotation',
|
|
3236
3241
|
'screencast-enabled',
|
|
3242
|
+
'screenshots',
|
|
3237
3243
|
'script',
|
|
3238
3244
|
'script-blocked-by-csp',
|
|
3239
3245
|
'script-first-statement',
|
|
@@ -4196,6 +4202,7 @@ export const knownContextValues = new Set([
|
|
|
4196
4202
|
'width',
|
|
4197
4203
|
'will-change',
|
|
4198
4204
|
'window',
|
|
4205
|
+
'window-controls',
|
|
4199
4206
|
'window-controls-overlay',
|
|
4200
4207
|
'windows',
|
|
4201
4208
|
'word-break',
|
package/package.json
CHANGED