chrome-devtools-frontend 1.0.1598808 → 1.0.1601661
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/README.md +13 -0
- package/{agents/prompts/creating-a-model.md → .agents/skills/creating-a-model/SKILL.md} +7 -1
- package/{agents/prompts/devtools-imports.md → .agents/skills/devtools-imports/SKILL.md} +10 -5
- package/{agents/prompts/merging-devtools-module.md → .agents/skills/merging-devtools-module/SKILL.md} +5 -0
- package/{agents/prompts/ui-widgets.md → .agents/skills/ui-widgets/SKILL.md} +5 -0
- package/{agents/prompts/verification.md → .agents/skills/verification/SKILL.md} +5 -0
- package/front_end/core/common/Settings.ts +24 -1
- package/front_end/core/dom_extension/DOMExtension.ts +1 -0
- package/front_end/core/host/AidaClient.ts +5 -2
- package/front_end/core/host/AidaGcaTranslation.ts +377 -0
- package/front_end/core/host/GcaTypes.ts +520 -0
- package/front_end/core/host/UserMetrics.ts +0 -3
- package/front_end/core/host/host.ts +4 -0
- package/front_end/core/root/ExperimentNames.ts +0 -3
- package/front_end/core/sdk/CPUThrottlingManager.ts +12 -9
- package/front_end/core/sdk/ResourceTreeModel.ts +1 -1
- package/front_end/core/sdk/SourceMap.ts +4 -2
- package/front_end/entrypoints/main/MainImpl.ts +1 -12
- package/front_end/generated/Deprecation.ts +16 -0
- package/front_end/generated/InspectorBackendCommands.ts +4 -6
- package/front_end/generated/protocol.ts +46 -77
- package/front_end/models/ai_assistance/AiConversation.ts +49 -22
- package/front_end/models/ai_assistance/AiHistoryStorage.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -0
- package/front_end/models/ai_assistance/ConversationHandler.ts +16 -11
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +76 -36
- package/front_end/models/ai_assistance/agents/AiAgent.ts +26 -2
- package/front_end/models/ai_assistance/agents/BreakpointDebuggerAgent.ts +0 -1
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.snapshot.txt +11 -0
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +39 -0
- package/front_end/models/ai_assistance/agents/ConversationSummaryAgent.ts +53 -12
- package/front_end/models/ai_assistance/agents/FileAgent.ts +0 -15
- package/front_end/models/ai_assistance/agents/NetworkAgent.ts +0 -5
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +57 -0
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +87 -15
- package/front_end/models/ai_assistance/agents/PerformanceAnnotationsAgent.ts +0 -10
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -6
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +1 -5
- package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.snapshot.txt +84 -0
- package/front_end/models/ai_assistance/data_formatters/LighthouseFormatter.ts +172 -0
- package/front_end/models/breakpoints/BreakpointManager.ts +20 -12
- package/front_end/models/emulation/DeviceModeModel.ts +5 -1
- package/front_end/models/emulation/EmulatedDevices.ts +3 -2
- package/front_end/models/javascript_metadata/NativeFunctions.js +60 -0
- package/front_end/models/lighthouse/LighthouseReporterTypes.ts +104 -10
- package/front_end/models/lighthouse/RunTypes.ts +42 -0
- package/front_end/models/lighthouse/lighthouse.ts +2 -0
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +59 -35
- package/front_end/models/stack_trace/StackTrace.ts +5 -0
- package/front_end/models/stack_trace/StackTraceImpl.ts +7 -1
- package/front_end/models/stack_trace/StackTraceModel.ts +2 -1
- package/front_end/models/stack_trace/stack_trace.ts +4 -0
- package/front_end/models/trace/ModelImpl.ts +4 -0
- package/front_end/models/trace/helpers/SamplesIntegrator.ts +1 -8
- package/front_end/models/trace/types/Configuration.ts +0 -5
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +7 -3
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +163 -74
- package/front_end/panels/ai_assistance/ExportConversation.ts +25 -0
- package/front_end/panels/ai_assistance/ai_assistance.ts +2 -0
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -0
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +120 -32
- package/front_end/panels/ai_assistance/components/ChatView.ts +44 -0
- package/front_end/panels/ai_assistance/components/ExportForAgentsDialog.ts +240 -0
- package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +4 -12
- package/front_end/panels/ai_assistance/components/StylingAgentMarkdownRenderer.ts +5 -27
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +115 -17
- package/front_end/panels/ai_assistance/components/chatMessage.css +65 -1
- package/front_end/panels/ai_assistance/components/chatView.css +8 -0
- package/front_end/panels/ai_assistance/components/exportForAgentsDialog.css +82 -0
- package/front_end/panels/ai_assistance/components/walkthroughView.css +9 -1
- package/front_end/panels/animation/AnimationTimeline.ts +5 -5
- package/front_end/panels/application/AppManifestView.ts +13 -7
- package/front_end/panels/application/FrameDetailsView.ts +4 -4
- package/front_end/panels/application/preloading/PreloadingView.ts +2 -4
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +6 -3
- package/front_end/panels/application/preloading/components/PreloadingString.ts +15 -2
- package/front_end/panels/application/preloading/helper/PreloadingForward.ts +31 -2
- package/front_end/panels/browser_debugger/DOMBreakpointsSidebarPane.ts +3 -2
- package/front_end/panels/common/DOMLinkifier.ts +10 -8
- package/front_end/panels/console/ConsoleView.ts +24 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +22 -23
- package/front_end/panels/console/console.ts +0 -2
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +5 -5
- package/front_end/panels/elements/ElementsTreeElement.ts +2 -3
- package/front_end/panels/elements/PropertiesWidget.ts +5 -3
- package/front_end/panels/elements/StandaloneStylesContainer.ts +21 -9
- package/front_end/panels/elements/StylePropertiesSection.ts +98 -50
- package/front_end/panels/elements/StylePropertyTreeElement.ts +38 -4
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +43 -35
- package/front_end/panels/elements/StylesSidebarPane.ts +154 -24
- package/front_end/panels/elements/components/ComputedStyleTrace.ts +3 -2
- package/front_end/panels/event_listeners/EventListenersView.ts +16 -4
- package/front_end/panels/explain/components/ConsoleInsight.ts +6 -9
- package/front_end/panels/explain/explain-meta.ts +5 -0
- package/front_end/panels/issues/AffectedResourcesView.ts +5 -9
- package/front_end/panels/issues/AffectedSelectivePermissionsInterventionView.ts +1 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +154 -164
- package/front_end/panels/lighthouse/LighthousePanel.ts +5 -9
- package/front_end/panels/lighthouse/LighthouseProtocolService.ts +1 -0
- package/front_end/panels/lighthouse/LighthouseReportRenderer.ts +9 -6
- package/front_end/panels/lighthouse/LighthouseStartView.ts +7 -6
- package/front_end/panels/lighthouse/LighthouseStatusView.ts +32 -8
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +7 -3
- package/front_end/panels/network/NetworkDataGridNode.ts +34 -0
- package/front_end/panels/network/NetworkLogViewColumns.ts +10 -0
- package/front_end/panels/network/RequestPayloadView.ts +4 -1
- package/front_end/panels/network/RequestTimingView.ts +8 -2
- package/front_end/panels/performance_monitor/performanceMonitor.css +6 -4
- package/front_end/panels/recorder/RecorderController.ts +52 -14
- package/front_end/panels/recorder/components/RecordingView.ts +2 -1
- package/front_end/panels/recorder/models/RecordingStorage.ts +15 -20
- package/front_end/panels/sensors/SensorsView.ts +333 -157
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +18 -4
- package/front_end/panels/sources/DebuggerPausedMessage.ts +6 -6
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +2 -3
- package/front_end/panels/sources/NavigatorView.ts +11 -7
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +1 -1
- package/front_end/panels/sources/SourcesPanel.ts +12 -34
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +5 -1
- package/front_end/panels/sources/sources-meta.ts +6 -0
- package/front_end/panels/timeline/StatusDialog.ts +159 -83
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +6 -2
- package/front_end/panels/timeline/TimelineController.ts +0 -4
- package/front_end/panels/timeline/TimelineDetailsView.ts +35 -3
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +6 -1
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +9 -4
- package/front_end/panels/timeline/TimelinePanel.ts +36 -11
- package/front_end/panels/timeline/TimelineTreeView.ts +14 -3
- package/front_end/panels/timeline/TimelineUIUtils.ts +5 -57
- package/front_end/panels/timeline/components/InteractionBreakdown.ts +2 -1
- package/front_end/panels/timeline/components/LiveMetricsView.ts +2 -2
- package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +3 -7
- package/front_end/panels/timeline/components/Sidebar.ts +11 -19
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +2 -1
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +60 -27
- package/front_end/panels/timeline/components/TimelineRangeSummaryView.ts +66 -0
- package/front_end/panels/timeline/components/TimelineSummary.ts +7 -19
- package/front_end/panels/timeline/components/components.ts +2 -0
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +55 -28
- package/front_end/panels/timeline/components/insights/NodeLink.ts +3 -3
- package/front_end/panels/timeline/components/insights/baseInsightComponent.css +7 -0
- package/front_end/panels/timeline/components/insights/insights.ts +0 -2
- package/front_end/panels/timeline/components/timelineRangeSummaryView.css +20 -0
- package/front_end/panels/timeline/overlays/OverlaysImpl.ts +7 -7
- package/front_end/panels/timeline/timeline-meta.ts +11 -0
- package/front_end/panels/timeline/timelineDetailsView.css +0 -9
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/web-vitals/package/dist/modules/attribution/onINP.js +11 -2
- package/front_end/third_party/web-vitals/package/src/attribution/onINP.ts +11 -2
- package/front_end/third_party/web-vitals/patches/0001-Add-onEachInteraction-to-onINP-options.patch +65 -4
- package/front_end/ui/kit/link/link.css +2 -2
- package/front_end/ui/legacy/Widget.ts +5 -3
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +7 -2
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +57 -35
- package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +1 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +6 -1
- package/package.json +1 -1
- package/agents/prompts/README.md +0 -18
- package/front_end/panels/timeline/components/insights/InsightRenderer.ts +0 -93
- /package/front_end/{panels/console → models/stack_trace}/ErrorStackParser.ts +0 -0
|
@@ -142,13 +142,14 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
142
142
|
const checkedStateText = breakpoint.enabled ? i18nString(UIStrings.checked) : i18nString(UIStrings.unchecked);
|
|
143
143
|
const linkified = PanelsCommon.DOMLinkifier.Linkifier.instance().linkify(
|
|
144
144
|
breakpoint.node, {preventKeyboardFocus: true, tooltip: undefined});
|
|
145
|
+
const linkifiedText = breakpoint.node.simpleSelector();
|
|
145
146
|
return html`
|
|
146
147
|
<li class=${`breakpoint-entry ${item.isHighlighted ? 'breakpoint-hit' : ''}`}
|
|
147
148
|
tabindex=${item.isFocused ? '0' : '-1'}
|
|
148
149
|
@click=${() => input.onBreakpointClick(breakpoint)}
|
|
149
150
|
@contextmenu=${(e: Event) => input.onBreakpointContextMenu(breakpoint, e)}
|
|
150
151
|
@keydown=${(e: Event) => input.onBreakpointKeyDown(breakpoint, e)}
|
|
151
|
-
aria-label=${i18nString(UIStrings.sSS, { PH1: item.label, PH2:
|
|
152
|
+
aria-label=${i18nString(UIStrings.sSS, { PH1: item.label, PH2: linkifiedText, PH3: checkedStateText })}
|
|
152
153
|
aria-description=${item.isHighlighted ? i18nString(UIStrings.sBreakpointHit, { PH1: checkedStateText }) : checkedStateText}
|
|
153
154
|
jslog=${VisualLogging.domBreakpoint().context(breakpoint.type).track({ keydown: 'ArrowUp|ArrowDown|PageUp|PageDown' })}>
|
|
154
155
|
<devtools-checkbox
|
|
@@ -157,7 +158,7 @@ export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
|
157
158
|
@click=${(e: Event) => e.stopPropagation()}
|
|
158
159
|
@change=${() => input.onBreakpointCheckboxClick(breakpoint)}
|
|
159
160
|
tabindex="-1"
|
|
160
|
-
aria-label=${i18nString(UIStrings.sS, { PH1: item.label, PH2:
|
|
161
|
+
aria-label=${i18nString(UIStrings.sS, { PH1: item.label, PH2: linkifiedText })}
|
|
161
162
|
aria-description=${Directives.ifDefined(item.isHighlighted ? i18nString(UIStrings.breakpointHit) : undefined)}
|
|
162
163
|
jslog=${VisualLogging.toggle().track({ click: true })}>
|
|
163
164
|
</devtools-checkbox>
|
|
@@ -7,12 +7,13 @@ import * as i18n from '../../core/i18n/i18n.js';
|
|
|
7
7
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
8
|
import type * as Protocol from '../../generated/protocol.js';
|
|
9
9
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
10
|
-
import {Directives, html, nothing, render} from '../../ui/lit/lit.js';
|
|
10
|
+
import {Directives, html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
|
|
11
11
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
12
12
|
|
|
13
13
|
import domLinkifierStyles from './domLinkifier.css.js';
|
|
14
14
|
|
|
15
15
|
const {classMap, ifDefined} = Directives;
|
|
16
|
+
const {widget} = UI.Widget;
|
|
16
17
|
|
|
17
18
|
const UIStrings = {
|
|
18
19
|
/**
|
|
@@ -34,6 +35,7 @@ export interface Options {
|
|
|
34
35
|
hiddenClassList?: string[];
|
|
35
36
|
disabled?: boolean;
|
|
36
37
|
ariaDescription?: string;
|
|
38
|
+
onClick?: () => void;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
interface ViewInput {
|
|
@@ -125,6 +127,7 @@ export class DOMNodeLink extends UI.Widget.Widget {
|
|
|
125
127
|
onClick: () => {
|
|
126
128
|
void Common.Revealer.reveal(this.#node);
|
|
127
129
|
void this.#node?.scrollIntoView();
|
|
130
|
+
options.onClick?.();
|
|
128
131
|
return false;
|
|
129
132
|
},
|
|
130
133
|
onMouseOver: () => {
|
|
@@ -248,6 +251,7 @@ export class DeferredDOMNodeLink extends UI.Widget.Widget {
|
|
|
248
251
|
}
|
|
249
252
|
void Common.Revealer.reveal(node);
|
|
250
253
|
void node?.scrollIntoView();
|
|
254
|
+
this.#options?.onClick?.();
|
|
251
255
|
});
|
|
252
256
|
},
|
|
253
257
|
};
|
|
@@ -268,16 +272,14 @@ export class Linkifier {
|
|
|
268
272
|
|
|
269
273
|
return linkifierInstance;
|
|
270
274
|
}
|
|
271
|
-
linkify(node: SDK.DOMModel.DOMNode|SDK.DOMModel.DeferredDOMNode, options?: Options):
|
|
275
|
+
linkify(node: SDK.DOMModel.DOMNode|SDK.DOMModel.DeferredDOMNode, options?: Options): LitTemplate {
|
|
272
276
|
if (node instanceof SDK.DOMModel.DOMNode) {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
return link;
|
|
277
|
+
return html`<devtools-widget ${widget(e => new DOMNodeLink(e, node, options))}>${
|
|
278
|
+
options?.textContent ? html`${options.textContent}` : nothing}</devtools-widget>`;
|
|
276
279
|
}
|
|
277
280
|
if (node instanceof SDK.DOMModel.DeferredDOMNode) {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
return link;
|
|
281
|
+
return html`<devtools-widget ${widget(e => new DeferredDOMNodeLink(e, node, options))}>${
|
|
282
|
+
options?.textContent ? html`${options.textContent}` : nothing}</devtools-widget>`;
|
|
281
283
|
}
|
|
282
284
|
throw new Error('Can\'t linkify non-node');
|
|
283
285
|
}
|
|
@@ -269,7 +269,7 @@ const UIStrings = {
|
|
|
269
269
|
} as const;
|
|
270
270
|
const str_ = i18n.i18n.registerUIStrings('panels/console/ConsoleView.ts', UIStrings);
|
|
271
271
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
272
|
-
let consoleViewInstance: ConsoleView;
|
|
272
|
+
let consoleViewInstance: ConsoleView|null;
|
|
273
273
|
|
|
274
274
|
const MIN_HISTORY_LENGTH_FOR_DISABLING_SELF_XSS_WARNING = 5;
|
|
275
275
|
const DISCLAIMER_TOOLTIP_ID = 'console-ai-code-completion-disclaimer-tooltip';
|
|
@@ -637,6 +637,10 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
637
637
|
IssuesManager.IssuesManager.Events.ISSUES_COUNT_UPDATED, this.#onIssuesCountUpdateBound);
|
|
638
638
|
}
|
|
639
639
|
|
|
640
|
+
static clearConsoleViewInstanceForTest(): void {
|
|
641
|
+
consoleViewInstance = null;
|
|
642
|
+
}
|
|
643
|
+
|
|
640
644
|
static instance(opts?: {forceNew: boolean, viewportThrottlerTimeout?: number}): ConsoleView {
|
|
641
645
|
if (!consoleViewInstance || opts?.forceNew) {
|
|
642
646
|
consoleViewInstance = new ConsoleView(opts?.viewportThrottlerTimeout ?? 50);
|
|
@@ -789,6 +793,22 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
789
793
|
this.hidePromptSuggestBox();
|
|
790
794
|
}
|
|
791
795
|
|
|
796
|
+
dispose(): void {
|
|
797
|
+
SDK.TargetManager.TargetManager.instance().removeModelListener(
|
|
798
|
+
SDK.ConsoleModel.ConsoleModel, SDK.ConsoleModel.Events.ConsoleCleared, this.consoleCleared, this);
|
|
799
|
+
SDK.TargetManager.TargetManager.instance().removeModelListener(
|
|
800
|
+
SDK.ConsoleModel.ConsoleModel, SDK.ConsoleModel.Events.MessageAdded, this.onConsoleMessageAdded, this);
|
|
801
|
+
SDK.TargetManager.TargetManager.instance().removeModelListener(
|
|
802
|
+
SDK.ConsoleModel.ConsoleModel, SDK.ConsoleModel.Events.MessageUpdated, this.onConsoleMessageUpdated, this);
|
|
803
|
+
SDK.TargetManager.TargetManager.instance().removeModelListener(
|
|
804
|
+
SDK.ConsoleModel.ConsoleModel, SDK.ConsoleModel.Events.CommandEvaluated, this.commandEvaluated, this);
|
|
805
|
+
SDK.TargetManager.TargetManager.instance().unobserveModels(SDK.ConsoleModel.ConsoleModel, this);
|
|
806
|
+
|
|
807
|
+
const issuesManager = IssuesManager.IssuesManager.IssuesManager.instance();
|
|
808
|
+
issuesManager.removeEventListener(
|
|
809
|
+
IssuesManager.IssuesManager.Events.ISSUES_COUNT_UPDATED, this.#onIssuesCountUpdateBound);
|
|
810
|
+
}
|
|
811
|
+
|
|
792
812
|
override wasShown(): void {
|
|
793
813
|
super.wasShown();
|
|
794
814
|
if (this.#isDetached) {
|
|
@@ -1103,7 +1123,9 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
1103
1123
|
if (parentGroup) {
|
|
1104
1124
|
showGroup(parentGroup, visibleViewMessages);
|
|
1105
1125
|
}
|
|
1106
|
-
|
|
1126
|
+
if (!parentGroup?.messagesHidden()) {
|
|
1127
|
+
visibleViewMessages.push(currentGroup);
|
|
1128
|
+
}
|
|
1107
1129
|
}
|
|
1108
1130
|
}
|
|
1109
1131
|
|
|
@@ -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
|
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
|
+
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
6
|
|
|
6
7
|
/*
|
|
7
8
|
* Copyright (C) 2011 Google Inc. All rights reserved.
|
|
@@ -46,6 +47,7 @@ import * as Breakpoints from '../../models/breakpoints/breakpoints.js';
|
|
|
46
47
|
import * as Greendev from '../../models/greendev/greendev.js';
|
|
47
48
|
import type * as IssuesManager from '../../models/issues_manager/issues_manager.js';
|
|
48
49
|
import * as Logs from '../../models/logs/logs.js';
|
|
50
|
+
import * as StackTrace from '../../models/stack_trace/stack_trace.js';
|
|
49
51
|
import * as TextUtils from '../../models/text_utils/text_utils.js';
|
|
50
52
|
import * as Workspace from '../../models/workspace/workspace.js';
|
|
51
53
|
import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
|
|
@@ -59,7 +61,7 @@ import * as ObjectUI from '../../ui/legacy/components/object_ui/object_ui.js';
|
|
|
59
61
|
import objectValueStyles from '../../ui/legacy/components/object_ui/objectValue.css.js';
|
|
60
62
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
61
63
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
62
|
-
import {render} from '../../ui/lit/lit.js';
|
|
64
|
+
import {type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
|
|
63
65
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
64
66
|
import * as AiAssistancePanel from '../ai_assistance/ai_assistance.js';
|
|
65
67
|
|
|
@@ -67,7 +69,6 @@ import {format, updateStyle} from './ConsoleFormat.js';
|
|
|
67
69
|
import {ConsoleInsightTeaser} from './ConsoleInsightTeaser.js';
|
|
68
70
|
import consoleViewStyles from './consoleView.css.js';
|
|
69
71
|
import type {ConsoleViewportElement} from './ConsoleViewport.js';
|
|
70
|
-
import {augmentErrorStackWithScriptIds, parseSourcePositionsFromErrorStack} from './ErrorStackParser.js';
|
|
71
72
|
|
|
72
73
|
const UIStrings = {
|
|
73
74
|
/**
|
|
@@ -374,22 +375,20 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
374
375
|
this.consoleGroupInternal = null;
|
|
375
376
|
}
|
|
376
377
|
|
|
377
|
-
setInsight(insight:
|
|
378
|
-
this.elementInternal
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
}, {once: true});
|
|
392
|
-
this.#teaser?.setInactive(true);
|
|
378
|
+
setInsight(insight: LitTemplate): void {
|
|
379
|
+
if (this.elementInternal) {
|
|
380
|
+
render(insight, this.elementInternal);
|
|
381
|
+
this.elementInternal.classList.toggle('has-insight', true);
|
|
382
|
+
this.elementInternal.addEventListener('closeinsight', () => {
|
|
383
|
+
Host.userMetrics.actionTaken(Host.UserMetrics.Action.InsightClosed);
|
|
384
|
+
if (this.elementInternal) {
|
|
385
|
+
this.elementInternal.classList.toggle('has-insight', false);
|
|
386
|
+
render(nothing, this.elementInternal);
|
|
387
|
+
}
|
|
388
|
+
this.#teaser?.setInactive(false);
|
|
389
|
+
}, {once: true});
|
|
390
|
+
this.#teaser?.setInactive(true);
|
|
391
|
+
}
|
|
393
392
|
}
|
|
394
393
|
|
|
395
394
|
element(): HTMLElement {
|
|
@@ -870,7 +869,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
870
869
|
const renderPreview = (includeNullOrUndefined: boolean): void => {
|
|
871
870
|
if (obj.preview) {
|
|
872
871
|
titleElement.classList.add('console-object-preview');
|
|
873
|
-
|
|
872
|
+
|
|
874
873
|
render(this.previewFormatter.renderObjectPreview(obj.preview, includeNullOrUndefined), titleElement);
|
|
875
874
|
ObjectUI.ObjectPropertiesSection.ObjectPropertiesSection.appendMemoryIcon(titleElement, obj);
|
|
876
875
|
}
|
|
@@ -1043,7 +1042,7 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
1043
1042
|
type: string, subtype: string|undefined, className: string|null|undefined,
|
|
1044
1043
|
description: string|undefined): DocumentFragment {
|
|
1045
1044
|
const fragment = document.createDocumentFragment();
|
|
1046
|
-
|
|
1045
|
+
|
|
1047
1046
|
render(this.previewFormatter.renderPropertyPreview(type, subtype, className, description), fragment);
|
|
1048
1047
|
return fragment;
|
|
1049
1048
|
}
|
|
@@ -1946,12 +1945,12 @@ export class ConsoleViewMessage implements ConsoleViewportElement {
|
|
|
1946
1945
|
string = concatErrorDescriptionAndIssueSummary(string, issueSummary);
|
|
1947
1946
|
}
|
|
1948
1947
|
|
|
1949
|
-
const linkInfos = parseSourcePositionsFromErrorStack(runtimeModel, string);
|
|
1948
|
+
const linkInfos = StackTrace.ErrorStackParser.parseSourcePositionsFromErrorStack(runtimeModel, string);
|
|
1950
1949
|
if (!linkInfos?.length) {
|
|
1951
1950
|
return null;
|
|
1952
1951
|
}
|
|
1953
1952
|
if (exceptionDetails?.stackTrace) {
|
|
1954
|
-
augmentErrorStackWithScriptIds(linkInfos, exceptionDetails.stackTrace);
|
|
1953
|
+
StackTrace.ErrorStackParser.augmentErrorStackWithScriptIds(linkInfos, exceptionDetails.stackTrace);
|
|
1955
1954
|
}
|
|
1956
1955
|
|
|
1957
1956
|
const debuggerModel = runtimeModel.debuggerModel();
|
|
@@ -2173,7 +2172,7 @@ export class ConsoleGroupViewMessage extends ConsoleViewMessage {
|
|
|
2173
2172
|
this.groupEndMessageInternal = null;
|
|
2174
2173
|
}
|
|
2175
2174
|
|
|
2176
|
-
|
|
2175
|
+
setCollapsed(collapsed: boolean): void {
|
|
2177
2176
|
this.collapsedInternal = collapsed;
|
|
2178
2177
|
if (this.expandGroupIcon) {
|
|
2179
2178
|
this.expandGroupIcon.name = this.collapsedInternal ? 'triangle-right' : 'triangle-down';
|
|
@@ -26,7 +26,6 @@ import * as ConsoleSidebar from './ConsoleSidebar.js';
|
|
|
26
26
|
import * as ConsoleView from './ConsoleView.js';
|
|
27
27
|
import * as ConsoleViewMessage from './ConsoleViewMessage.js';
|
|
28
28
|
import * as ConsoleViewport from './ConsoleViewport.js';
|
|
29
|
-
import * as ErrorStackParser from './ErrorStackParser.js';
|
|
30
29
|
import * as PromptBuilder from './PromptBuilder.js';
|
|
31
30
|
|
|
32
31
|
export {
|
|
@@ -41,6 +40,5 @@ export {
|
|
|
41
40
|
ConsoleView,
|
|
42
41
|
ConsoleViewMessage,
|
|
43
42
|
ConsoleViewport,
|
|
44
|
-
ErrorStackParser,
|
|
45
43
|
PromptBuilder,
|
|
46
44
|
};
|
|
@@ -881,7 +881,7 @@ export class CSSOverviewCompletedView extends UI.Widget.VBox {
|
|
|
881
881
|
interface ElementDetailsViewInput {
|
|
882
882
|
items: Array<{
|
|
883
883
|
data: PopulateNodesEventNodeTypes,
|
|
884
|
-
link?:
|
|
884
|
+
link?: LitTemplate,
|
|
885
885
|
showNode?: () => void,
|
|
886
886
|
}>;
|
|
887
887
|
visibility: Set<string>;
|
|
@@ -996,18 +996,18 @@ export class ElementDetailsView extends UI.Widget.Widget {
|
|
|
996
996
|
const lineNumber = styleSheetHeader.lineNumberInSource(ruleLocation.startLine);
|
|
997
997
|
const columnNumber = styleSheetHeader.columnNumberInSource(ruleLocation.startLine, ruleLocation.startColumn);
|
|
998
998
|
const matchingSelectorLocation = new SDK.CSSModel.CSSLocation(styleSheetHeader, lineNumber, columnNumber);
|
|
999
|
-
link = this.#linkifier.linkifyCSSLocation(matchingSelectorLocation)
|
|
999
|
+
link = html`${this.#linkifier.linkifyCSSLocation(matchingSelectorLocation)}`;
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
1002
|
|
|
1003
|
-
return {data: item, link, showNode};
|
|
1003
|
+
return {data: item, link: link as LitTemplate | undefined, showNode};
|
|
1004
1004
|
}));
|
|
1005
1005
|
|
|
1006
1006
|
this.#view({items, visibility}, {}, this.element);
|
|
1007
1007
|
}
|
|
1008
1008
|
}
|
|
1009
1009
|
|
|
1010
|
-
function renderNode(data: PopulateNodesEventNodeTypes, link?:
|
|
1010
|
+
function renderNode(data: PopulateNodesEventNodeTypes, link?: LitTemplate, showNode?: () => void): LitTemplate {
|
|
1011
1011
|
if (!link) {
|
|
1012
1012
|
return nothing;
|
|
1013
1013
|
}
|
|
@@ -1027,7 +1027,7 @@ function renderDeclaration(data: PopulateNodesEventNodeTypes): TemplateResult {
|
|
|
1027
1027
|
return html`<td>${data.declaration}</td>`;
|
|
1028
1028
|
}
|
|
1029
1029
|
|
|
1030
|
-
function renderSourceURL(data: PopulateNodesEventNodeTypes, link?:
|
|
1030
|
+
function renderSourceURL(data: PopulateNodesEventNodeTypes, link?: LitTemplate): TemplateResult {
|
|
1031
1031
|
if ('range' in data && data.range) {
|
|
1032
1032
|
if (!link) {
|
|
1033
1033
|
return html`<td>${i18nString(UIStrings.unableToLink)}</td>`;
|
|
@@ -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
|
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
|
+
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
6
|
|
|
6
7
|
/*
|
|
7
8
|
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
|
|
@@ -748,8 +749,7 @@ function renderAttribute(
|
|
|
748
749
|
textContent: el.textContent || undefined,
|
|
749
750
|
isDynamicLink: true,
|
|
750
751
|
});
|
|
751
|
-
el
|
|
752
|
-
el.append(link);
|
|
752
|
+
render(link, el as HTMLElement);
|
|
753
753
|
})();
|
|
754
754
|
});
|
|
755
755
|
|
|
@@ -2217,7 +2217,6 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2217
2217
|
// a parent node. Use a temporary span container for the HTML.
|
|
2218
2218
|
const container = document.createElement('span');
|
|
2219
2219
|
|
|
2220
|
-
// eslint-disable-next-line @devtools/no-lit-render-outside-of-view
|
|
2221
2220
|
Lit.render(renderAttribute({name: ' ', value: ''}, null, false, this.nodeInternal), container);
|
|
2222
2221
|
const attr = container.firstElementChild as HTMLElement;
|
|
2223
2222
|
attr.style.marginLeft = '2px'; // overrides the .editing margin rule
|
|
@@ -140,7 +140,7 @@ export class PropertiesWidget extends UI.Widget.VBox {
|
|
|
140
140
|
UI.Context.Context.instance().addFlavorChangeListener(SDK.DOMModel.DOMNode, this.setNode, this);
|
|
141
141
|
|
|
142
142
|
this.#view = view;
|
|
143
|
-
this.treeOutline = new ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeOutline(
|
|
143
|
+
this.treeOutline = new ObjectUI.ObjectPropertiesSection.ObjectPropertiesSectionsTreeOutline();
|
|
144
144
|
this.treeOutline.setShowSelectionOnKeyboardFocus(/* show */ true, /* preventTabOrder */ false);
|
|
145
145
|
|
|
146
146
|
this.treeOutline.addEventListener(UI.TreeOutline.Events.ElementExpanded, () => {
|
|
@@ -209,8 +209,10 @@ export class PropertiesWidget extends UI.Widget.VBox {
|
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
-
this.#objectTree = new ObjectUI.ObjectPropertiesSection.ObjectTree(
|
|
213
|
-
|
|
212
|
+
this.#objectTree = new ObjectUI.ObjectPropertiesSection.ObjectTree(object, {
|
|
213
|
+
propertiesMode: ObjectUI.ObjectPropertiesSection.ObjectPropertiesMode.OWN_AND_INTERNAL_AND_INHERITED,
|
|
214
|
+
readOnly: true,
|
|
215
|
+
});
|
|
214
216
|
this.#updateFilter();
|
|
215
217
|
}
|
|
216
218
|
|
|
@@ -64,12 +64,30 @@ export class StandaloneStylesContainer extends Common.ObjectWrapper.eventMixin<E
|
|
|
64
64
|
#computedStyleModelInternal = new ComputedStyle.ComputedStyleModel.ComputedStyleModel();
|
|
65
65
|
#view: View;
|
|
66
66
|
#filter: RegExp|null = null;
|
|
67
|
+
#rebuildThrottler = new Common.Throttler.Throttler(200);
|
|
67
68
|
|
|
68
69
|
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
69
70
|
super(element, {useShadowDom: true});
|
|
70
71
|
this.#view = view;
|
|
71
72
|
this.#computedStyleModelInternal.addEventListener(
|
|
72
73
|
ComputedStyle.ComputedStyleModel.Events.CSS_MODEL_CHANGED, this.#onCSSModelChanged, this);
|
|
74
|
+
this.#computedStyleModelInternal.addEventListener(
|
|
75
|
+
ComputedStyle.ComputedStyleModel.Events.COMPUTED_STYLE_CHANGED, this.#onComputedStyleChanged, this);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
#onComputedStyleChanged(): void {
|
|
79
|
+
if (this.isEditingStyle || this.userOperation) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
this.#rebuildAndUpdate();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
#rebuildAndUpdate(): void {
|
|
86
|
+
void this.#rebuildThrottler.schedule(async () => {
|
|
87
|
+
this.node()?.domModel().cssModel().discardCachedMatchedCascade();
|
|
88
|
+
await this.#updateSections();
|
|
89
|
+
this.requestUpdate();
|
|
90
|
+
});
|
|
73
91
|
}
|
|
74
92
|
|
|
75
93
|
async #onCSSModelChanged(
|
|
@@ -85,9 +103,7 @@ export class StandaloneStylesContainer extends Common.ObjectWrapper.eventMixin<E
|
|
|
85
103
|
return;
|
|
86
104
|
}
|
|
87
105
|
|
|
88
|
-
this
|
|
89
|
-
await this.#updateSections();
|
|
90
|
-
this.requestUpdate();
|
|
106
|
+
this.#rebuildAndUpdate();
|
|
91
107
|
}
|
|
92
108
|
|
|
93
109
|
get webCustomData(): WebCustomData|undefined {
|
|
@@ -135,8 +151,6 @@ export class StandaloneStylesContainer extends Common.ObjectWrapper.eventMixin<E
|
|
|
135
151
|
}
|
|
136
152
|
|
|
137
153
|
override async performUpdate(): Promise<void> {
|
|
138
|
-
this.hideAllPopovers();
|
|
139
|
-
|
|
140
154
|
const viewInput: ViewInput = {
|
|
141
155
|
sections: this.#sections.filter(section => !section.isHidden()),
|
|
142
156
|
};
|
|
@@ -219,10 +233,8 @@ export class StandaloneStylesContainer extends Common.ObjectWrapper.eventMixin<E
|
|
|
219
233
|
}
|
|
220
234
|
|
|
221
235
|
forceUpdate(): void {
|
|
222
|
-
this.
|
|
223
|
-
|
|
224
|
-
this.requestUpdate();
|
|
225
|
-
});
|
|
236
|
+
this.hideAllPopovers();
|
|
237
|
+
this.#rebuildAndUpdate();
|
|
226
238
|
}
|
|
227
239
|
|
|
228
240
|
hideAllPopovers(): void {
|