chrome-devtools-frontend 1.0.1739869 → 1.0.1742811
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/rules/ui-and-widgets/ui-accessibility-and-semantic-html.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +44 -7
- package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +1 -1
- package/.agents/rules/ui-and-widgets/ui-view-output-and-callback-contracts.md +2 -2
- package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +1 -1
- package/.agents/skills/code-review/SKILL.md +23 -6
- package/.agents/skills/devtools-verification/SKILL.md +2 -1
- package/.agents/skills/migrate-chromium-test/SKILL.md +1 -0
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +27 -11
- package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +41 -23
- package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +12 -7
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +3 -0
- package/.agents/skills/ui-widgets/SKILL.md +22 -7
- package/.agents/skills/version-control/SKILL.md +10 -1
- package/.agents/skills/visual-regression-audit/SKILL.md +88 -0
- package/.gitallowed +2 -1
- package/.stylelintignore +1 -0
- package/.stylelintrc.json +2 -0
- package/AUTHORS +1 -0
- package/DIR_METADATA +2 -1
- package/PRESUBMIT_test.py +143 -0
- package/config/owner/INFRA_OWNERS +0 -1
- package/docs/contributing/infrastructure.md +2 -2
- package/docs/ui_engineering.md +14 -4
- package/eslint.config.mjs +1 -18
- package/front_end/application_tokens.css +0 -35
- package/front_end/core/host/AidaClient.ts +1 -1
- package/front_end/core/host/AidaClientTypes.ts +2 -0
- package/front_end/core/host/AidaErrors.ts +3 -3
- package/front_end/core/host/AidaGcaTranslation.ts +39 -0
- package/front_end/core/host/GcaClient.ts +32 -20
- package/front_end/core/host/GcaTypes.ts +4 -2
- package/front_end/core/host/InspectorFrontendHostAPI.ts +2 -0
- package/front_end/core/i18n/DevToolsLocale.ts +0 -1
- package/front_end/core/sdk/DebuggerModel.ts +25 -13
- package/front_end/core/sdk/PreloadingModel.ts +2 -2
- package/front_end/core/sdk/RehydratingConnection.ts +59 -30
- package/front_end/core/sdk/StorageKeyManager.ts +0 -1
- package/front_end/core/sdk/Target.ts +6 -0
- package/front_end/core/sdk/TargetManager.ts +10 -4
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +12 -2
- package/front_end/entrypoints/inspector_main/OutermostTargetSelector.ts +159 -52
- package/front_end/entrypoints/inspector_main/outermostTargetSelector.css +77 -25
- package/front_end/entrypoints/main/MainImpl.ts +32 -15
- package/front_end/models/ai_assistance/AiAgent2.ts +95 -46
- package/front_end/models/ai_assistance/AiConversation.ts +1 -1
- package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -2
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +3 -2
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/data_formatters/FileFormatter.ts +1 -1
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +5 -4
- package/front_end/models/ai_assistance/performance/AICallTree.ts +7 -9
- package/front_end/models/ai_assistance/performance/AIQueries.ts +4 -8
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +11 -1
- package/front_end/models/ai_assistance/skills/lighthouse.md +1 -0
- package/front_end/models/ai_assistance/skills/network.md +3 -4
- package/front_end/models/ai_assistance/skills/sources.md +1 -2
- package/front_end/models/ai_assistance/skills/styling.md +3 -4
- package/front_end/models/ai_assistance/tools/ExecuteJavaScript.ts +11 -3
- package/front_end/models/ai_assistance/tools/ListNetworkRequests.ts +84 -23
- package/front_end/models/ai_assistance/tools/ListSources.ts +41 -13
- package/front_end/models/badges/Badge.ts +0 -1
- package/front_end/models/bindings/ResourceMapping.ts +1 -1
- package/front_end/models/bindings/ResourceScriptMapping.ts +1 -1
- package/front_end/models/breakpoints/BreakpointManager.ts +2 -4
- package/front_end/models/breakpoints/RecurringPauseDetector.ts +140 -0
- package/front_end/models/breakpoints/breakpoints.ts +2 -1
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +2 -2
- package/front_end/models/persistence/Automapping.ts +0 -1
- package/front_end/models/trace/Processor.ts +16 -7
- package/front_end/models/trace/README.md +17 -1
- package/front_end/models/trace/extras/ThirdParties.ts +4 -6
- package/front_end/models/trace/extras/TraceTree.ts +69 -72
- package/front_end/models/trace/handlers/MetaHandler.ts +3 -0
- package/front_end/models/trace/handlers/types.ts +15 -0
- package/front_end/models/trace/helpers/Trace.ts +5 -3
- package/front_end/models/trace/lantern/simulation/Simulator.ts +4 -1
- package/front_end/models/web_mcp/WebMCPModel.ts +19 -9
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +30 -3
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +2 -4
- package/front_end/panels/ai_assistance/components/chatMessage.css +1 -22
- package/front_end/panels/ai_assistance/components/exploreWidget.css +1 -19
- package/front_end/panels/ai_assistance/components/optInChangeDialog.css +1 -1
- package/front_end/panels/ai_assistance/components/walkthroughView.css +0 -13
- package/front_end/panels/animation/AnimationGroupPreviewUI.ts +3 -2
- package/front_end/panels/animation/AnimationTimeline.ts +5 -3
- package/front_end/panels/animation/animationTimeline.css +10 -8
- package/front_end/panels/application/ApplicationPanelSidebar.ts +14 -11
- package/front_end/panels/application/ReportingApiView.ts +0 -1
- package/front_end/panels/application/SubAppsView.ts +0 -1
- package/front_end/panels/application/WebMCPTreeElement.ts +3 -6
- package/front_end/panels/application/WebMCPView.ts +30 -0
- package/front_end/panels/application/components/ReportsGrid.ts +0 -1
- package/front_end/panels/application/components/backForwardCacheView.css +0 -7
- package/front_end/panels/application/components/permissionsPolicySection.css +2 -2
- package/front_end/panels/application/components/protocolHandlersView.css +46 -39
- package/front_end/panels/application/components/trustTokensView.css +0 -4
- package/front_end/panels/application/cookieItemsView.css +0 -7
- package/front_end/panels/application/indexedDBViews.css +0 -6
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +0 -2
- package/front_end/panels/application/preloading/components/PreloadingString.ts +0 -1
- package/front_end/panels/application/preloading/components/UsedPreloadingView.ts +4 -5
- package/front_end/panels/application/preloading/components/preloadingGrid.css +0 -9
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +2 -9
- package/front_end/panels/application/serviceWorkersView.css +5 -4
- package/front_end/panels/application/storageView.css +0 -5
- package/front_end/panels/application/webMCPView.css +17 -0
- package/front_end/panels/browser_debugger/ObjectEventListenersSidebarPane.ts +15 -20
- package/front_end/panels/changes/changesView.css +0 -5
- package/front_end/panels/common/ExtensionServer.ts +80 -10
- package/front_end/panels/console/ConsolePanel.ts +92 -18
- package/front_end/panels/console/consoleContextSelector.css +1 -8
- package/front_end/panels/console/consoleInsightTeaser.css +10 -17
- package/front_end/panels/console/consolePinPane.css +3 -1
- package/front_end/panels/console/consoleView.css +13 -17
- package/front_end/panels/coverage/coverageListView.css +0 -4
- package/front_end/panels/css_overview/cssOverviewCompletedView.css +0 -22
- package/front_end/panels/css_overview/cssOverviewStartView.css +0 -43
- package/front_end/panels/developer_resources/developerResourcesListView.css +0 -4
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +52 -45
- package/front_end/panels/elements/LayoutPane.ts +1 -3
- package/front_end/panels/elements/PropertiesWidget.ts +26 -8
- package/front_end/panels/elements/PropertyRenderer.ts +45 -21
- package/front_end/panels/elements/StandaloneStylesContainer.ts +6 -7
- package/front_end/panels/elements/StyleEditorWidget.ts +110 -63
- package/front_end/panels/elements/StylePropertiesSection.ts +14 -5
- package/front_end/panels/elements/StylePropertyTreeElement.ts +529 -518
- package/front_end/panels/elements/StylesContainer.ts +5 -6
- package/front_end/panels/elements/StylesSidebarPane.ts +12 -15
- package/front_end/panels/elements/components/CSSVariableValueView.ts +17 -4
- package/front_end/panels/elements/components/StylePropertyEditor.ts +178 -140
- package/front_end/panels/elements/components/cssQuery.css +1 -1
- package/front_end/panels/elements/components/stylePropertyEditor.css +60 -56
- package/front_end/panels/elements/layoutPane.css +2 -2
- package/front_end/panels/elements/metricsSidebarPane.css +6 -7
- package/front_end/panels/elements/platformFontsWidget.css +1 -1
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +1 -6
- package/front_end/panels/elements/stylesSidebarPane.css +3 -4
- package/front_end/panels/emulation/deviceModeView.css +1 -1
- package/front_end/panels/event_listeners/EventListenersView.ts +9 -2
- package/front_end/panels/event_listeners/eventListenersView.css +1 -1
- package/front_end/panels/explain/components/consoleInsight.css +1 -2
- package/front_end/panels/issues/issuesTree.css +6 -43
- package/front_end/panels/layer_viewer/PaintProfilerView.ts +1 -1
- package/front_end/panels/layer_viewer/paintProfiler.css +4 -3
- package/front_end/panels/lighthouse/LighthouseReportSelector.ts +1 -6
- package/front_end/panels/lighthouse/lighthouseStartView.css +5 -16
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +0 -1
- package/front_end/panels/linear_memory_inspector/components/linearMemoryHighlightChipList.css +2 -2
- package/front_end/panels/linear_memory_inspector/components/linearMemoryViewer.css +2 -2
- package/front_end/panels/linear_memory_inspector/components/valueInterpreterSettings.css +1 -1
- package/front_end/panels/media/playerListView.css +1 -2
- package/front_end/panels/media/playerPropertiesView.css +1 -1
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +2 -2
- package/front_end/panels/network/NetworkLogView.ts +594 -580
- package/front_end/panels/network/RequestCookiesView.ts +0 -1
- package/front_end/panels/network/networkConfigView.css +1 -2
- package/front_end/panels/network/networkLogView.css +363 -364
- package/front_end/panels/network/networkPanel.css +1 -5
- package/front_end/panels/network/networkTimingTable.css +1 -1
- package/front_end/panels/network/networkWaterfallColumn.css +1 -1
- package/front_end/panels/network/requestConditionsDrawer.css +0 -4
- package/front_end/panels/network/requestCookiesView.css +7 -1
- package/front_end/panels/network/requestPayloadTree.css +0 -4
- package/front_end/panels/profiler/HeapProfileView.ts +1 -3
- package/front_end/panels/profiler/HeapSnapshotView.ts +0 -7
- package/front_end/panels/recorder/RecorderPanel.ts +1 -1
- package/front_end/panels/recorder/RecordingView.ts +10 -10
- package/front_end/panels/recorder/StepView.ts +5 -4
- package/front_end/panels/recorder/createRecordingView.css +1 -1
- package/front_end/panels/recorder/recorderPanel.css +0 -8
- package/front_end/panels/recorder/recordingListView.css +4 -4
- package/front_end/panels/recorder/recordingView.css +12 -20
- package/front_end/panels/recorder/stepEditor.css +4 -4
- package/front_end/panels/recorder/stepView.css +31 -9
- package/front_end/panels/recorder/timelineSection.css +4 -0
- package/front_end/panels/screencast/ScreencastApp.ts +0 -1
- package/front_end/panels/security/mainView.css +1 -1
- package/front_end/panels/security/originView.css +2 -2
- package/front_end/panels/sensors/SensorsView.ts +273 -346
- package/front_end/panels/settings/BackendLinkingSettingsTab.ts +0 -1
- package/front_end/panels/settings/backendLinkingSettingsTab.css +7 -7
- package/front_end/panels/settings/components/syncSection.css +0 -1
- package/front_end/panels/settings/workspaceSettingsTab.css +0 -5
- package/front_end/panels/sources/CSSPlugin.ts +177 -98
- package/front_end/panels/sources/DebuggerPausedMessage.ts +100 -27
- package/front_end/panels/sources/NavigatorView.ts +926 -946
- package/front_end/panels/sources/SourcesPanel.ts +9 -2
- package/front_end/panels/sources/breakpointsView.css +6 -29
- package/front_end/panels/sources/components/HeadersView.css +2 -2
- package/front_end/panels/sources/debuggerPausedMessage.css +7 -0
- package/front_end/panels/sources/navigatorTree.css +7 -2
- package/front_end/panels/sources/sourcesNavigator.css +0 -9
- package/front_end/panels/sources/watchExpressionsSidebarPane.css +0 -10
- package/front_end/panels/timeline/CompatibilityTracksAppender.ts +3 -0
- package/front_end/panels/timeline/LayoutShiftsTrackAppender.ts +0 -10
- package/front_end/panels/timeline/ModificationsManager.ts +0 -1
- package/front_end/panels/timeline/ThreadAppender.ts +2 -6
- package/front_end/panels/timeline/TimelinePanel.ts +2 -2
- package/front_end/panels/timeline/TimelineTreeView.ts +38 -41
- package/front_end/panels/timeline/TimelineUIUtils.ts +8 -10
- package/front_end/panels/timeline/components/LayoutShiftDetails.ts +0 -2
- package/front_end/panels/timeline/components/fieldSettingsDialog.css +1 -6
- package/front_end/panels/timeline/components/insights/baseInsightComponent.css +0 -12
- package/front_end/panels/timeline/components/interactionBreakdown.css +1 -2
- package/front_end/panels/timeline/components/layoutShiftDetails.css +2 -9
- package/front_end/panels/timeline/components/liveMetricsView.css +0 -16
- package/front_end/panels/timeline/components/metricCard.css +1 -5
- package/front_end/panels/timeline/components/networkRequestDetails.css +3 -4
- package/front_end/panels/timeline/components/networkRequestTooltip.css +6 -4
- package/front_end/panels/timeline/components/sidebarAnnotationsTab.css +1 -1
- package/front_end/panels/timeline/components/sidebarInsightsTab.css +1 -2
- package/front_end/panels/timeline/timelineDetailsView.css +1 -12
- package/front_end/panels/timeline/timelineFlamechartPopover.css +0 -4
- package/front_end/panels/timeline/timelineMiniMap.css +1 -4
- package/front_end/panels/timeline/timelinePanel.css +0 -4
- package/front_end/panels/timeline/timelineStatusDialog.css +1 -1
- package/front_end/panels/timeline/timelineTreeView.css +0 -12
- package/front_end/panels/timeline/utils/EntryNodes.ts +1 -1
- package/front_end/panels/webauthn/webauthnPane.css +1 -7
- package/front_end/panels/whats_new/ReleaseNoteText.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/adorners/adorner.css +1 -1
- package/front_end/ui/components/buttons/button.css +0 -28
- package/front_end/ui/components/buttons/textButton.css +1 -45
- package/front_end/ui/components/input/checkbox.css +3 -3
- package/front_end/ui/components/issue_counter/issueLinkIcon.css +2 -2
- package/front_end/ui/components/menus/Menu.ts +14 -0
- package/front_end/ui/components/menus/menu.css +2 -14
- package/front_end/ui/components/menus/menuItem.css +0 -4
- package/front_end/ui/components/request_link_icon/requestLinkIcon.css +2 -2
- package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
- package/front_end/ui/components/survey_link/surveyLink.css +3 -3
- package/front_end/ui/components/switch/switch.css +3 -2
- package/front_end/ui/components/text_editor/theme.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +3 -3
- package/front_end/ui/components/tree_outline/treeOutline.css +0 -23
- package/front_end/ui/legacy/ContextMenu.ts +5 -5
- package/front_end/ui/legacy/SoftContextMenu.ts +24 -8
- package/front_end/ui/legacy/Toolbar.ts +1 -1
- package/front_end/ui/legacy/Treeoutline.ts +31 -78
- package/front_end/ui/legacy/UIUtils.ts +9 -17
- package/front_end/ui/legacy/checkboxTextLabel.css +2 -44
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +39 -27
- package/front_end/ui/legacy/components/color_picker/spectrum.css +2 -10
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +2 -6
- package/front_end/ui/legacy/components/inline_editor/BezierEditor.ts +34 -26
- package/front_end/ui/legacy/components/inline_editor/SwatchPopoverHelper.ts +1 -0
- package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/swatchPopover.css +1 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +49 -1
- package/front_end/ui/legacy/components/object_ui/objectPopover.css +0 -4
- package/front_end/ui/legacy/components/perf_ui/chartViewport.css +1 -9
- package/front_end/ui/legacy/components/perf_ui/filmStripView.css +1 -1
- package/front_end/ui/legacy/components/perf_ui/overviewGrid.css +2 -1
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +0 -5
- package/front_end/ui/legacy/components/settings_ui/SettingsUI.ts +6 -3
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +95 -1
- package/front_end/ui/legacy/filter.css +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +6 -28
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +1 -1
- package/front_end/ui/legacy/listWidget.css +1 -1
- package/front_end/ui/legacy/progressIndicator.css +1 -1
- package/front_end/ui/legacy/tabbedPane.css +6 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/front_end/ui/visual_logging/LoggingDriver.ts +4 -0
- package/front_end/ui/visual_logging/visual_logging.ts +1 -1
- package/inspector_overlay/common.ts +0 -3
- package/inspector_overlay/main.ts +1 -3
- package/inspector_overlay/tool_source_order.css +0 -4
- package/package.json +1 -1
- package/front_end/generated/SupportedCSSProperties.ts +0 -9705
|
@@ -11,7 +11,7 @@ import type * as Components from '../../ui/legacy/components/utils/utils.js';
|
|
|
11
11
|
|
|
12
12
|
import type * as ElementsComponents from './components/components.js';
|
|
13
13
|
import type {StylePropertiesSection} from './StylePropertiesSection.js';
|
|
14
|
-
import type {
|
|
14
|
+
import type {StylePropertyData} from './StylePropertyTreeElement.js';
|
|
15
15
|
import type {WebCustomData} from './WebCustomData.js';
|
|
16
16
|
|
|
17
17
|
export interface StylesContainer {
|
|
@@ -27,8 +27,7 @@ export interface StylesContainer {
|
|
|
27
27
|
node(): SDK.DOMModel.DOMNode|null;
|
|
28
28
|
cssModel(): SDK.CSSModel.CSSModel|null;
|
|
29
29
|
computedStyleModel(): ComputedStyle.ComputedStyleModel.ComputedStyleModel;
|
|
30
|
-
refreshUpdate(editedSection: StylePropertiesSection,
|
|
31
|
-
force?: boolean): void;
|
|
30
|
+
refreshUpdate(editedSection: StylePropertiesSection, editedProperty?: StylePropertyData, force?: boolean): void;
|
|
32
31
|
filterRegex(): RegExp|null;
|
|
33
32
|
setEditingStyle(editing: boolean): void;
|
|
34
33
|
setUserOperation(userOperation: boolean): void;
|
|
@@ -38,8 +37,8 @@ export interface StylesContainer {
|
|
|
38
37
|
|
|
39
38
|
getRegisteredPropertyDetails(matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles, variableName: string):
|
|
40
39
|
ElementsComponents.CSSVariableValueView.RegisteredPropertyDetails|undefined;
|
|
41
|
-
getVariableParserError(matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
42
|
-
|
|
40
|
+
getVariableParserError(matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
41
|
+
variableName: string): ElementsComponents.CSSVariableValueView.RegisteredPropertyDetails|null;
|
|
43
42
|
jumpToFunctionDefinition(functionName: string, treeScopeDistance: number): void;
|
|
44
43
|
continueEditingElement(sectionIndex: number, propertyIndex: number): void;
|
|
45
44
|
revealProperty(cssProperty: SDK.CSSProperty.CSSProperty): void;
|
|
@@ -57,7 +56,7 @@ export interface StylesContainer {
|
|
|
57
56
|
jumpToFontPaletteDefinition(paletteName: string): void;
|
|
58
57
|
jumpToCounterStyleDefinition(counterStyleName: string): void;
|
|
59
58
|
jumpToDeclaration(valueSource: SDK.CSSMatchedStyles.CSSValueSource): void;
|
|
60
|
-
setActiveProperty(
|
|
59
|
+
setActiveProperty(propertyData: StylePropertyData|null): void;
|
|
61
60
|
addStyleUpdateListener(listener: () => void): void;
|
|
62
61
|
removeStyleUpdateListener(listener: () => void): void;
|
|
63
62
|
trackForLazyRendering(element: Element, callback: () => void): void;
|
|
@@ -77,7 +77,7 @@ import {
|
|
|
77
77
|
StylePropertiesSection,
|
|
78
78
|
} from './StylePropertiesSection.js';
|
|
79
79
|
import {StylePropertyHighlighter} from './StylePropertyHighlighter.js';
|
|
80
|
-
import type {StylePropertyTreeElement} from './StylePropertyTreeElement.js';
|
|
80
|
+
import type {StylePropertyData, StylePropertyTreeElement} from './StylePropertyTreeElement.js';
|
|
81
81
|
import * as StylesAiCodeCompletionProvider from './StylesAiCodeCompletionProvider.js';
|
|
82
82
|
import type {StylesContainer} from './StylesContainer.js';
|
|
83
83
|
import stylesSidebarPaneStyles from './stylesSidebarPane.css.js';
|
|
@@ -612,14 +612,13 @@ export class StylesSidebarPane extends StylesSidebarPaneBase implements StylesCo
|
|
|
612
612
|
}, FILTER_IDLE_PERIOD);
|
|
613
613
|
}
|
|
614
614
|
|
|
615
|
-
refreshUpdate(editedSection: StylePropertiesSection,
|
|
616
|
-
|
|
617
|
-
if (editedTreeElement) {
|
|
615
|
+
refreshUpdate(editedSection: StylePropertiesSection, editedProperty?: StylePropertyData, force = false): void {
|
|
616
|
+
if (editedProperty) {
|
|
618
617
|
for (const section of this.allSections()) {
|
|
619
618
|
if (section instanceof BlankStylePropertiesSection && section.isBlank) {
|
|
620
619
|
continue;
|
|
621
620
|
}
|
|
622
|
-
section.updateVarFunctions(
|
|
621
|
+
section.updateVarFunctions(editedProperty);
|
|
623
622
|
}
|
|
624
623
|
}
|
|
625
624
|
|
|
@@ -722,11 +721,8 @@ export class StylesSidebarPane extends StylesSidebarPaneBase implements StylesCo
|
|
|
722
721
|
}
|
|
723
722
|
|
|
724
723
|
getVariableParserError(matchedStyles: SDK.CSSMatchedStyles.CSSMatchedStyles,
|
|
725
|
-
variableName: string): ElementsComponents.CSSVariableValueView.
|
|
726
|
-
|
|
727
|
-
return registrationDetails ?
|
|
728
|
-
new ElementsComponents.CSSVariableValueView.CSSVariableParserError(registrationDetails) :
|
|
729
|
-
null;
|
|
724
|
+
variableName: string): ElementsComponents.CSSVariableValueView.RegisteredPropertyDetails|null {
|
|
725
|
+
return this.getRegisteredPropertyDetails(matchedStyles, variableName) ?? null;
|
|
730
726
|
}
|
|
731
727
|
|
|
732
728
|
private async fetchComputedStylesFor(nodeId: Protocol.DOM.NodeId|undefined): Promise<Map<string, string>|null> {
|
|
@@ -796,7 +792,7 @@ export class StylesSidebarPane extends StylesSidebarPaneBase implements StylesCo
|
|
|
796
792
|
}
|
|
797
793
|
}
|
|
798
794
|
|
|
799
|
-
setActiveProperty(
|
|
795
|
+
setActiveProperty(propertyData: StylePropertyData|null): void {
|
|
800
796
|
if (this.isEditingStyle) {
|
|
801
797
|
return;
|
|
802
798
|
}
|
|
@@ -810,14 +806,14 @@ export class StylesSidebarPane extends StylesSidebarPaneBase implements StylesCo
|
|
|
810
806
|
return;
|
|
811
807
|
}
|
|
812
808
|
|
|
813
|
-
if (!
|
|
809
|
+
if (!propertyData || propertyData.overloaded() || propertyData.inherited()) {
|
|
814
810
|
return;
|
|
815
811
|
}
|
|
816
812
|
|
|
817
|
-
const rule =
|
|
813
|
+
const rule = propertyData.property.ownerStyle.parentRule;
|
|
818
814
|
const selectorList = (rule instanceof SDK.CSSRule.CSSStyleRule) ? rule.selectorText() : undefined;
|
|
819
815
|
for (const {properties, mode} of HIGHLIGHTABLE_PROPERTIES) {
|
|
820
|
-
if (!properties.includes(
|
|
816
|
+
if (!properties.includes(propertyData.property.name)) {
|
|
821
817
|
continue;
|
|
822
818
|
}
|
|
823
819
|
node.domModel().overlayModel().highlightInOverlay({node, selectorList}, mode);
|
|
@@ -825,7 +821,8 @@ export class StylesSidebarPane extends StylesSidebarPaneBase implements StylesCo
|
|
|
825
821
|
return;
|
|
826
822
|
}
|
|
827
823
|
|
|
828
|
-
|
|
824
|
+
const value = propertyData.property.value;
|
|
825
|
+
if (value.includes('anchor(') || value.includes('anchor-size(')) {
|
|
829
826
|
node.domModel().overlayModel().highlightInOverlay({node, selectorList}, 'anchor-positioning');
|
|
830
827
|
this.isActivePropertyHighlighted = true;
|
|
831
828
|
}
|
|
@@ -65,13 +65,23 @@ export const DEFAULT_PARSER_ERROR_VIEW: ParserErrorView = (input, _output, targe
|
|
|
65
65
|
|
|
66
66
|
export class CSSVariableParserError extends UI.Widget.Widget {
|
|
67
67
|
#view: ParserErrorView;
|
|
68
|
-
|
|
68
|
+
#details?: RegisteredPropertyDetails;
|
|
69
69
|
|
|
70
|
-
constructor(
|
|
71
|
-
super();
|
|
70
|
+
constructor(element?: HTMLElement, view: ParserErrorView = DEFAULT_PARSER_ERROR_VIEW) {
|
|
71
|
+
super(element);
|
|
72
72
|
this.#view = view;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
get details(): RegisteredPropertyDetails|undefined {
|
|
76
|
+
return this.#details;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
set details(details: RegisteredPropertyDetails|undefined) {
|
|
80
|
+
if (this.#details === details) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
73
83
|
this.#details = details;
|
|
74
|
-
this.
|
|
84
|
+
this.requestUpdate();
|
|
75
85
|
}
|
|
76
86
|
|
|
77
87
|
override wasShown(): void {
|
|
@@ -80,6 +90,9 @@ export class CSSVariableParserError extends UI.Widget.Widget {
|
|
|
80
90
|
}
|
|
81
91
|
|
|
82
92
|
override performUpdate(): void {
|
|
93
|
+
if (!this.#details) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
83
96
|
this.#view({details: this.#details}, undefined, this.contentElement);
|
|
84
97
|
}
|
|
85
98
|
}
|
|
@@ -1,14 +1,12 @@
|
|
|
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-lit-render-outside-of-view */
|
|
5
4
|
|
|
6
5
|
import '../../../ui/kit/kit.js';
|
|
7
|
-
import '../../../ui/legacy/legacy.js';
|
|
8
6
|
|
|
9
7
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
10
|
-
import * as
|
|
11
|
-
import
|
|
8
|
+
import * as UI from '../../../ui/legacy/legacy.js';
|
|
9
|
+
import {Directives, html, type LitTemplate, render} from '../../../ui/lit/lit.js';
|
|
12
10
|
import * as VisualLogging from '../../../ui/visual_logging/visual_logging.js';
|
|
13
11
|
|
|
14
12
|
import {findFlexContainerIcon, findGridContainerIcon, type IconInfo} from './CSSPropertyIconResolver.js';
|
|
@@ -35,7 +33,7 @@ const UIStrings = {
|
|
|
35
33
|
const str_ = i18n.i18n.registerUIStrings('panels/elements/components/StylePropertyEditor.ts', UIStrings);
|
|
36
34
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
37
35
|
|
|
38
|
-
const {
|
|
36
|
+
const {classMap} = Directives;
|
|
39
37
|
|
|
40
38
|
declare global {
|
|
41
39
|
interface HTMLElementEventMap {
|
|
@@ -44,12 +42,7 @@ declare global {
|
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
interface
|
|
48
|
-
authoredProperties: Map<string, string>;
|
|
49
|
-
computedProperties: Map<string, string>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
interface EditableProperty {
|
|
45
|
+
export interface EditableProperty {
|
|
53
46
|
propertyName: string;
|
|
54
47
|
propertyValues: string[];
|
|
55
48
|
}
|
|
@@ -74,89 +67,174 @@ export class PropertyDeselectedEvent extends Event {
|
|
|
74
67
|
}
|
|
75
68
|
}
|
|
76
69
|
|
|
77
|
-
export
|
|
78
|
-
|
|
70
|
+
export interface ViewInput {
|
|
71
|
+
authoredProperties: Map<string, string>;
|
|
72
|
+
computedProperties: Map<string, string>;
|
|
73
|
+
editableProperties: EditableProperty[];
|
|
74
|
+
containerClass?: string;
|
|
75
|
+
findIcon: (query: string) => IconInfo | null;
|
|
76
|
+
onButtonClick: (propertyName: string, propertyValue: string, selected: boolean) => void;
|
|
77
|
+
onDenseCheckboxChange: (checked: boolean, isRow: boolean, isColumn: boolean) => void;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type View = (input: ViewInput, output: undefined, target: HTMLElement) => void;
|
|
81
|
+
|
|
82
|
+
function renderButton(
|
|
83
|
+
input: ViewInput,
|
|
84
|
+
propertyValue: string,
|
|
85
|
+
propertyName: string,
|
|
86
|
+
selected = false,
|
|
87
|
+
): LitTemplate {
|
|
88
|
+
const query = `${propertyName}: ${propertyValue}`;
|
|
89
|
+
const iconInfo = input.findIcon(query);
|
|
90
|
+
if (!iconInfo) {
|
|
91
|
+
throw new Error(`Icon for ${query} is not found`);
|
|
92
|
+
}
|
|
93
|
+
const transform = `transform: rotate(${iconInfo.rotate}deg) scale(${iconInfo.scaleX}, ${iconInfo.scaleY})`;
|
|
94
|
+
const classes = classMap({
|
|
95
|
+
button: true,
|
|
96
|
+
selected,
|
|
97
|
+
});
|
|
98
|
+
const values = {propertyName, propertyValue};
|
|
99
|
+
const title = selected ? i18nString(UIStrings.deselectButton, values) : i18nString(UIStrings.selectButton, values);
|
|
100
|
+
return html`
|
|
101
|
+
<button title=${title}
|
|
102
|
+
class=${classes}
|
|
103
|
+
jslog=${VisualLogging.item().track({click: true, resize: true}).context(`${propertyName}-${propertyValue}`)}
|
|
104
|
+
@click=${() => input.onButtonClick(propertyName, propertyValue, selected)}>
|
|
105
|
+
<devtools-icon style=${transform} name=${iconInfo.iconName}>
|
|
106
|
+
</devtools-icon>
|
|
107
|
+
</button>
|
|
108
|
+
`;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function renderGridAutoFlowProperty(
|
|
112
|
+
input: ViewInput,
|
|
113
|
+
prop: EditableProperty,
|
|
114
|
+
shownValue: string|undefined,
|
|
115
|
+
classes: ReturnType<typeof classMap>,
|
|
116
|
+
): LitTemplate {
|
|
117
|
+
const authoredValue = input.authoredProperties.get(prop.propertyName);
|
|
118
|
+
|
|
119
|
+
const isDense = authoredValue === 'dense' || authoredValue === 'row dense' || authoredValue === 'column dense';
|
|
120
|
+
const isRow = authoredValue === 'row' || authoredValue === 'row dense';
|
|
121
|
+
const isColumn = authoredValue === 'column' || authoredValue === 'column dense';
|
|
122
|
+
|
|
123
|
+
return html`<div class="row">
|
|
124
|
+
<div class="property">
|
|
125
|
+
<span class="property-name">${prop.propertyName}</span>: <span class=${classes}>${shownValue}</span>
|
|
126
|
+
</div>
|
|
127
|
+
<div class="buttons">
|
|
128
|
+
${renderButton(input, 'row', prop.propertyName, isRow)}
|
|
129
|
+
${renderButton(input, 'column', prop.propertyName, isColumn)}
|
|
130
|
+
<devtools-checkbox
|
|
131
|
+
.checked=${isDense}
|
|
132
|
+
@change=${
|
|
133
|
+
(e: Event) => input.onDenseCheckboxChange((e.target as UI.UIUtils.CheckboxLabel).checked, isRow, isColumn)}
|
|
134
|
+
>
|
|
135
|
+
${i18nString(UIStrings.denseLabel)}
|
|
136
|
+
</devtools-checkbox>
|
|
137
|
+
</div>
|
|
138
|
+
</div>`;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function renderProperty(input: ViewInput, prop: EditableProperty): LitTemplate {
|
|
142
|
+
const authoredValue = input.authoredProperties.get(prop.propertyName);
|
|
143
|
+
const notAuthored = !authoredValue;
|
|
144
|
+
const shownValue = authoredValue || input.computedProperties.get(prop.propertyName);
|
|
145
|
+
const classes = classMap({
|
|
146
|
+
'property-value': true,
|
|
147
|
+
'not-authored': notAuthored,
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
// Special handling for grid-auto-flow with dense checkbox
|
|
151
|
+
if (prop.propertyName === 'grid-auto-flow') {
|
|
152
|
+
return renderGridAutoFlowProperty(input, prop, shownValue, classes);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return html`<div class="row">
|
|
156
|
+
<div class="property">
|
|
157
|
+
<span class="property-name">${prop.propertyName}</span>: <span class=${classes}>${shownValue}</span>
|
|
158
|
+
</div>
|
|
159
|
+
<div class="buttons">
|
|
160
|
+
${prop.propertyValues.map(value => renderButton(input, value, prop.propertyName, value === authoredValue))}
|
|
161
|
+
</div>
|
|
162
|
+
</div>`;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export const DEFAULT_VIEW: View = (input: ViewInput, _output: undefined, target: HTMLElement): void => {
|
|
166
|
+
// clang-format off
|
|
167
|
+
render(html`
|
|
168
|
+
<style>${stylePropertyEditorStyles}</style>
|
|
169
|
+
<div class="container">
|
|
170
|
+
${input.editableProperties.map(prop => renderProperty(input, prop))}
|
|
171
|
+
</div>
|
|
172
|
+
`, target, {container: {classes: input.containerClass ? [input.containerClass] : []}});
|
|
173
|
+
// clang-format on
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export class StylePropertyEditor extends UI.Widget.VBox {
|
|
177
|
+
static get editableProperties(): EditableProperty[] {
|
|
178
|
+
return [];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
protected readonly containerClass: string = '';
|
|
182
|
+
readonly #view: View;
|
|
79
183
|
#authoredProperties = new Map<string, string>();
|
|
80
184
|
#computedProperties = new Map<string, string>();
|
|
81
|
-
|
|
185
|
+
|
|
186
|
+
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
187
|
+
super(element);
|
|
188
|
+
this.#view = view;
|
|
189
|
+
}
|
|
82
190
|
|
|
83
191
|
getEditableProperties(): EditableProperty[] {
|
|
84
|
-
return this.editableProperties;
|
|
192
|
+
return (this.constructor as typeof StylePropertyEditor).editableProperties;
|
|
85
193
|
}
|
|
86
194
|
|
|
87
|
-
|
|
88
|
-
this.#authoredProperties
|
|
89
|
-
this.#computedProperties = data.computedProperties;
|
|
90
|
-
this.#render();
|
|
195
|
+
get authoredProperties(): Map<string, string> {
|
|
196
|
+
return this.#authoredProperties;
|
|
91
197
|
}
|
|
92
198
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<div class="container">
|
|
100
|
-
${this.editableProperties.map(prop => this.#renderProperty(prop))}
|
|
101
|
-
</div>
|
|
102
|
-
`, this.#shadow, {
|
|
103
|
-
host: this,
|
|
104
|
-
});
|
|
105
|
-
// clang-format on
|
|
199
|
+
set authoredProperties(authoredProperties: Map<string, string>) {
|
|
200
|
+
if (this.#authoredProperties === authoredProperties) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
this.#authoredProperties = authoredProperties;
|
|
204
|
+
this.requestUpdate();
|
|
106
205
|
}
|
|
107
206
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
// Special handling for grid-auto-flow with dense checkbox
|
|
118
|
-
if (prop.propertyName === 'grid-auto-flow') {
|
|
119
|
-
return this.#renderGridAutoFlowProperty(prop, shownValue, classes);
|
|
207
|
+
get computedProperties(): Map<string, string> {
|
|
208
|
+
return this.#computedProperties;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
set computedProperties(computedProperties: Map<string, string>) {
|
|
212
|
+
if (this.#computedProperties === computedProperties) {
|
|
213
|
+
return;
|
|
120
214
|
}
|
|
215
|
+
this.#computedProperties = computedProperties;
|
|
216
|
+
this.requestUpdate();
|
|
217
|
+
}
|
|
121
218
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
</div>
|
|
126
|
-
<div class="buttons">
|
|
127
|
-
${prop.propertyValues.map(value => this.#renderButton(value, prop.propertyName, value === authoredValue))}
|
|
128
|
-
</div>
|
|
129
|
-
</div>`;
|
|
219
|
+
override wasShown(): void {
|
|
220
|
+
super.wasShown();
|
|
221
|
+
this.requestUpdate();
|
|
130
222
|
}
|
|
131
223
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
<span class="property-name">${prop.propertyName}</span>: <span class=${classes}>${shownValue}</span>
|
|
144
|
-
</div>
|
|
145
|
-
<div class="buttons">
|
|
146
|
-
${this.#renderButton('row', prop.propertyName, isRow)}
|
|
147
|
-
${this.#renderButton('column', prop.propertyName, isColumn)}
|
|
148
|
-
<devtools-checkbox
|
|
149
|
-
.checked=${isDense}
|
|
150
|
-
@change=${(e: Event) => this.#onDenseCheckboxChange(e, isRow, isColumn)}
|
|
151
|
-
>
|
|
152
|
-
${i18nString(UIStrings.denseLabel)}
|
|
153
|
-
</devtools-checkbox>
|
|
154
|
-
</div>
|
|
155
|
-
</div>`;
|
|
224
|
+
override performUpdate(): void {
|
|
225
|
+
const viewInput: ViewInput = {
|
|
226
|
+
authoredProperties: this.#authoredProperties,
|
|
227
|
+
computedProperties: this.#computedProperties,
|
|
228
|
+
editableProperties: this.getEditableProperties(),
|
|
229
|
+
containerClass: this.containerClass,
|
|
230
|
+
findIcon: (query: string) => this.findIcon(query, this.#computedProperties),
|
|
231
|
+
onButtonClick: this.#onButtonClick.bind(this),
|
|
232
|
+
onDenseCheckboxChange: this.#onDenseCheckboxChange.bind(this),
|
|
233
|
+
};
|
|
234
|
+
this.#view(viewInput, undefined, this.contentElement);
|
|
156
235
|
}
|
|
157
236
|
|
|
158
|
-
#onDenseCheckboxChange(
|
|
159
|
-
const checked = (e.target as HTMLInputElement).checked;
|
|
237
|
+
#onDenseCheckboxChange(checked: boolean, isRow: boolean, isColumn: boolean): void {
|
|
160
238
|
const propertyName = 'grid-auto-flow';
|
|
161
239
|
const currentValue = this.#authoredProperties.get(propertyName);
|
|
162
240
|
|
|
@@ -170,37 +248,12 @@ export class StylePropertyEditor extends HTMLElement {
|
|
|
170
248
|
}
|
|
171
249
|
|
|
172
250
|
if (currentValue) {
|
|
173
|
-
this.dispatchEvent(new PropertyDeselectedEvent(propertyName, currentValue));
|
|
251
|
+
this.element.dispatchEvent(new PropertyDeselectedEvent(propertyName, currentValue));
|
|
174
252
|
}
|
|
175
253
|
|
|
176
254
|
if (newValue) {
|
|
177
|
-
this.dispatchEvent(new PropertySelectedEvent(propertyName, newValue));
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
#renderButton(propertyValue: string, propertyName: string, selected = false): Lit.TemplateResult {
|
|
182
|
-
const query = `${propertyName}: ${propertyValue}`;
|
|
183
|
-
const iconInfo = this.findIcon(query, this.#computedProperties);
|
|
184
|
-
if (!iconInfo) {
|
|
185
|
-
throw new Error(`Icon for ${query} is not found`);
|
|
255
|
+
this.element.dispatchEvent(new PropertySelectedEvent(propertyName, newValue));
|
|
186
256
|
}
|
|
187
|
-
const transform = `transform: rotate(${iconInfo.rotate}deg) scale(${iconInfo.scaleX}, ${iconInfo.scaleY})`;
|
|
188
|
-
const classes = Directives.classMap({
|
|
189
|
-
button: true,
|
|
190
|
-
selected,
|
|
191
|
-
});
|
|
192
|
-
const values = {propertyName, propertyValue};
|
|
193
|
-
const title = selected ? i18nString(UIStrings.deselectButton, values) : i18nString(UIStrings.selectButton, values);
|
|
194
|
-
return html`
|
|
195
|
-
<button title=${title}
|
|
196
|
-
class=${classes}
|
|
197
|
-
jslog=${
|
|
198
|
-
VisualLogging.item().track({click: true, resize: true}).context(`${propertyName}-${propertyValue}`)}
|
|
199
|
-
@click=${() => this.#onButtonClick(propertyName, propertyValue, selected)}>
|
|
200
|
-
<devtools-icon style=${transform} name=${iconInfo.iconName}>
|
|
201
|
-
</devtools-icon>
|
|
202
|
-
</button>
|
|
203
|
-
`;
|
|
204
257
|
}
|
|
205
258
|
|
|
206
259
|
#onButtonClick(propertyName: string, propertyValue: string, selected: boolean): void {
|
|
@@ -212,84 +265,69 @@ export class StylePropertyEditor extends HTMLElement {
|
|
|
212
265
|
const newValue = isDense ? 'dense' : '';
|
|
213
266
|
|
|
214
267
|
if (currentValue) {
|
|
215
|
-
this.dispatchEvent(new PropertyDeselectedEvent(propertyName, currentValue));
|
|
268
|
+
this.element.dispatchEvent(new PropertyDeselectedEvent(propertyName, currentValue));
|
|
216
269
|
}
|
|
217
270
|
|
|
218
271
|
if (newValue) {
|
|
219
|
-
this.dispatchEvent(new PropertySelectedEvent(propertyName, newValue));
|
|
272
|
+
this.element.dispatchEvent(new PropertySelectedEvent(propertyName, newValue));
|
|
220
273
|
}
|
|
221
274
|
} else {
|
|
222
275
|
const newValue = isDense ? `${propertyValue} dense` : propertyValue;
|
|
223
276
|
|
|
224
277
|
if (currentValue) {
|
|
225
|
-
this.dispatchEvent(new PropertyDeselectedEvent(propertyName, currentValue));
|
|
278
|
+
this.element.dispatchEvent(new PropertyDeselectedEvent(propertyName, currentValue));
|
|
226
279
|
}
|
|
227
280
|
|
|
228
|
-
this.dispatchEvent(new PropertySelectedEvent(propertyName, newValue));
|
|
281
|
+
this.element.dispatchEvent(new PropertySelectedEvent(propertyName, newValue));
|
|
229
282
|
}
|
|
230
283
|
} else if (selected) {
|
|
231
|
-
this.dispatchEvent(new PropertyDeselectedEvent(propertyName, propertyValue));
|
|
284
|
+
this.element.dispatchEvent(new PropertyDeselectedEvent(propertyName, propertyValue));
|
|
232
285
|
} else {
|
|
233
|
-
this.dispatchEvent(new PropertySelectedEvent(propertyName, propertyValue));
|
|
286
|
+
this.element.dispatchEvent(new PropertySelectedEvent(propertyName, propertyValue));
|
|
234
287
|
}
|
|
235
288
|
}
|
|
236
289
|
|
|
237
290
|
protected findIcon(_query: string, _computedProperties: Map<string, string>): IconInfo|null {
|
|
238
|
-
|
|
291
|
+
return null;
|
|
239
292
|
}
|
|
240
293
|
}
|
|
241
294
|
|
|
242
295
|
export class FlexboxEditor extends StylePropertyEditor {
|
|
243
|
-
|
|
244
|
-
|
|
296
|
+
static override get editableProperties(): EditableProperty[] {
|
|
297
|
+
return FlexboxEditableProperties;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
protected override readonly containerClass = 'flexbox-editor';
|
|
245
301
|
|
|
246
302
|
protected override findIcon(query: string, computedProperties: Map<string, string>): IconInfo|null {
|
|
247
303
|
return findFlexContainerIcon(query, computedProperties);
|
|
248
304
|
}
|
|
249
305
|
}
|
|
250
306
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
interface HTMLElementTagNameMap {
|
|
255
|
-
'devtools-flexbox-editor': FlexboxEditor;
|
|
307
|
+
export class GridEditor extends StylePropertyEditor {
|
|
308
|
+
static override get editableProperties(): EditableProperty[] {
|
|
309
|
+
return GridEditableProperties;
|
|
256
310
|
}
|
|
257
|
-
}
|
|
258
311
|
|
|
259
|
-
|
|
260
|
-
readonly jslogContext = 'cssGridEditor';
|
|
261
|
-
protected override readonly editableProperties: EditableProperty[] = GridEditableProperties;
|
|
312
|
+
protected override readonly containerClass = 'grid-editor';
|
|
262
313
|
|
|
263
314
|
protected override findIcon(query: string, computedProperties: Map<string, string>): IconInfo|null {
|
|
264
315
|
return findGridContainerIcon(query, computedProperties);
|
|
265
316
|
}
|
|
266
317
|
}
|
|
267
318
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
interface HTMLElementTagNameMap {
|
|
272
|
-
'devtools-grid-editor': GridEditor;
|
|
319
|
+
export class GridLanesEditor extends StylePropertyEditor {
|
|
320
|
+
static override get editableProperties(): EditableProperty[] {
|
|
321
|
+
return GridLanesEditableProperties;
|
|
273
322
|
}
|
|
274
|
-
}
|
|
275
323
|
|
|
276
|
-
|
|
277
|
-
readonly jslogContext = 'cssGridLanesEditor';
|
|
278
|
-
protected override readonly editableProperties: EditableProperty[] = GridLanesEditableProperties;
|
|
324
|
+
protected override readonly containerClass = 'grid-lanes-editor';
|
|
279
325
|
|
|
280
326
|
protected override findIcon(query: string, computedProperties: Map<string, string>): IconInfo|null {
|
|
281
327
|
return findGridContainerIcon(query, computedProperties);
|
|
282
328
|
}
|
|
283
329
|
}
|
|
284
330
|
|
|
285
|
-
customElements.define('devtools-grid-lanes-editor', GridLanesEditor);
|
|
286
|
-
|
|
287
|
-
declare global {
|
|
288
|
-
interface HTMLElementTagNameMap {
|
|
289
|
-
'devtools-grid-lanes-editor': GridLanesEditor;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
331
|
export const FlexboxEditableProperties: Array<{
|
|
294
332
|
propertyName: string,
|
|
295
333
|
propertyValues: string[],
|
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
cursor: var(--override-styles-section-text-hover-cursor);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
:host-context(.collapsed):host(
|
|
20
|
+
:host-context(.collapsed):host(.has-collapse-icon) .sidebar-pane-open-brace::after {
|
|
21
21
|
content: "}";
|
|
22
22
|
}
|