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
|
@@ -8,7 +8,6 @@ import * as Common from '../../core/common/common.js';
|
|
|
8
8
|
import * as Host from '../../core/host/host.js';
|
|
9
9
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
10
10
|
import * as Platform from '../../core/platform/platform.js';
|
|
11
|
-
import * as Root from '../../core/root/root.js';
|
|
12
11
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
13
12
|
import type * as Protocol from '../../generated/protocol.js';
|
|
14
13
|
import * as Badges from '../../models/badges/badges.js';
|
|
@@ -1157,10 +1156,19 @@ export class LinkableNameRenderer extends rendererBase(SDK.CSSPropertyParserMatc
|
|
|
1157
1156
|
return {
|
|
1158
1157
|
jslogContext: 'css-font-palette',
|
|
1159
1158
|
metric: null,
|
|
1160
|
-
ruleBlock: '
|
|
1159
|
+
ruleBlock: '', // Not used
|
|
1161
1160
|
isDefined: Boolean(this.#matchedStyles.atRules().find(
|
|
1162
1161
|
ar => ar.type() === 'font-palette-values' && ar.name()?.text === match.text)),
|
|
1163
1162
|
};
|
|
1163
|
+
case SDK.CSSPropertyParserMatchers.LinkableNameProperties.LIST_STYLE:
|
|
1164
|
+
case SDK.CSSPropertyParserMatchers.LinkableNameProperties.LIST_STYLE_TYPE:
|
|
1165
|
+
return {
|
|
1166
|
+
jslogContext: 'css-list-style-type',
|
|
1167
|
+
metric: null,
|
|
1168
|
+
ruleBlock: '', // Not used
|
|
1169
|
+
isDefined: Boolean(this.#matchedStyles.atRules().find(
|
|
1170
|
+
ar => ar.type() === 'counter-style' && ar.name()?.text === match.text)),
|
|
1171
|
+
};
|
|
1164
1172
|
case SDK.CSSPropertyParserMatchers.LinkableNameProperties.POSITION_TRY:
|
|
1165
1173
|
case SDK.CSSPropertyParserMatchers.LinkableNameProperties.POSITION_TRY_FALLBACKS:
|
|
1166
1174
|
return {
|
|
@@ -1183,6 +1191,10 @@ export class LinkableNameRenderer extends rendererBase(SDK.CSSPropertyParserMatc
|
|
|
1183
1191
|
metric && Host.userMetrics.swatchActivated(metric);
|
|
1184
1192
|
if (match.propertyName === SDK.CSSPropertyParserMatchers.LinkableNameProperties.FONT_PALETTE) {
|
|
1185
1193
|
this.#stylesContainer.jumpToFontPaletteDefinition(match.text);
|
|
1194
|
+
} else if (
|
|
1195
|
+
match.propertyName === SDK.CSSPropertyParserMatchers.LinkableNameProperties.LIST_STYLE ||
|
|
1196
|
+
match.propertyName === SDK.CSSPropertyParserMatchers.LinkableNameProperties.LIST_STYLE_TYPE) {
|
|
1197
|
+
this.#stylesContainer.jumpToCounterStyleDefinition(match.text);
|
|
1186
1198
|
} else {
|
|
1187
1199
|
this.#stylesContainer.jumpToSectionBlock(`${ruleBlock} ${match.text}`);
|
|
1188
1200
|
}
|
|
@@ -1599,20 +1611,6 @@ export class ShadowRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.S
|
|
|
1599
1611
|
}
|
|
1600
1612
|
}
|
|
1601
1613
|
|
|
1602
|
-
// clang-format off
|
|
1603
|
-
export class FontRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.FontMatch) {
|
|
1604
|
-
// clang-format on
|
|
1605
|
-
constructor(readonly treeElement: StylePropertyTreeElement) {
|
|
1606
|
-
super();
|
|
1607
|
-
}
|
|
1608
|
-
|
|
1609
|
-
override render(match: SDK.CSSPropertyParserMatchers.FontMatch, context: RenderingContext): Node[] {
|
|
1610
|
-
this.treeElement.section().registerFontProperty(this.treeElement);
|
|
1611
|
-
const {nodes} = Renderer.render(ASTUtils.siblings(ASTUtils.declValue(match.node)), context);
|
|
1612
|
-
return nodes;
|
|
1613
|
-
}
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
1614
|
// clang-format off
|
|
1617
1615
|
export class GridTemplateRenderer extends rendererBase(SDK.CSSPropertyParserMatchers.GridTemplateMatch) {
|
|
1618
1616
|
// clang-format on
|
|
@@ -2462,9 +2460,6 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
2462
2460
|
this.getComputedStyles() ?? new Map(), this.getComputedStyleExtraFields()) :
|
|
2463
2461
|
[];
|
|
2464
2462
|
|
|
2465
|
-
if (Root.Runtime.experiments.isEnabled(Root.ExperimentNames.ExperimentName.FONT_EDITOR) && this.property.parsedOk) {
|
|
2466
|
-
renderers.push(new FontRenderer(this));
|
|
2467
|
-
}
|
|
2468
2463
|
this.listItemElement.removeChildren();
|
|
2469
2464
|
const matchedResult = this.property.parseValue(this.matchedStyles(), this.computedStyles);
|
|
2470
2465
|
this.valueElement = Renderer.renderValueElement(this.property, matchedResult, renderers).valueElement;
|
|
@@ -3610,9 +3605,7 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
3610
3605
|
// This occurs when deleting the last index of a StylePropertiesSection as this.style._allProperties array gets updated
|
|
3611
3606
|
// before we index it when setting the value for updatedProperty
|
|
3612
3607
|
const deleteProperty = majorChange && !styleText.length;
|
|
3613
|
-
if (deleteProperty) {
|
|
3614
|
-
this.#parentSection.resetToolbars();
|
|
3615
|
-
} else if (!deleteProperty && updatedProperty) {
|
|
3608
|
+
if (!deleteProperty && updatedProperty) {
|
|
3616
3609
|
this.property = updatedProperty;
|
|
3617
3610
|
}
|
|
3618
3611
|
|
|
@@ -3655,6 +3648,9 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
3655
3648
|
return;
|
|
3656
3649
|
}
|
|
3657
3650
|
this.#clearGhostTextInValue();
|
|
3651
|
+
if (this.value === text) {
|
|
3652
|
+
return;
|
|
3653
|
+
}
|
|
3658
3654
|
if (this.value) {
|
|
3659
3655
|
// If there is an existing value, and user is editing the name field
|
|
3660
3656
|
// which leads to a new value suggestion, then the previous value should no
|
|
@@ -3668,7 +3664,24 @@ export class StylePropertyTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
3668
3664
|
}
|
|
3669
3665
|
|
|
3670
3666
|
#clearGhostTextInValue(): void {
|
|
3671
|
-
this.listItemElement.querySelector('.ghost-value-prediction')
|
|
3667
|
+
const ghostTextElement = this.listItemElement.querySelector('.ghost-value-prediction');
|
|
3668
|
+
if (!ghostTextElement) {
|
|
3669
|
+
return;
|
|
3670
|
+
}
|
|
3671
|
+
ghostTextElement.remove();
|
|
3672
|
+
// If there's no value, there's nothing to restore
|
|
3673
|
+
if (!this.value) {
|
|
3674
|
+
return;
|
|
3675
|
+
}
|
|
3676
|
+
// Restore original classes
|
|
3677
|
+
if (this.property.parsedOk) {
|
|
3678
|
+
this.listItemElement.classList.remove('not-parsed-ok', 'invalid-property-value');
|
|
3679
|
+
} else {
|
|
3680
|
+
const invalidPropertyValue = SDK.CSSMetadata.cssMetadata().isCSSPropertyName(this.property.name);
|
|
3681
|
+
if (!invalidPropertyValue) {
|
|
3682
|
+
this.listItemElement.classList.remove('invalid-property-value');
|
|
3683
|
+
}
|
|
3684
|
+
}
|
|
3672
3685
|
}
|
|
3673
3686
|
}
|
|
3674
3687
|
|
|
@@ -32,9 +32,8 @@ export class StylesAiCodeCompletionProvider {
|
|
|
32
32
|
#boundOnUpdateAiCodeCompletionState = this.#updateAiCodeCompletionState.bind(this);
|
|
33
33
|
|
|
34
34
|
private constructor(aiCodeCompletionConfig: TextEditor.AiCodeCompletionProvider.AiCodeCompletionConfig) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
throw new Error('AI code completion feature in Styles is not enabled.');
|
|
35
|
+
if (!AiCodeCompletion.AiCodeCompletion.AiCodeCompletion.isAiCodeCompletionStylesAvailable()) {
|
|
36
|
+
throw new Error('AI code completion feature in Styles is not available.');
|
|
38
37
|
}
|
|
39
38
|
this.#aiCodeCompletionConfig = aiCodeCompletionConfig;
|
|
40
39
|
Host.AidaClient.HostConfigTracker.instance().addEventListener(
|
|
@@ -82,7 +81,10 @@ export class StylesAiCodeCompletionProvider {
|
|
|
82
81
|
async #updateAiCodeCompletionState(): Promise<void> {
|
|
83
82
|
const aidaAvailability = await Host.AidaClient.AidaClient.checkAccessPreconditions();
|
|
84
83
|
const isAvailable = aidaAvailability === Host.AidaClient.AidaAccessPreconditions.AVAILABLE;
|
|
85
|
-
const
|
|
84
|
+
const devtoolsLocale = i18n.DevToolsLocale.DevToolsLocale.instance().locale;
|
|
85
|
+
const isEnabled =
|
|
86
|
+
AiCodeCompletion.AiCodeCompletion.AiCodeCompletion.isAiCodeCompletionStylesEnabled(devtoolsLocale) &&
|
|
87
|
+
this.#aiCodeCompletionSetting.get();
|
|
86
88
|
if (isAvailable && isEnabled) {
|
|
87
89
|
this.#setupAiCodeCompletion();
|
|
88
90
|
} else {
|
|
@@ -52,6 +52,7 @@ export interface StylesContainer {
|
|
|
52
52
|
jumpToProperty(propertyName: string, sectionName?: string, blockName?: string): boolean;
|
|
53
53
|
jumpToSectionBlock(section: string): void;
|
|
54
54
|
jumpToFontPaletteDefinition(paletteName: string): void;
|
|
55
|
+
jumpToCounterStyleDefinition(counterStyleName: string): void;
|
|
55
56
|
jumpToDeclaration(valueSource: SDK.CSSMatchedStyles.CSSValueSource): void;
|
|
56
57
|
setActiveProperty(treeElement: StylePropertyTreeElement|null): void;
|
|
57
58
|
addStyleUpdateListener(listener: () => void): void;
|
|
@@ -140,6 +140,10 @@ const UIStrings = {
|
|
|
140
140
|
* @example {color: blue;} PH1
|
|
141
141
|
*/
|
|
142
142
|
aiSuggestionAccepted: '{PH1} Suggestion accepted.',
|
|
143
|
+
/**
|
|
144
|
+
* @description Title of the general at-rule section
|
|
145
|
+
*/
|
|
146
|
+
atRuleSection: 'Other @rules',
|
|
143
147
|
} as const;
|
|
144
148
|
|
|
145
149
|
const str_ = i18n.i18n.registerUIStrings('panels/elements/StylesSidebarPane.ts', UIStrings);
|
|
@@ -154,8 +158,6 @@ const MIN_FOLDED_SECTIONS_COUNT = 5;
|
|
|
154
158
|
export const REGISTERED_PROPERTY_SECTION_NAME = '@property';
|
|
155
159
|
/** Title of the function section **/
|
|
156
160
|
export const FUNCTION_SECTION_NAME = '@function';
|
|
157
|
-
/** Title of the general at-rule section */
|
|
158
|
-
export const AT_RULE_SECTION_NAME = '@font-*';
|
|
159
161
|
|
|
160
162
|
// Highlightable properties are those that can be hovered in the sidebar to trigger a specific
|
|
161
163
|
// highlighting mode on the current element.
|
|
@@ -275,8 +277,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
|
275
277
|
}
|
|
276
278
|
});
|
|
277
279
|
|
|
278
|
-
|
|
279
|
-
if (AiCodeCompletion.AiCodeCompletion.AiCodeCompletion.isAiCodeCompletionStylesEnabled(devtoolsLocale.locale)) {
|
|
280
|
+
if (AiCodeCompletion.AiCodeCompletion.AiCodeCompletion.isAiCodeCompletionStylesAvailable()) {
|
|
280
281
|
this.aiCodeCompletionConfig = {
|
|
281
282
|
completionContext: {},
|
|
282
283
|
generationContext: {},
|
|
@@ -348,7 +349,11 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
|
348
349
|
}
|
|
349
350
|
|
|
350
351
|
jumpToFontPaletteDefinition(paletteName: string): void {
|
|
351
|
-
this.jumpToSection(`@font-palette-values ${paletteName}`,
|
|
352
|
+
this.jumpToSection(`@font-palette-values ${paletteName}`, i18nString(UIStrings.atRuleSection));
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
jumpToCounterStyleDefinition(counterStyleName: string): void {
|
|
356
|
+
this.jumpToSection(`@counter-style ${counterStyleName}`, i18nString(UIStrings.atRuleSection));
|
|
352
357
|
}
|
|
353
358
|
|
|
354
359
|
forceUpdate(): void {
|
|
@@ -1045,7 +1050,7 @@ export class StylesSidebarPane extends Common.ObjectWrapper.eventMixin<EventType
|
|
|
1045
1050
|
this.swatchPopoverHelper().reposition();
|
|
1046
1051
|
|
|
1047
1052
|
// Record the elements tool load time after the sidepane has loaded.
|
|
1048
|
-
|
|
1053
|
+
UI.UIUserMetrics.UIUserMetrics.instance().panelLoaded('elements', 'DevTools.Launch.Elements');
|
|
1049
1054
|
|
|
1050
1055
|
this.dispatchEventToListeners(Events.STYLES_UPDATE_COMPLETED, {hasMatchedStyles: false});
|
|
1051
1056
|
}
|
|
@@ -1711,7 +1716,7 @@ export class SectionBlock {
|
|
|
1711
1716
|
const separatorElement = document.createElement('div');
|
|
1712
1717
|
const block = new SectionBlock(separatorElement, true, expandedByDefault);
|
|
1713
1718
|
separatorElement.className = 'sidebar-separator';
|
|
1714
|
-
separatorElement.appendChild(document.createTextNode(
|
|
1719
|
+
separatorElement.appendChild(document.createTextNode(i18nString(UIStrings.atRuleSection)));
|
|
1715
1720
|
return block;
|
|
1716
1721
|
}
|
|
1717
1722
|
|
|
@@ -217,10 +217,6 @@
|
|
|
217
217
|
width: 100%;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
.font-toolbar-hidden {
|
|
221
|
-
visibility: hidden;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
220
|
.sidebar-separator {
|
|
225
221
|
background-color: var(--sys-color-surface2);
|
|
226
222
|
padding: 0 5px;
|
|
@@ -262,10 +258,6 @@
|
|
|
262
258
|
|
|
263
259
|
--toolbar-height: 16px;
|
|
264
260
|
}
|
|
265
|
-
|
|
266
|
-
&.shifted-toolbar {
|
|
267
|
-
padding-right: 32px;
|
|
268
|
-
}
|
|
269
261
|
}
|
|
270
262
|
|
|
271
263
|
.styles-pane:not(.is-editing-style)
|
|
@@ -13,7 +13,7 @@ import {type Bounds, Events, InspectedPagePlaceholder} from './InspectedPagePlac
|
|
|
13
13
|
|
|
14
14
|
let appInstance: AdvancedApp;
|
|
15
15
|
|
|
16
|
-
export class AdvancedApp implements
|
|
16
|
+
export class AdvancedApp implements UI.App.App {
|
|
17
17
|
private rootSplitWidget!: UI.SplitWidget.SplitWidget;
|
|
18
18
|
private deviceModeView!: DeviceModeWrapper;
|
|
19
19
|
private inspectedPagePlaceholder!: InspectedPagePlaceholder;
|
|
@@ -188,7 +188,7 @@ globalThis.Emulation.AdvancedApp = AdvancedApp;
|
|
|
188
188
|
|
|
189
189
|
let advancedAppProviderInstance: AdvancedAppProvider;
|
|
190
190
|
|
|
191
|
-
export class AdvancedAppProvider implements
|
|
191
|
+
export class AdvancedAppProvider implements UI.AppProvider.AppProvider {
|
|
192
192
|
static instance(opts: {
|
|
193
193
|
forceNew: boolean|null,
|
|
194
194
|
} = {forceNew: null}): AdvancedAppProvider {
|
|
@@ -200,7 +200,7 @@ export class AdvancedAppProvider implements Common.AppProvider.AppProvider {
|
|
|
200
200
|
return advancedAppProviderInstance;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
createApp():
|
|
203
|
+
createApp(): UI.App.App {
|
|
204
204
|
return AdvancedApp.instance();
|
|
205
205
|
}
|
|
206
206
|
}
|