chrome-devtools-frontend 1.0.1625079 → 1.0.1626437
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/VersionController.ts +9 -7
- package/front_end/core/common/common.ts +0 -4
- package/front_end/core/host/AidaClient.ts +1 -1
- package/front_end/core/host/AidaClientTypes.ts +2 -0
- package/front_end/core/host/AidaGcaTranslation.ts +2 -2
- package/front_end/core/host/Platform.ts +0 -9
- package/front_end/core/host/UserMetrics.ts +0 -55
- package/front_end/core/root/ExperimentNames.ts +0 -1
- package/front_end/core/sdk/CPUThrottlingManager.ts +1 -1
- package/front_end/core/sdk/CSSMetadata.ts +60 -63
- package/front_end/core/sdk/CSSProperty.ts +1 -5
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +11 -32
- package/front_end/{panels/application → core/sdk}/DOMStorageModel.ts +12 -10
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/entrypoints/main/MainImpl.ts +12 -8
- package/front_end/entrypoints/main/SimpleApp.ts +3 -4
- package/front_end/entrypoints/main/main-meta.ts +1 -1
- package/front_end/generated/InspectorBackendCommands.ts +3 -3
- package/front_end/generated/SupportedCSSProperties.js +21 -21
- package/front_end/generated/protocol.ts +4 -1
- package/front_end/models/ai_assistance/StorageItem.ts +16 -0
- package/front_end/models/ai_assistance/agents/StorageAgent.ts +82 -0
- package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +9 -37
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +26 -3
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +10 -2
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +5 -1
- package/front_end/models/issues_manager/CookieIssue.ts +0 -4
- package/front_end/models/issues_manager/RelatedIssue.ts +0 -14
- package/front_end/models/javascript_metadata/NativeFunctions.js +0 -4
- package/front_end/models/web_mcp/WebMCPModel.ts +11 -2
- package/front_end/models/workspace/IgnoreListManager.ts +1 -1
- package/front_end/models/workspace/UISourceCode.ts +10 -5
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +6 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +26 -9
- package/front_end/panels/application/ApplicationPanelSidebar.ts +32 -42
- package/front_end/panels/application/BackForwardCacheTreeElement.ts +2 -2
- package/front_end/panels/application/BounceTrackingMitigationsTreeElement.ts +2 -2
- package/front_end/panels/application/DOMStorageItemsView.ts +18 -13
- package/front_end/panels/application/InterestGroupTreeElement.ts +2 -2
- package/front_end/panels/application/ReportingApiTreeElement.ts +3 -3
- package/front_end/panels/application/ResourcesPanel.ts +1 -2
- package/front_end/panels/application/ServiceWorkerCacheTreeElement.ts +1 -2
- package/front_end/panels/application/StorageView.ts +1 -2
- package/front_end/panels/application/TrustTokensTreeElement.ts +2 -2
- package/front_end/panels/application/WebMCPTreeElement.ts +2 -2
- package/front_end/panels/application/WebMCPView.ts +74 -16
- package/front_end/panels/application/application.ts +0 -2
- package/front_end/panels/application/webMCPView.css +13 -2
- package/front_end/panels/console/ConsolePrompt.ts +1 -1
- package/front_end/panels/console/ConsoleView.ts +3 -4
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +0 -152
- package/front_end/panels/elements/ElementsTreeElement.ts +4 -9
- package/front_end/panels/elements/StandaloneStylesContainer.ts +3 -0
- package/front_end/panels/elements/StylePropertiesSection.ts +0 -61
- package/front_end/panels/elements/StylePropertyTreeElement.ts +36 -23
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +6 -4
- package/front_end/panels/elements/StylesContainer.ts +1 -0
- package/front_end/panels/elements/StylesSidebarPane.ts +12 -7
- package/front_end/panels/elements/stylesSidebarPane.css +0 -8
- package/front_end/panels/emulation/AdvancedApp.ts +3 -3
- package/front_end/panels/emulation/DeviceModeToolbar.ts +207 -377
- package/front_end/panels/emulation/emulation-meta.ts +1 -1
- package/front_end/panels/network/NetworkPanel.ts +1 -1
- package/front_end/panels/profiler/HeapProfilerPanel.ts +1 -2
- package/front_end/panels/screencast/ScreencastApp.ts +3 -3
- package/front_end/panels/screencast/screencast-meta.ts +1 -2
- package/front_end/panels/settings/SettingsScreen.ts +2 -2
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +2 -4
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +5 -1
- package/front_end/panels/sources/SourcesNavigator.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +1 -3
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +179 -145
- package/front_end/panels/timeline/TimelinePanel.ts +2 -2
- package/front_end/panels/timeline/timelineTreeView.css +2 -2
- 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/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.js +53 -23
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/locators/locators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +3 -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 +18 -8
- 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/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/BrowserConnector.js.map +1 -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 +4 -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/TargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js +54 -19
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebMCP.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebMCP.js +2 -9
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.js +3 -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 +37 -1
- 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/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserLauncher.js.map +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 +1 -0
- 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/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/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 +47 -65
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +143 -55
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.js +53 -23
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/locators/locators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +3 -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 +18 -8
- 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/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/BrowserConnector.js.map +1 -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 +4 -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/TargetManager.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js +54 -19
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebMCP.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebMCP.js +2 -9
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +3 -0
- 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 +37 -1
- 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/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserLauncher.js.map +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 +1 -0
- 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/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/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 +47 -65
- package/front_end/third_party/puppeteer/package/package.json +6 -6
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +69 -27
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +27 -8
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserConnector.ts +4 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +6 -0
- package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +60 -18
- package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +7 -9
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +3 -0
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +37 -1
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +7 -2
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +1 -0
- 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/text_editor/AiCodeCompletionProvider.ts +19 -14
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +8 -7
- package/front_end/ui/components/tooltips/Tooltip.ts +3 -3
- package/front_end/{core/common → ui/legacy}/AppProvider.ts +1 -1
- package/front_end/ui/legacy/InspectorView.ts +4 -3
- package/front_end/ui/legacy/TabbedPane.ts +1 -1
- package/front_end/ui/legacy/UIUserMetrics.ts +70 -0
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +1 -8
- package/front_end/ui/legacy/components/inline_editor/inline_editor.ts +0 -6
- package/front_end/ui/legacy/legacy.ts +6 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
- package/package.json +1 -1
- package/front_end/Images/src/custom-typography.svg +0 -3
- package/front_end/ui/legacy/components/inline_editor/FontEditor.ts +0 -798
- package/front_end/ui/legacy/components/inline_editor/FontEditorUnitConverter.ts +0 -250
- package/front_end/ui/legacy/components/inline_editor/FontEditorUtils.ts +0 -204
- package/front_end/ui/legacy/components/inline_editor/fontEditor.css +0 -185
- /package/front_end/{core/common → ui/legacy}/App.ts +0 -0
|
@@ -191,6 +191,10 @@ const UIStrings = {
|
|
|
191
191
|
* @description Notice to display when a tool has been unregistered
|
|
192
192
|
*/
|
|
193
193
|
toolUnregisteredNotice: 'This tool has been unregistered',
|
|
194
|
+
/**
|
|
195
|
+
* @description Text preceding a nested error in a stack trace
|
|
196
|
+
*/
|
|
197
|
+
causedBy: 'Caused by:',
|
|
194
198
|
} as const;
|
|
195
199
|
const str_ = i18n.i18n.registerUIStrings('panels/application/WebMCPView.ts', UIStrings);
|
|
196
200
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -219,6 +223,11 @@ export interface FilterMenuButtons {
|
|
|
219
223
|
toolTypes: FilterMenuButton;
|
|
220
224
|
statusTypes: FilterMenuButton;
|
|
221
225
|
}
|
|
226
|
+
export const enum TabId {
|
|
227
|
+
DETAILS = 'webmcp.tool-details',
|
|
228
|
+
INPUT = 'webmcp.call-inputs',
|
|
229
|
+
OUTPUT = 'webmcp.call-outputs',
|
|
230
|
+
}
|
|
222
231
|
export interface SelectedTool {
|
|
223
232
|
tool: WebMCP.WebMCPModel.Tool;
|
|
224
233
|
parameters?: Record<string, unknown>;
|
|
@@ -229,7 +238,8 @@ export interface ViewInput {
|
|
|
229
238
|
onToolSelect: (tool: WebMCP.WebMCPModel.Tool|null) => void;
|
|
230
239
|
onRevealTool: (tool: WebMCP.WebMCPModel.Tool, parameters?: Record<string, unknown>) => void;
|
|
231
240
|
selectedCall: WebMCP.WebMCPModel.Call|null;
|
|
232
|
-
|
|
241
|
+
selectedTab?: TabId;
|
|
242
|
+
onCallSelect: (call: WebMCP.WebMCPModel.Call|null, tabId?: TabId) => void;
|
|
233
243
|
filters: FilterState;
|
|
234
244
|
filterButtons: FilterMenuButtons;
|
|
235
245
|
onClearLogClick: () => void;
|
|
@@ -508,7 +518,10 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
508
518
|
}, {jslogContext: 'webmcp.cancel-call'});
|
|
509
519
|
}
|
|
510
520
|
}}>
|
|
511
|
-
<td
|
|
521
|
+
<td @click=${(e: Event) => {
|
|
522
|
+
e.stopPropagation();
|
|
523
|
+
input.onCallSelect(call, TabId.DETAILS);
|
|
524
|
+
}}>
|
|
512
525
|
<div class="name-cell">
|
|
513
526
|
<span>${call.tool.name}</span>
|
|
514
527
|
<button class="run-tool-action-button"
|
|
@@ -524,7 +537,10 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
524
537
|
</button>
|
|
525
538
|
</div>
|
|
526
539
|
</td>
|
|
527
|
-
<td
|
|
540
|
+
<td @click=${(e: Event) => {
|
|
541
|
+
e.stopPropagation();
|
|
542
|
+
input.onCallSelect(call, TabId.OUTPUT);
|
|
543
|
+
}}>
|
|
528
544
|
<div class="status-cell">
|
|
529
545
|
${iconName(call) ? html`<devtools-icon class="small" name=${iconName(call)}></devtools-icon>`
|
|
530
546
|
: ''}
|
|
@@ -532,8 +548,14 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
532
548
|
</div>
|
|
533
549
|
</td>
|
|
534
550
|
${!input.selectedCall ? html`
|
|
535
|
-
<td
|
|
536
|
-
|
|
551
|
+
<td @click=${(e: Event) => {
|
|
552
|
+
e.stopPropagation();
|
|
553
|
+
input.onCallSelect(call, TabId.INPUT);
|
|
554
|
+
}}>${call.input}</td>
|
|
555
|
+
<td @click=${(e: Event) => {
|
|
556
|
+
e.stopPropagation();
|
|
557
|
+
input.onCallSelect(call, TabId.OUTPUT);
|
|
558
|
+
}}>${call.result?.output ? JSON.stringify(call.result.output)
|
|
537
559
|
: call.result?.errorText ?? ''}</td>
|
|
538
560
|
` : nothing}
|
|
539
561
|
</tr>
|
|
@@ -552,17 +574,20 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
552
574
|
@click=${() => input.onCallSelect(null)}
|
|
553
575
|
></devtools-button>
|
|
554
576
|
<devtools-widget
|
|
555
|
-
id
|
|
577
|
+
id=${TabId.DETAILS}
|
|
578
|
+
?selected=${input.selectedTab === TabId.DETAILS}
|
|
556
579
|
title=${i18nString(UIStrings.toolDetails)}
|
|
557
580
|
${widget(ToolDetailsWidget, {tool: input.selectedCall?.tool, isUnregistered: input.selectedCall ? !input.tools.includes(input.selectedCall.tool) : false})}>
|
|
558
581
|
</devtools-widget>
|
|
559
582
|
<devtools-widget
|
|
560
|
-
id
|
|
583
|
+
id=${TabId.INPUT}
|
|
584
|
+
?selected=${input.selectedTab === TabId.INPUT}
|
|
561
585
|
title=${i18nString(UIStrings.input)}
|
|
562
586
|
${widget(PayloadWidget, parsePayload(input.selectedCall?.input))}>
|
|
563
587
|
</devtools-widget>
|
|
564
588
|
<devtools-widget
|
|
565
|
-
id
|
|
589
|
+
id=${TabId.OUTPUT}
|
|
590
|
+
?selected=${input.selectedTab === TabId.OUTPUT}
|
|
566
591
|
title=${i18nString(UIStrings.output)}
|
|
567
592
|
${widget(PayloadWidget, {
|
|
568
593
|
valueObject: input.selectedCall?.result?.output,
|
|
@@ -697,6 +722,8 @@ export class WebMCPView extends UI.Widget.VBox {
|
|
|
697
722
|
readonly #view: View;
|
|
698
723
|
#selectedTool: SelectedTool|null = null;
|
|
699
724
|
#selectedCall: WebMCP.WebMCPModel.Call|null = null;
|
|
725
|
+
#selectedTab: TabId|undefined = undefined;
|
|
726
|
+
#lastDevToolsInvocationId: string|null = null;
|
|
700
727
|
|
|
701
728
|
#filterState: FilterState = {
|
|
702
729
|
text: '',
|
|
@@ -799,17 +826,26 @@ export class WebMCPView extends UI.Widget.VBox {
|
|
|
799
826
|
#webMCPModelAdded(model: WebMCP.WebMCPModel.WebMCPModel): void {
|
|
800
827
|
model.addEventListener(WebMCP.WebMCPModel.Events.TOOLS_ADDED, this.requestUpdate, this);
|
|
801
828
|
model.addEventListener(WebMCP.WebMCPModel.Events.TOOLS_REMOVED, this.#toolsRemoved, this);
|
|
802
|
-
model.addEventListener(WebMCP.WebMCPModel.Events.TOOL_INVOKED, this
|
|
829
|
+
model.addEventListener(WebMCP.WebMCPModel.Events.TOOL_INVOKED, this.#toolInvoked, this);
|
|
803
830
|
model.addEventListener(WebMCP.WebMCPModel.Events.TOOL_RESPONDED, this.requestUpdate, this);
|
|
804
831
|
}
|
|
805
832
|
|
|
806
833
|
#webMCPModelRemoved(model: WebMCP.WebMCPModel.WebMCPModel): void {
|
|
807
834
|
model.removeEventListener(WebMCP.WebMCPModel.Events.TOOLS_ADDED, this.requestUpdate, this);
|
|
808
835
|
model.removeEventListener(WebMCP.WebMCPModel.Events.TOOLS_REMOVED, this.#toolsRemoved, this);
|
|
809
|
-
model.removeEventListener(WebMCP.WebMCPModel.Events.TOOL_INVOKED, this
|
|
836
|
+
model.removeEventListener(WebMCP.WebMCPModel.Events.TOOL_INVOKED, this.#toolInvoked, this);
|
|
810
837
|
model.removeEventListener(WebMCP.WebMCPModel.Events.TOOL_RESPONDED, this.requestUpdate, this);
|
|
811
838
|
}
|
|
812
839
|
|
|
840
|
+
#toolInvoked(event: Common.EventTarget.EventTargetEvent<WebMCP.WebMCPModel.Call>): void {
|
|
841
|
+
const call = event.data;
|
|
842
|
+
if (call.invocationId === this.#lastDevToolsInvocationId) {
|
|
843
|
+
this.#selectedCall = call;
|
|
844
|
+
this.#lastDevToolsInvocationId = null;
|
|
845
|
+
}
|
|
846
|
+
this.requestUpdate();
|
|
847
|
+
}
|
|
848
|
+
|
|
813
849
|
#toolsRemoved(event: Common.EventTarget.EventTargetEvent<readonly WebMCP.WebMCPModel.Tool[]>): void {
|
|
814
850
|
if (this.#selectedTool && event.data.includes(this.#selectedTool.tool)) {
|
|
815
851
|
this.#selectedTool = null;
|
|
@@ -861,8 +897,16 @@ export class WebMCPView extends UI.Widget.VBox {
|
|
|
861
897
|
this.requestUpdate();
|
|
862
898
|
},
|
|
863
899
|
selectedCall: this.#selectedCall,
|
|
864
|
-
|
|
865
|
-
|
|
900
|
+
selectedTab: this.#selectedTab,
|
|
901
|
+
onCallSelect: (call, tabId) => {
|
|
902
|
+
if (call === null) {
|
|
903
|
+
this.#selectedCall = null;
|
|
904
|
+
} else if (this.#selectedCall === null) {
|
|
905
|
+
this.#selectedCall = call;
|
|
906
|
+
this.#selectedTab = tabId;
|
|
907
|
+
} else {
|
|
908
|
+
this.#selectedCall = call;
|
|
909
|
+
}
|
|
866
910
|
this.requestUpdate();
|
|
867
911
|
},
|
|
868
912
|
toolCalls: filteredCalls,
|
|
@@ -870,9 +914,20 @@ export class WebMCPView extends UI.Widget.VBox {
|
|
|
870
914
|
filterButtons: this.#filterButtons,
|
|
871
915
|
onClearLogClick: this.#handleClearLogClick,
|
|
872
916
|
onFilterChange: this.#handleFilterChange,
|
|
873
|
-
onRunTool: event => {
|
|
917
|
+
onRunTool: async event => {
|
|
874
918
|
if (this.#selectedTool) {
|
|
875
|
-
|
|
919
|
+
this.#selectedTool.parameters = event.data.parameters || {};
|
|
920
|
+
this.#lastDevToolsInvocationId = await this.#selectedTool.tool.invoke(this.#selectedTool.parameters) ?? null;
|
|
921
|
+
if (this.#lastDevToolsInvocationId) {
|
|
922
|
+
const models = SDK.TargetManager.TargetManager.instance().models(WebMCP.WebMCPModel.WebMCPModel);
|
|
923
|
+
const call =
|
|
924
|
+
models.flatMap(model => model.toolCalls).find(c => c.invocationId === this.#lastDevToolsInvocationId);
|
|
925
|
+
if (call) {
|
|
926
|
+
this.#selectedCall = call;
|
|
927
|
+
this.#lastDevToolsInvocationId = null;
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
this.requestUpdate();
|
|
876
931
|
}
|
|
877
932
|
},
|
|
878
933
|
onPaste: async () => {
|
|
@@ -891,6 +946,7 @@ export class WebMCPView extends UI.Widget.VBox {
|
|
|
891
946
|
},
|
|
892
947
|
};
|
|
893
948
|
this.#view(input, {}, this.contentElement);
|
|
949
|
+
this.#selectedTab = undefined;
|
|
894
950
|
}
|
|
895
951
|
}
|
|
896
952
|
export interface PayloadViewInput {
|
|
@@ -972,7 +1028,9 @@ export const PAYLOAD_DEFAULT_VIEW = (input: PayloadViewInput, output: object, ta
|
|
|
972
1028
|
<div class="payload-value source-code error-text">
|
|
973
1029
|
${details.frames.length === 0 && details.description ? html`<span>${details.description}\n</span>` : nothing}
|
|
974
1030
|
<div>${details.frames.map(renderFrame)}</div>
|
|
975
|
-
${
|
|
1031
|
+
${
|
|
1032
|
+
details.cause ? html`\n${i18nString(UIStrings.causedBy)}\n${createException(details.cause, linkifier)}` :
|
|
1033
|
+
nothing}</div>`;
|
|
976
1034
|
};
|
|
977
1035
|
|
|
978
1036
|
render(
|
|
@@ -1124,7 +1182,7 @@ const TOOL_DETAILS_VIEW = (input: ToolDetailsViewInput, output: undefined, targe
|
|
|
1124
1182
|
></devtools-button>
|
|
1125
1183
|
</div>` : origin ? html`
|
|
1126
1184
|
<div class="label">Origin</div>
|
|
1127
|
-
<div class="value">
|
|
1185
|
+
<div class="value stack-trace">
|
|
1128
1186
|
${widget(Components.JSPresentationUtils.StackTracePreviewContent,
|
|
1129
1187
|
{stackTrace: origin, options: { expandable: true}})}
|
|
1130
1188
|
</div>` : nothing}
|
|
@@ -13,7 +13,6 @@ import * as DeviceBoundSessionsModel from './DeviceBoundSessionsModel.js';
|
|
|
13
13
|
import * as DeviceBoundSessionsTreeElement from './DeviceBoundSessionsTreeElement.js';
|
|
14
14
|
import * as DeviceBoundSessionsView from './DeviceBoundSessionsView.js';
|
|
15
15
|
import * as DOMStorageItemsView from './DOMStorageItemsView.js';
|
|
16
|
-
import * as DOMStorageModel from './DOMStorageModel.js';
|
|
17
16
|
import * as ExtensionStorageItemsView from './ExtensionStorageItemsView.js';
|
|
18
17
|
import * as ExtensionStorageModel from './ExtensionStorageModel.js';
|
|
19
18
|
import * as FrameDetailsView from './FrameDetailsView.js';
|
|
@@ -58,7 +57,6 @@ export {
|
|
|
58
57
|
DeviceBoundSessionsTreeElement,
|
|
59
58
|
DeviceBoundSessionsView,
|
|
60
59
|
DOMStorageItemsView,
|
|
61
|
-
DOMStorageModel,
|
|
62
60
|
ExtensionStorageItemsView,
|
|
63
61
|
ExtensionStorageModel,
|
|
64
62
|
FrameDetailsView,
|
|
@@ -88,6 +88,14 @@
|
|
|
88
88
|
display: flex;
|
|
89
89
|
gap: var(--sys-size-5);
|
|
90
90
|
align-items: center;
|
|
91
|
+
min-width: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.name-cell > span {
|
|
95
|
+
white-space: nowrap;
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
text-overflow: ellipsis;
|
|
98
|
+
min-width: 0;
|
|
91
99
|
}
|
|
92
100
|
|
|
93
101
|
.run-tool-action-button {
|
|
@@ -141,8 +149,11 @@
|
|
|
141
149
|
color: var(--sys-color-on-surface);
|
|
142
150
|
overflow-wrap: anywhere;
|
|
143
151
|
|
|
144
|
-
|
|
145
|
-
|
|
152
|
+
&.stack-trace {
|
|
153
|
+
display: flex;
|
|
154
|
+
padding: 0;
|
|
155
|
+
margin-top: calc(-1 * (var(--sys-size-1) + var(--sys-size-2)));
|
|
156
|
+
margin-left: calc(-1 * var(--sys-size-3));
|
|
146
157
|
}
|
|
147
158
|
|
|
148
159
|
&.tool-origin-container {
|
|
@@ -190,7 +190,7 @@ export class ConsolePrompt extends Common.ObjectWrapper.eventMixin<EventTypes, t
|
|
|
190
190
|
this.editorSetForTest();
|
|
191
191
|
|
|
192
192
|
// Record the console tool load time after the console prompt constructor is complete.
|
|
193
|
-
|
|
193
|
+
UI.UIUserMetrics.UIUserMetrics.instance().panelLoaded('console', 'DevTools.Launch.Console');
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
private eagerSettingChanged(): void {
|
|
@@ -571,9 +571,8 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
571
571
|
this.consoleMessages = [];
|
|
572
572
|
this.consoleGroupStarts = [];
|
|
573
573
|
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
AiCodeCompletion.AiCodeCompletion.AiCodeCompletion.isAiCodeCompletionEnabled(devtoolsLocale.locale) ? {
|
|
574
|
+
this.aiCodeCompletionConfig = AiCodeCompletion.AiCodeCompletion.AiCodeCompletion.isAiCodeCompletionAvailable() ?
|
|
575
|
+
{
|
|
577
576
|
completionContext: {
|
|
578
577
|
getPrefix: this.getConsoleMessageHistory.bind(this),
|
|
579
578
|
additionalFiles: [{
|
|
@@ -597,7 +596,7 @@ export class ConsoleView extends UI.Widget.VBox implements
|
|
|
597
596
|
onResponseReceived: this.#onAiCodeCompletionResponseReceived.bind(this),
|
|
598
597
|
panel: AiCodeCompletion.AiCodeCompletion.ContextFlavor.CONSOLE,
|
|
599
598
|
} :
|
|
600
|
-
|
|
599
|
+
undefined;
|
|
601
600
|
|
|
602
601
|
this.prompt = new ConsolePrompt(this.aiCodeCompletionConfig);
|
|
603
602
|
this.prompt.show(this.promptElement);
|
|
@@ -11,9 +11,7 @@ import * as ColorPicker from '../../ui/legacy/components/color_picker/color_pick
|
|
|
11
11
|
import * as InlineEditor from '../../ui/legacy/components/inline_editor/inline_editor.js';
|
|
12
12
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
13
13
|
|
|
14
|
-
import type {StylePropertiesSection} from './StylePropertiesSection.js';
|
|
15
14
|
import type {StylePropertyTreeElement} from './StylePropertyTreeElement.js';
|
|
16
|
-
import type {StylesContainer} from './StylesContainer.js';
|
|
17
15
|
|
|
18
16
|
const UIStrings = {
|
|
19
17
|
/**
|
|
@@ -403,153 +401,3 @@ export class ShadowSwatchPopoverHelper extends Common.ObjectWrapper.ObjectWrappe
|
|
|
403
401
|
delete this.originalPropertyText;
|
|
404
402
|
}
|
|
405
403
|
}
|
|
406
|
-
|
|
407
|
-
export class FontEditorSectionManager {
|
|
408
|
-
private readonly treeElementMap: Map<string, StylePropertyTreeElement>;
|
|
409
|
-
private readonly swatchPopoverHelper: InlineEditor.SwatchPopoverHelper.SwatchPopoverHelper;
|
|
410
|
-
private readonly section: StylePropertiesSection;
|
|
411
|
-
private stylesContainer: StylesContainer|null;
|
|
412
|
-
private fontEditor: InlineEditor.FontEditor.FontEditor|null;
|
|
413
|
-
private scrollerElement: Element|null;
|
|
414
|
-
private readonly boundFontChanged:
|
|
415
|
-
(event: Common.EventTarget.EventTargetEvent<InlineEditor.FontEditor.FontChangedEvent>) => void;
|
|
416
|
-
private readonly boundOnScroll: () => void;
|
|
417
|
-
private readonly boundResized: () => void;
|
|
418
|
-
constructor(
|
|
419
|
-
swatchPopoverHelper: InlineEditor.SwatchPopoverHelper.SwatchPopoverHelper, section: StylePropertiesSection) {
|
|
420
|
-
this.treeElementMap = new Map();
|
|
421
|
-
|
|
422
|
-
this.swatchPopoverHelper = swatchPopoverHelper;
|
|
423
|
-
|
|
424
|
-
this.section = section;
|
|
425
|
-
|
|
426
|
-
this.stylesContainer = null;
|
|
427
|
-
|
|
428
|
-
this.fontEditor = null;
|
|
429
|
-
|
|
430
|
-
this.scrollerElement = null;
|
|
431
|
-
|
|
432
|
-
this.boundFontChanged = this.fontChanged.bind(this);
|
|
433
|
-
this.boundOnScroll = this.onScroll.bind(this);
|
|
434
|
-
this.boundResized = this.fontEditorResized.bind(this);
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
private fontChanged(event: Common.EventTarget.EventTargetEvent<InlineEditor.FontEditor.FontChangedEvent>): void {
|
|
438
|
-
const {propertyName, value} = event.data;
|
|
439
|
-
const treeElement = this.treeElementMap.get(propertyName);
|
|
440
|
-
void this.updateFontProperty(propertyName, value, treeElement);
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
private async updateFontProperty(propertyName: string, value: string, treeElement?: StylePropertyTreeElement):
|
|
444
|
-
Promise<void> {
|
|
445
|
-
if (treeElement?.treeOutline && treeElement.valueElement && treeElement.property.parsedOk &&
|
|
446
|
-
treeElement.property.range) {
|
|
447
|
-
let elementRemoved = false;
|
|
448
|
-
treeElement.valueElement.textContent = value;
|
|
449
|
-
treeElement.property.value = value;
|
|
450
|
-
let styleText;
|
|
451
|
-
const propertyName = treeElement.property.name;
|
|
452
|
-
if (value.length) {
|
|
453
|
-
styleText = treeElement.renderedPropertyText();
|
|
454
|
-
} else {
|
|
455
|
-
styleText = '';
|
|
456
|
-
elementRemoved = true;
|
|
457
|
-
this.fixIndex(treeElement.property.index);
|
|
458
|
-
}
|
|
459
|
-
this.treeElementMap.set(propertyName, treeElement);
|
|
460
|
-
await treeElement.applyStyleText(styleText, true);
|
|
461
|
-
if (elementRemoved) {
|
|
462
|
-
this.treeElementMap.delete(propertyName);
|
|
463
|
-
}
|
|
464
|
-
} else if (value.length) {
|
|
465
|
-
const newProperty = this.section.addNewBlankProperty();
|
|
466
|
-
if (newProperty) {
|
|
467
|
-
newProperty.property.name = propertyName;
|
|
468
|
-
newProperty.property.value = value;
|
|
469
|
-
newProperty.updateTitle();
|
|
470
|
-
await newProperty.applyStyleText(newProperty.renderedPropertyText(), true);
|
|
471
|
-
this.treeElementMap.set(newProperty.property.name, newProperty);
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
this.section.onpopulate();
|
|
475
|
-
this.swatchPopoverHelper.reposition();
|
|
476
|
-
return;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
private fontEditorResized(): void {
|
|
480
|
-
this.swatchPopoverHelper.reposition();
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
private fixIndex(removedIndex: number): void {
|
|
484
|
-
for (const treeElement of this.treeElementMap.values()) {
|
|
485
|
-
if (treeElement.property.index > removedIndex) {
|
|
486
|
-
treeElement.property.index -= 1;
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
private createPropertyValueMap(): Map<string, string> {
|
|
492
|
-
const propertyMap = new Map<string, string>();
|
|
493
|
-
for (const fontProperty of this.treeElementMap) {
|
|
494
|
-
const propertyName = (fontProperty[0]);
|
|
495
|
-
const treeElement = fontProperty[1];
|
|
496
|
-
if (treeElement.property.value.length) {
|
|
497
|
-
propertyMap.set(propertyName, treeElement.property.value);
|
|
498
|
-
} else {
|
|
499
|
-
this.treeElementMap.delete(propertyName);
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
return propertyMap;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
registerFontProperty(treeElement: StylePropertyTreeElement): void {
|
|
506
|
-
const propertyName = treeElement.property.name;
|
|
507
|
-
if (this.treeElementMap.has(propertyName)) {
|
|
508
|
-
const treeElementFromMap = this.treeElementMap.get(propertyName);
|
|
509
|
-
if (!treeElement.overloaded() || (treeElementFromMap?.overloaded())) {
|
|
510
|
-
this.treeElementMap.set(propertyName, treeElement);
|
|
511
|
-
}
|
|
512
|
-
} else {
|
|
513
|
-
this.treeElementMap.set(propertyName, treeElement);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
async showPopover(iconElement: Element, stylesContainer: StylesContainer): Promise<void> {
|
|
518
|
-
if (this.swatchPopoverHelper.isShowing()) {
|
|
519
|
-
this.swatchPopoverHelper.hide(true);
|
|
520
|
-
return;
|
|
521
|
-
}
|
|
522
|
-
this.stylesContainer = stylesContainer;
|
|
523
|
-
const propertyValueMap = this.createPropertyValueMap();
|
|
524
|
-
this.fontEditor = new InlineEditor.FontEditor.FontEditor(propertyValueMap);
|
|
525
|
-
this.fontEditor.addEventListener(InlineEditor.FontEditor.Events.FONT_CHANGED, this.boundFontChanged);
|
|
526
|
-
this.fontEditor.addEventListener(InlineEditor.FontEditor.Events.FONT_EDITOR_RESIZED, this.boundResized);
|
|
527
|
-
this.swatchPopoverHelper.show(this.fontEditor, iconElement, this.onPopoverHidden.bind(this));
|
|
528
|
-
this.scrollerElement = iconElement.enclosingNodeOrSelfWithClass('style-panes-wrapper');
|
|
529
|
-
if (this.scrollerElement) {
|
|
530
|
-
this.scrollerElement.addEventListener('scroll', this.boundOnScroll, false);
|
|
531
|
-
}
|
|
532
|
-
|
|
533
|
-
this.stylesContainer.setEditingStyle(true);
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
private onScroll(): void {
|
|
537
|
-
this.swatchPopoverHelper.hide(true);
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
private onPopoverHidden(): void {
|
|
541
|
-
if (this.scrollerElement) {
|
|
542
|
-
this.scrollerElement.removeEventListener('scroll', this.boundOnScroll, false);
|
|
543
|
-
}
|
|
544
|
-
this.section.onpopulate();
|
|
545
|
-
if (this.fontEditor) {
|
|
546
|
-
this.fontEditor.removeEventListener(InlineEditor.FontEditor.Events.FONT_CHANGED, this.boundFontChanged);
|
|
547
|
-
}
|
|
548
|
-
this.fontEditor = null;
|
|
549
|
-
if (this.stylesContainer) {
|
|
550
|
-
this.stylesContainer.setEditingStyle(false);
|
|
551
|
-
}
|
|
552
|
-
this.section.resetToolbars();
|
|
553
|
-
this.section.onpopulate();
|
|
554
|
-
}
|
|
555
|
-
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// Copyright 2021 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
5
4
|
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
6
5
|
|
|
7
6
|
/*
|
|
@@ -55,7 +54,6 @@ import type * as Adorners from '../../ui/components/adorners/adorners.js';
|
|
|
55
54
|
import * as CodeHighlighter from '../../ui/components/code_highlighter/code_highlighter.js';
|
|
56
55
|
import * as Highlighting from '../../ui/components/highlighting/highlighting.js';
|
|
57
56
|
import * as TextEditor from '../../ui/components/text_editor/text_editor.js';
|
|
58
|
-
import {Icon} from '../../ui/kit/kit.js';
|
|
59
57
|
import * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
60
58
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
61
59
|
import * as Lit from '../../ui/lit/lit.js';
|
|
@@ -1233,12 +1231,9 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
1233
1231
|
this.performUpdate();
|
|
1234
1232
|
|
|
1235
1233
|
if (this.nodeInternal.retained && !this.isClosingTag()) {
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
icon.classList.add('extra-small');
|
|
1240
|
-
icon.style.setProperty('vertical-align', 'middle');
|
|
1241
|
-
this.setLeadingIcons([icon]);
|
|
1234
|
+
this.setLeadingIcons([
|
|
1235
|
+
html`<devtools-icon class="extra-small" name="small-status-dot" style="color:var(--icon-error); vertical-align:middle"></devtools-icon>`
|
|
1236
|
+
]);
|
|
1242
1237
|
this.listItemNode.classList.add('detached-elements-detached-node');
|
|
1243
1238
|
this.listItemNode.style.setProperty('display', '-webkit-box');
|
|
1244
1239
|
this.listItemNode.setAttribute('title', 'Retained Node');
|
|
@@ -2375,7 +2370,7 @@ export class ElementsTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2375
2370
|
private addNewAttribute(): boolean {
|
|
2376
2371
|
// Cannot just convert the textual html into an element without
|
|
2377
2372
|
// a parent node. Use a temporary span container for the HTML.
|
|
2378
|
-
const container = document.
|
|
2373
|
+
const container = document.createDocumentFragment();
|
|
2379
2374
|
|
|
2380
2375
|
Lit.render(renderAttribute({name: ' ', value: ''}, null, false, this.nodeInternal), container);
|
|
2381
2376
|
const attr = container.firstElementChild as HTMLElement;
|
|
@@ -314,6 +314,9 @@ export class StandaloneStylesContainer extends Common.ObjectWrapper.eventMixin<E
|
|
|
314
314
|
jumpToFontPaletteDefinition(_paletteName: string): void {
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
+
jumpToCounterStyleDefinition(_counterStyleName: string): void {
|
|
318
|
+
}
|
|
319
|
+
|
|
317
320
|
jumpToDeclaration(_valueSource: SDK.CSSMatchedStyles.CSSValueSource): void {
|
|
318
321
|
}
|
|
319
322
|
|
|
@@ -39,7 +39,6 @@ import * as Common from '../../core/common/common.js';
|
|
|
39
39
|
import * as Host from '../../core/host/host.js';
|
|
40
40
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
41
41
|
import * as Platform from '../../core/platform/platform.js';
|
|
42
|
-
import * as Root from '../../core/root/root.js';
|
|
43
42
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
44
43
|
import * as Protocol from '../../generated/protocol.js';
|
|
45
44
|
import * as Badges from '../../models/badges/badges.js';
|
|
@@ -54,7 +53,6 @@ import {html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
|
|
|
54
53
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
55
54
|
import * as PanelsCommon from '../common/common.js';
|
|
56
55
|
|
|
57
|
-
import {FontEditorSectionManager} from './ColorSwatchPopoverIcon.js';
|
|
58
56
|
import * as ElementsComponents from './components/components.js';
|
|
59
57
|
import {ElementsPanel} from './ElementsPanel.js';
|
|
60
58
|
import stylePropertiesTreeOutlineStyles from './stylePropertiesTreeOutline.css.js';
|
|
@@ -166,9 +164,6 @@ export class StylePropertiesSection {
|
|
|
166
164
|
private showAllButton: Buttons.Button.Button;
|
|
167
165
|
protected selectorElement: HTMLSpanElement;
|
|
168
166
|
private readonly newStyleRuleToolbar: UI.Toolbar.Toolbar|undefined;
|
|
169
|
-
private readonly fontEditorToolbar: UI.Toolbar.Toolbar|undefined;
|
|
170
|
-
private readonly fontEditorSectionManager: FontEditorSectionManager|undefined;
|
|
171
|
-
private readonly fontEditorButton: UI.Toolbar.ToolbarButton|undefined;
|
|
172
167
|
private selectedSinceMouseDown: boolean;
|
|
173
168
|
private readonly elementToSelectorIndex = new WeakMap<Element, number>();
|
|
174
169
|
navigable: boolean|null|undefined;
|
|
@@ -309,31 +304,6 @@ export class StylePropertiesSection {
|
|
|
309
304
|
UI.ARIAUtils.setHidden(this.newStyleRuleToolbar, true);
|
|
310
305
|
}
|
|
311
306
|
|
|
312
|
-
if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.FONT_EDITOR) && this.editable) {
|
|
313
|
-
this.fontEditorToolbar = this.#styleRuleElement.createChild('devtools-toolbar', 'sidebar-pane-section-toolbar');
|
|
314
|
-
this.fontEditorSectionManager = new FontEditorSectionManager(this.stylesContainer.swatchPopoverHelper(), this);
|
|
315
|
-
this.fontEditorButton =
|
|
316
|
-
new UI.Toolbar.ToolbarButton('Font Editor', 'custom-typography', undefined, 'font-editor');
|
|
317
|
-
this.fontEditorButton.addEventListener(UI.Toolbar.ToolbarButton.Events.CLICK, () => {
|
|
318
|
-
this.onFontEditorButtonClicked();
|
|
319
|
-
}, this);
|
|
320
|
-
this.fontEditorButton.element.addEventListener('keydown', event => {
|
|
321
|
-
if (Platform.KeyboardUtilities.isEnterOrSpaceKey(event)) {
|
|
322
|
-
event.consume(true);
|
|
323
|
-
this.onFontEditorButtonClicked();
|
|
324
|
-
}
|
|
325
|
-
}, false);
|
|
326
|
-
this.fontEditorToolbar.appendToolbarItem(this.fontEditorButton);
|
|
327
|
-
|
|
328
|
-
if (this.styleInternal.type === SDK.CSSStyleDeclaration.Type.Inline) {
|
|
329
|
-
if (this.newStyleRuleToolbar) {
|
|
330
|
-
this.newStyleRuleToolbar.classList.add('shifted-toolbar');
|
|
331
|
-
}
|
|
332
|
-
} else {
|
|
333
|
-
this.fontEditorToolbar.classList.add('font-toolbar-hidden');
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
307
|
this.selectorElement.addEventListener('click', this.handleSelectorClick.bind(this), false);
|
|
338
308
|
this.selectorElement.setAttribute(
|
|
339
309
|
'jslog', `${VisualLogging.cssRuleHeader('selector').track({click: true, change: true})}`);
|
|
@@ -409,31 +379,6 @@ export class StylePropertiesSection {
|
|
|
409
379
|
return this.sectionIdx;
|
|
410
380
|
}
|
|
411
381
|
|
|
412
|
-
registerFontProperty(treeElement: StylePropertyTreeElement): void {
|
|
413
|
-
if (this.fontEditorSectionManager) {
|
|
414
|
-
this.fontEditorSectionManager.registerFontProperty(treeElement);
|
|
415
|
-
}
|
|
416
|
-
if (this.fontEditorToolbar) {
|
|
417
|
-
this.fontEditorToolbar.classList.remove('font-toolbar-hidden');
|
|
418
|
-
if (this.newStyleRuleToolbar) {
|
|
419
|
-
this.newStyleRuleToolbar.classList.add('shifted-toolbar');
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
resetToolbars(): void {
|
|
425
|
-
if (this.stylesContainer.swatchPopoverHelper().isShowing() ||
|
|
426
|
-
this.styleInternal.type === SDK.CSSStyleDeclaration.Type.Inline) {
|
|
427
|
-
return;
|
|
428
|
-
}
|
|
429
|
-
if (this.fontEditorToolbar) {
|
|
430
|
-
this.fontEditorToolbar.classList.add('font-toolbar-hidden');
|
|
431
|
-
}
|
|
432
|
-
if (this.newStyleRuleToolbar) {
|
|
433
|
-
this.newStyleRuleToolbar.classList.remove('shifted-toolbar');
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
|
|
437
382
|
static createRuleOriginNode(
|
|
438
383
|
matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, linkifier: Components.Linkifier.Linkifier,
|
|
439
384
|
rule: SDK.CSSRule.CSSRule|null): LitTemplate {
|
|
@@ -678,12 +623,6 @@ export class StylePropertiesSection {
|
|
|
678
623
|
}
|
|
679
624
|
}
|
|
680
625
|
|
|
681
|
-
private onFontEditorButtonClicked(): void {
|
|
682
|
-
if (this.fontEditorSectionManager && this.fontEditorButton) {
|
|
683
|
-
void this.fontEditorSectionManager.showPopover(this.fontEditorButton.element, this.stylesContainer);
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
|
|
687
626
|
style(): SDK.CSSStyleDeclaration.CSSStyleDeclaration {
|
|
688
627
|
return this.styleInternal;
|
|
689
628
|
}
|