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
|
@@ -438,10 +438,10 @@ export class ToolbarItem<T = any, E extends HTMLElement = HTMLElement> extends C
|
|
|
438
438
|
}
|
|
439
439
|
|
|
440
440
|
setVisible(x: boolean): void {
|
|
441
|
+
this.element.classList.toggle('hidden', !x);
|
|
441
442
|
if (this.#visible === x) {
|
|
442
443
|
return;
|
|
443
444
|
}
|
|
444
|
-
this.element.classList.toggle('hidden', !x);
|
|
445
445
|
this.#visible = x;
|
|
446
446
|
if (this.toolbar && !(this instanceof ToolbarSeparator)) {
|
|
447
447
|
this.toolbar.hideSeparatorDupes();
|
|
@@ -1752,21 +1752,17 @@ class TreeViewTreeElement extends TreeElement {
|
|
|
1752
1752
|
}
|
|
1753
1753
|
}
|
|
1754
1754
|
|
|
1755
|
-
function getTreeNodes(nodeList: NodeList|Node[]):
|
|
1755
|
+
function getTreeNodes(nodeList: NodeList|Node[]): HTMLLIElement[] {
|
|
1756
1756
|
return nodeList.values()
|
|
1757
1757
|
.flatMap(node => {
|
|
1758
|
-
if (node instanceof TreeElementWrapper) {
|
|
1759
|
-
return [node];
|
|
1760
|
-
}
|
|
1761
1758
|
if (node instanceof HTMLLIElement && node.role === 'treeitem') {
|
|
1762
1759
|
return [
|
|
1763
1760
|
node,
|
|
1764
|
-
...node.querySelectorAll<HTMLLIElement
|
|
1765
|
-
'ul[role="group"] li[role="treeitem"],ul[role="group"] devtools-tree-wrapper'),
|
|
1761
|
+
...node.querySelectorAll<HTMLLIElement>('ul[role="group"] li[role="treeitem"]'),
|
|
1766
1762
|
];
|
|
1767
1763
|
}
|
|
1768
1764
|
if (node instanceof HTMLElement) {
|
|
1769
|
-
return node.querySelectorAll<HTMLLIElement
|
|
1765
|
+
return node.querySelectorAll<HTMLLIElement>('li[role="treeitem"]');
|
|
1770
1766
|
}
|
|
1771
1767
|
return [];
|
|
1772
1768
|
})
|
|
@@ -1895,15 +1891,11 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
1895
1891
|
}
|
|
1896
1892
|
});
|
|
1897
1893
|
this.#treeOutline.addEventListener(Events.ElementExpanded, event => {
|
|
1898
|
-
// TODO(crbug.com/1166669): This is a stopgap. We can remove the global event once devtools-tree-wrapper is no longer needed.
|
|
1899
|
-
this.dispatchEvent(new TreeViewElement.TreeElementExpandEvent(event.data, true));
|
|
1900
1894
|
if (event.data instanceof TreeViewTreeElement) {
|
|
1901
1895
|
event.data.listItemElement.dispatchEvent(new TreeViewElement.ExpandEvent({expanded: true}));
|
|
1902
1896
|
}
|
|
1903
1897
|
});
|
|
1904
1898
|
this.#treeOutline.addEventListener(Events.ElementCollapsed, event => {
|
|
1905
|
-
// TODO(crbug.com/1166669): This is a stopgap. We can remove the global event once devtools-tree-wrapper is no longer needed.
|
|
1906
|
-
this.dispatchEvent(new TreeViewElement.TreeElementExpandEvent(event.data, false));
|
|
1907
1899
|
if (event.data instanceof TreeViewTreeElement) {
|
|
1908
1900
|
event.data.listItemElement.dispatchEvent(new TreeViewElement.ExpandEvent({expanded: false}));
|
|
1909
1901
|
}
|
|
@@ -1943,7 +1935,7 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
1943
1935
|
}
|
|
1944
1936
|
}
|
|
1945
1937
|
|
|
1946
|
-
#getParentTreeElement(element: HTMLLIElement
|
|
1938
|
+
#getParentTreeElement(element: HTMLLIElement):
|
|
1947
1939
|
{treeElement: TreeElement, expanded: boolean, classes: DOMTokenList, attributes?: NamedNodeMap}|null {
|
|
1948
1940
|
const subtreeRoot = element.parentElement;
|
|
1949
1941
|
if (!(subtreeRoot instanceof HTMLUListElement)) {
|
|
@@ -2034,39 +2026,23 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
2034
2026
|
nextElement = nextTreeEl;
|
|
2035
2027
|
break;
|
|
2036
2028
|
}
|
|
2037
|
-
if (e instanceof TreeElementWrapper && e.treeElement && e.treeElement.parent === parent.treeElement) {
|
|
2038
|
-
nextElement = e.treeElement;
|
|
2039
|
-
break;
|
|
2040
|
-
}
|
|
2041
2029
|
}
|
|
2042
2030
|
const index = nextElement ? parent.treeElement.indexOfChild(nextElement) : parent.treeElement.children().length;
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
treeElement = node.treeElement;
|
|
2031
|
+
const treeElement = new TreeViewTreeElement(this.#treeOutline, node);
|
|
2032
|
+
const expandable = Boolean(node.querySelector(':scope > ul[role="group"]'));
|
|
2033
|
+
treeElement.setExpandable(expandable);
|
|
2034
|
+
treeElement.updateExpansionFromAttribute();
|
|
2035
|
+
parent.treeElement.insertChild(treeElement, index);
|
|
2036
|
+
if (parent.treeElement instanceof TreeViewTreeElement) {
|
|
2037
|
+
parent.treeElement.updateExpansionFromAttribute();
|
|
2051
2038
|
}
|
|
2052
|
-
if (
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
}
|
|
2060
|
-
if (hasBooleanAttribute(node, 'selected')) {
|
|
2061
|
-
treeElement.revealAndSelect(!this.hasFocus());
|
|
2062
|
-
}
|
|
2063
|
-
if (node instanceof HTMLLIElement) {
|
|
2064
|
-
// Resolve `clonedRef` on the config element to the rendered list item once it is in the tree.
|
|
2065
|
-
HTMLElementWithLightDOMTemplate.registerClone(node, treeElement.listItemElement);
|
|
2066
|
-
}
|
|
2067
|
-
if (parent.expanded) {
|
|
2068
|
-
parent.treeElement.expand();
|
|
2069
|
-
}
|
|
2039
|
+
if (hasBooleanAttribute(node, 'selected')) {
|
|
2040
|
+
treeElement.revealAndSelect(!this.hasFocus());
|
|
2041
|
+
}
|
|
2042
|
+
// Resolve `clonedRef` on the config element to the rendered list item once it is in the tree.
|
|
2043
|
+
HTMLElementWithLightDOMTemplate.registerClone(node, treeElement.listItemElement);
|
|
2044
|
+
if (parent.expanded) {
|
|
2045
|
+
parent.treeElement.expand();
|
|
2070
2046
|
}
|
|
2071
2047
|
}
|
|
2072
2048
|
for (const element of new Set(getStyleElements(nodes))) {
|
|
@@ -2075,16 +2051,22 @@ export class TreeViewElement extends HTMLElementWithLightDOMTemplate {
|
|
|
2075
2051
|
}
|
|
2076
2052
|
|
|
2077
2053
|
protected override removeNodes(nodes: NodeList|Node[]): void {
|
|
2054
|
+
// Remove unselected nodes first so TreeElement.removeChildAtIndex does not
|
|
2055
|
+
// transiently select a sibling or parent scheduled for removal (crbug.com/1409025).
|
|
2056
|
+
// When a subtree containing the selected item is removed, getTreeNodes flattens
|
|
2057
|
+
// both the ancestor <li role="treeitem">s and the selected item itself in pre-order.
|
|
2058
|
+
const nodesWithSelection: HTMLLIElement[] = [];
|
|
2078
2059
|
for (const node of getTreeNodes(nodes)) {
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
(node.treeElement.parent as TreeViewTreeElement)
|
|
2085
|
-
.configElement?.querySelector(':scope > ul[role="group"]')));
|
|
2060
|
+
const treeElement = TreeViewTreeElement.get(node);
|
|
2061
|
+
if (treeElement && this.#treeOutline.selectedTreeElement?.hasAncestorOrSelf(treeElement)) {
|
|
2062
|
+
nodesWithSelection.push(node);
|
|
2063
|
+
} else {
|
|
2064
|
+
treeElement?.removeFromTree();
|
|
2086
2065
|
}
|
|
2087
2066
|
}
|
|
2067
|
+
for (const node of nodesWithSelection) {
|
|
2068
|
+
TreeViewTreeElement.get(node)?.removeFromTree();
|
|
2069
|
+
}
|
|
2088
2070
|
}
|
|
2089
2071
|
|
|
2090
2072
|
set hideOverflow(hide: boolean) {
|
|
@@ -2155,14 +2137,6 @@ export namespace TreeViewElement {
|
|
|
2155
2137
|
}
|
|
2156
2138
|
}
|
|
2157
2139
|
|
|
2158
|
-
/**
|
|
2159
|
-
* @deprecated
|
|
2160
|
-
*/
|
|
2161
|
-
export class TreeElementExpandEvent extends CustomEvent<{treeElement: TreeElement, expanded: boolean}> {
|
|
2162
|
-
constructor(treeElement: TreeElement, expanded: boolean) {
|
|
2163
|
-
super('treeelementexpand', {detail: {treeElement, expanded}});
|
|
2164
|
-
}
|
|
2165
|
-
}
|
|
2166
2140
|
}
|
|
2167
2141
|
|
|
2168
2142
|
class IfExpandedDirective extends Lit.Directive.Directive {
|
|
@@ -2214,32 +2188,11 @@ export const ifExpanded:
|
|
|
2214
2188
|
(content: Lit.LitTemplate|Iterable<Lit.LitTemplate>|(() => Lit.LitTemplate | Iterable<Lit.LitTemplate>)) =>
|
|
2215
2189
|
Lit.DirectiveResult<typeof IfExpandedDirective> = Lit.Directive.directive(IfExpandedDirective);
|
|
2216
2190
|
|
|
2217
|
-
export class TreeElementWrapper extends HTMLElement {
|
|
2218
|
-
#treeElement?: TreeElement;
|
|
2219
|
-
set treeElement(treeElement: TreeElement) {
|
|
2220
|
-
if (this.#treeElement === treeElement) {
|
|
2221
|
-
return;
|
|
2222
|
-
}
|
|
2223
|
-
if (this.#treeElement?.parent) {
|
|
2224
|
-
const parent = this.#treeElement.parent;
|
|
2225
|
-
const index = parent.indexOfChild(this.#treeElement);
|
|
2226
|
-
parent.removeChildAtIndex(index);
|
|
2227
|
-
parent.insertChild(treeElement, index);
|
|
2228
|
-
}
|
|
2229
|
-
this.#treeElement = treeElement;
|
|
2230
|
-
}
|
|
2231
|
-
get treeElement(): TreeElement|undefined {
|
|
2232
|
-
return this.#treeElement;
|
|
2233
|
-
}
|
|
2234
|
-
}
|
|
2235
|
-
|
|
2236
2191
|
customElements.define('devtools-tree', TreeViewElement);
|
|
2237
|
-
customElements.define('devtools-tree-wrapper', TreeElementWrapper);
|
|
2238
2192
|
|
|
2239
2193
|
declare global {
|
|
2240
2194
|
interface HTMLElementTagNameMap {
|
|
2241
2195
|
'devtools-tree': TreeViewElement;
|
|
2242
|
-
'devtools-tree-wrapper': TreeElementWrapper;
|
|
2243
2196
|
}
|
|
2244
2197
|
}
|
|
2245
2198
|
|
|
@@ -72,6 +72,7 @@ declare global {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
const Directives: typeof Lit.Directives = Lit.Directives;
|
|
75
|
+
const html: typeof Lit.html = Lit.html;
|
|
75
76
|
const render: typeof Lit.render = Lit.render;
|
|
76
77
|
|
|
77
78
|
const UIStrings = {
|
|
@@ -1419,7 +1420,7 @@ export function bindInput(input: HTMLInputElement, apply: (arg0: string) => void
|
|
|
1419
1420
|
}
|
|
1420
1421
|
|
|
1421
1422
|
function onKeyDown(event: KeyboardEvent): void {
|
|
1422
|
-
if (event.key === 'Enter') {
|
|
1423
|
+
if (event.key === 'Enter' && !event.isComposing) {
|
|
1423
1424
|
const valid = validate(input.value);
|
|
1424
1425
|
if (valid) {
|
|
1425
1426
|
apply(input.value);
|
|
@@ -1867,26 +1868,17 @@ export class PromotionManager {
|
|
|
1867
1868
|
}
|
|
1868
1869
|
|
|
1869
1870
|
/**
|
|
1870
|
-
* Creates a `<div>` element with the localized text NEW
|
|
1871
|
+
* Creates a Lit template for a `<div>` element with the localized text NEW
|
|
1872
|
+
* when the promotion should be shown.
|
|
1871
1873
|
*
|
|
1872
|
-
* The element is automatically styled correctly, as long as the core styles (in
|
|
1873
|
-
* `inspectorCommon.css`
|
|
1874
|
-
*
|
|
1875
|
-
*
|
|
1876
|
-
* ```js
|
|
1877
|
-
* const jslog = VisualLogging.badge('new-badge');
|
|
1878
|
-
* html`<div class='new-badge' jsog=${jslog}>i18nString(UIStrings.new)</div>`
|
|
1879
|
-
*
|
|
1880
|
-
* @returns the newly created `HTMLDivElement` for the new badge.
|
|
1874
|
+
* The element is automatically styled correctly, as long as the core styles (in
|
|
1875
|
+
* particular `inspectorCommon.css`) are injected into the current document or
|
|
1876
|
+
* shadow root.
|
|
1881
1877
|
*/
|
|
1882
|
-
export function maybeCreateNewBadge(promotionId: string):
|
|
1878
|
+
export function maybeCreateNewBadge(promotionId: string): Lit.TemplateResult|undefined {
|
|
1883
1879
|
const promotionManager = PromotionManager.instance();
|
|
1884
1880
|
if (promotionManager.maybeShowPromotion(promotionId)) {
|
|
1885
|
-
|
|
1886
|
-
badge.className = 'new-badge';
|
|
1887
|
-
badge.textContent = i18nString(UIStrings.new);
|
|
1888
|
-
badge.setAttribute('jslog', `${VisualLogging.badge('new-badge')}`);
|
|
1889
|
-
return badge;
|
|
1881
|
+
return html`<div class="new-badge" jslog=${VisualLogging.badge('new-badge')}>${i18nString(UIStrings.new)}</div>`;
|
|
1890
1882
|
}
|
|
1891
1883
|
return undefined;
|
|
1892
1884
|
}
|
|
@@ -22,13 +22,12 @@ input {
|
|
|
22
22
|
color: var(--sys-color-on-primary);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
:host(:not(.small)) input:not(.small) {
|
|
25
|
+
:host(:not(.small, .inside-datagrid)) input:not(.small) {
|
|
26
26
|
margin: var(--sys-size-4);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
:host(.inside-datagrid) input {
|
|
30
|
-
|
|
31
|
-
width: 10px;
|
|
30
|
+
margin: 0 var(--sys-size-3);
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
.devtools-checkbox-text {
|
|
@@ -44,44 +43,3 @@ input {
|
|
|
44
43
|
color: var(--sys-color-token-subtle);
|
|
45
44
|
white-space: break-spaces;
|
|
46
45
|
}
|
|
47
|
-
|
|
48
|
-
@media (forced-colors: active) {
|
|
49
|
-
input.devtools-checkbox-theme-preserve {
|
|
50
|
-
forced-color-adjust: none;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
input.devtools-checkbox-theme-preserve:active {
|
|
54
|
-
background: HighlightText;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
input.devtools-checkbox-theme-preserve:checked,
|
|
58
|
-
input.devtools-checkbox-theme-preserve:active:checked {
|
|
59
|
-
background: Highlight;
|
|
60
|
-
border-color: Highlight;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
input.devtools-checkbox-theme-preserve:hover:enabled {
|
|
64
|
-
border-color: Highlight;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
input.devtools-checkbox-theme-preserve:active::before,
|
|
68
|
-
input.devtools-checkbox-theme-preserve:active::after {
|
|
69
|
-
background-color: Highlight;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
input.devtools-checkbox-theme-preserve:checked::before,
|
|
73
|
-
input.devtools-checkbox-theme-preserve:checked::after,
|
|
74
|
-
input.devtools-checkbox-theme-preserve:active:checked::before,
|
|
75
|
-
input.devtools-checkbox-theme-preserve:active:checked::after {
|
|
76
|
-
background-color: HighlightText;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
input.devtools-checkbox-theme-preserve:hover:checked::before,
|
|
80
|
-
input.devtools-checkbox-theme-preserve:hover:checked::after {
|
|
81
|
-
background-color: Highlight !important; /* stylelint-disable-line declaration-no-important */
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
input.devtools-checkbox-theme-preserve:hover:checked {
|
|
85
|
-
background: HighlightText;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
@@ -208,12 +208,7 @@ function getColorFromHsva(gamut: SpectrumGamut, hsva: Common.ColorUtils.Color4D)
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
|
|
212
|
-
Common.ObjectWrapper.eventMixin(
|
|
213
|
-
UI.Widget.VBox,
|
|
214
|
-
);
|
|
215
|
-
|
|
216
|
-
export class Spectrum extends SpectrumBase {
|
|
211
|
+
export class Spectrum extends UI.Widget.VBox {
|
|
217
212
|
#color?: Common.Color.Color;
|
|
218
213
|
private gamut: SpectrumGamut = SpectrumGamut.SRGB;
|
|
219
214
|
private colorElement: HTMLElement;
|
|
@@ -276,8 +271,9 @@ export class Spectrum extends SpectrumBase {
|
|
|
276
271
|
// want to return the value of the variable but the
|
|
277
272
|
// actual variable string.
|
|
278
273
|
#colorString?: string;
|
|
279
|
-
constructor(
|
|
280
|
-
super({useShadowDom: true});
|
|
274
|
+
constructor(contrastInfoOrElement?: ContrastInfo|null|HTMLElement, element?: HTMLElement) {
|
|
275
|
+
super(contrastInfoOrElement instanceof HTMLElement ? contrastInfoOrElement : element, {useShadowDom: true});
|
|
276
|
+
const contrastInfo = contrastInfoOrElement instanceof HTMLElement ? undefined : contrastInfoOrElement;
|
|
281
277
|
this.registerRequiredCSS(spectrumStyles);
|
|
282
278
|
|
|
283
279
|
this.contentElement.tabIndex = 0;
|
|
@@ -960,7 +956,7 @@ export class Spectrum extends SpectrumBase {
|
|
|
960
956
|
}
|
|
961
957
|
}
|
|
962
958
|
this.element.style.height = (paletteTop + paletteMargin + (paletteColorHeight + paletteMargin) * rowsNeeded) + 'px';
|
|
963
|
-
this.
|
|
959
|
+
this.element.dispatchEvent(new SizeChangedEvent());
|
|
964
960
|
}
|
|
965
961
|
|
|
966
962
|
private onPaletteColorKeydown(palette: Palette, colorIndex: number, event: KeyboardEvent|MouseEvent): void {
|
|
@@ -1072,13 +1068,6 @@ export class Spectrum extends SpectrumBase {
|
|
|
1072
1068
|
this.showPalette(palette, false);
|
|
1073
1069
|
}
|
|
1074
1070
|
|
|
1075
|
-
setColor(color: Common.Color.Color): void {
|
|
1076
|
-
this.#setColor(color, '', undefined /* colorName */, color.format(), ChangeSource.Model);
|
|
1077
|
-
const colorValues = color.as(Common.Color.Format.HSL).canonicalHSLA();
|
|
1078
|
-
UI.ARIAUtils.setValueNow(this.hueElement, colorValues[0]);
|
|
1079
|
-
UI.ARIAUtils.setValueText(this.alphaElement, colorValues[3]);
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
1071
|
private colorSelected(color: Common.Color.Legacy): void {
|
|
1083
1072
|
this.#setColor(color, '', undefined /* colorName */, undefined /* colorFormat */, ChangeSource.Other);
|
|
1084
1073
|
}
|
|
@@ -1091,6 +1080,13 @@ export class Spectrum extends SpectrumBase {
|
|
|
1091
1080
|
return getColorFromHsva(this.gamut, this.hsv);
|
|
1092
1081
|
}
|
|
1093
1082
|
|
|
1083
|
+
set color(color: Common.Color.Color) {
|
|
1084
|
+
this.#setColor(color, '', undefined /* colorName */, color.format(), ChangeSource.Model);
|
|
1085
|
+
const colorValues = color.as(Common.Color.Format.HSL).canonicalHSLA();
|
|
1086
|
+
UI.ARIAUtils.setValueNow(this.hueElement, colorValues[0]);
|
|
1087
|
+
UI.ARIAUtils.setValueText(this.alphaElement, colorValues[3]);
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1094
1090
|
#setColor(
|
|
1095
1091
|
colorOrHsv: Common.Color.Color|Common.ColorUtils.Color4D|undefined, colorString: string|undefined,
|
|
1096
1092
|
colorName: string|undefined, colorFormat: Common.Color.Format|undefined, changeSource: string): void {
|
|
@@ -1157,7 +1153,7 @@ export class Spectrum extends SpectrumBase {
|
|
|
1157
1153
|
this.updateInput();
|
|
1158
1154
|
}
|
|
1159
1155
|
if (changeSource !== ChangeSource.Model) {
|
|
1160
|
-
this.
|
|
1156
|
+
this.element.dispatchEvent(new ColorChangedEvent(this.colorString()));
|
|
1161
1157
|
}
|
|
1162
1158
|
}
|
|
1163
1159
|
|
|
@@ -1468,16 +1464,6 @@ export const ChangeSource = {
|
|
|
1468
1464
|
Other: 'Other',
|
|
1469
1465
|
};
|
|
1470
1466
|
|
|
1471
|
-
export const enum Events {
|
|
1472
|
-
COLOR_CHANGED = 'ColorChanged',
|
|
1473
|
-
SIZE_CHANGED = 'SizeChanged',
|
|
1474
|
-
}
|
|
1475
|
-
|
|
1476
|
-
export interface EventTypes {
|
|
1477
|
-
[Events.COLOR_CHANGED]: string;
|
|
1478
|
-
[Events.SIZE_CHANGED]: void;
|
|
1479
|
-
}
|
|
1480
|
-
|
|
1481
1467
|
const COLOR_CHIP_SIZE = 24;
|
|
1482
1468
|
const ITEMS_PER_PALETTE_ROW = 8;
|
|
1483
1469
|
const GeneratedPaletteTitle = 'Page colors';
|
|
@@ -1713,3 +1699,29 @@ export interface Palette {
|
|
|
1713
1699
|
mutable: boolean;
|
|
1714
1700
|
matchUserFormat?: boolean;
|
|
1715
1701
|
}
|
|
1702
|
+
|
|
1703
|
+
export class ColorChangedEvent extends Event {
|
|
1704
|
+
static readonly eventName = 'spectrumcolorchanged';
|
|
1705
|
+
|
|
1706
|
+
data: string;
|
|
1707
|
+
|
|
1708
|
+
constructor(color: string) {
|
|
1709
|
+
super(ColorChangedEvent.eventName, {});
|
|
1710
|
+
this.data = color;
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1714
|
+
export class SizeChangedEvent extends Event {
|
|
1715
|
+
static readonly eventName = 'sizechanged';
|
|
1716
|
+
|
|
1717
|
+
constructor() {
|
|
1718
|
+
super(SizeChangedEvent.eventName, {});
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
declare global {
|
|
1723
|
+
interface HTMLElementEventMap {
|
|
1724
|
+
[ColorChangedEvent.eventName]: ColorChangedEvent;
|
|
1725
|
+
[SizeChangedEvent.eventName]: SizeChangedEvent;
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
@@ -13,12 +13,6 @@
|
|
|
13
13
|
overflow: hidden;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
/* stylelint-disable-next-line selector-pseudo-class-no-unknown */
|
|
17
|
-
:selection {
|
|
18
|
-
background-color: var(--sys-color-tonal-container);
|
|
19
|
-
color: var(--sys-color-on-tonal-container);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
16
|
.spectrum-color {
|
|
23
17
|
position: relative;
|
|
24
18
|
width: 232px;
|
|
@@ -112,14 +106,12 @@
|
|
|
112
106
|
border-radius: var(--sys-size-7);
|
|
113
107
|
}
|
|
114
108
|
|
|
115
|
-
.spectrum-sat
|
|
116
|
-
.-theme-preserve {
|
|
109
|
+
.spectrum-sat {
|
|
117
110
|
/* stylelint-disable-next-line plugin/use_theme_colors */
|
|
118
111
|
background-image: linear-gradient(to right, #fff, rgb(204 154 129 / 0%));
|
|
119
112
|
}
|
|
120
113
|
|
|
121
|
-
.spectrum-val
|
|
122
|
-
.-theme-preserve {
|
|
114
|
+
.spectrum-val {
|
|
123
115
|
/* stylelint-disable-next-line plugin/use_theme_colors */
|
|
124
116
|
background-image: linear-gradient(to top, #000, rgb(204 154 129 / 0%));
|
|
125
117
|
}
|
|
@@ -378,9 +378,7 @@
|
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
.striped-data-grid .revealed.data-grid-data-grid-node:nth-child(odd):not(.dirty, .selected),
|
|
381
|
-
.striped-data-grid-starts-with-odd .revealed.data-grid-data-grid-node:nth-child(even):not(.dirty, .selected)
|
|
382
|
-
.request-cookies-view tr.revealed.data-grid-data-grid-node.flagged-cookie-attribute-row:not(.selected):nth-child(2n),
|
|
383
|
-
.cookies-table tr.revealed.data-grid-data-grid-node.flagged-cookie-attribute-row:not(.selected):nth-child(odd) {
|
|
381
|
+
.striped-data-grid-starts-with-odd .revealed.data-grid-data-grid-node:nth-child(even):not(.dirty, .selected) {
|
|
384
382
|
background-color: canvas;
|
|
385
383
|
}
|
|
386
384
|
|
|
@@ -393,9 +391,7 @@
|
|
|
393
391
|
.data-grid tbody tr.revealed:hover,
|
|
394
392
|
.data-grid tbody tr.revealed.selected,
|
|
395
393
|
.striped-data-grid .revealed:hover.data-grid-data-grid-node:nth-child(odd):not(.dirty, .selected),
|
|
396
|
-
.striped-data-grid-starts-with-odd .revealed:hover.data-grid-data-grid-node:nth-child(even):not(.dirty, .selected)
|
|
397
|
-
.request-cookies-view tr.revealed:hover.data-grid-data-grid-node.flagged-cookie-attribute-row:not(.selected):nth-child(2n),
|
|
398
|
-
.cookies-table tr.revealed:hover.data-grid-data-grid-node.flagged-cookie-attribute-row:not(.selected):nth-child(odd) {
|
|
394
|
+
.striped-data-grid-starts-with-odd .revealed:hover.data-grid-data-grid-node:nth-child(even):not(.dirty, .selected) {
|
|
399
395
|
forced-color-adjust: none;
|
|
400
396
|
background-color: Highlight;
|
|
401
397
|
}
|
|
@@ -8,19 +8,14 @@ import * as Platform from '../../../../core/platform/platform.js';
|
|
|
8
8
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
9
9
|
import * as UI from '../../legacy.js';
|
|
10
10
|
|
|
11
|
-
import {AnimationTimingModel} from './AnimationTimingModel.js';
|
|
11
|
+
import {AnimationTimingModel, LINEAR_BEZIER} from './AnimationTimingModel.js';
|
|
12
12
|
import {AnimationTimingUI, PresetUI} from './AnimationTimingUI.js';
|
|
13
13
|
import bezierEditorStyles from './bezierEditor.css.js';
|
|
14
14
|
|
|
15
15
|
const PREVIEW_ANIMATION_DEBOUNCE_DELAY = 300;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
UI.Widget.VBox,
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
export class BezierEditor extends BezierEditorBase {
|
|
23
|
-
private model: AnimationTimingModel;
|
|
17
|
+
export class BezierEditor extends UI.Widget.VBox {
|
|
18
|
+
#model: AnimationTimingModel;
|
|
24
19
|
private previewElement: HTMLElement;
|
|
25
20
|
private readonly previewOnion: HTMLElement;
|
|
26
21
|
private readonly outerContainer: HTMLElement;
|
|
@@ -34,11 +29,11 @@ export class BezierEditor extends BezierEditorBase {
|
|
|
34
29
|
private previewAnimation?: Animation;
|
|
35
30
|
private debouncedStartPreviewAnimation: () => void;
|
|
36
31
|
|
|
37
|
-
constructor(
|
|
38
|
-
super({useShadowDom: true});
|
|
32
|
+
constructor(modelOrElement?: AnimationTimingModel|HTMLElement, element?: HTMLElement) {
|
|
33
|
+
super(modelOrElement instanceof HTMLElement ? modelOrElement : element, {useShadowDom: true});
|
|
39
34
|
this.registerRequiredCSS(bezierEditorStyles);
|
|
40
35
|
|
|
41
|
-
this
|
|
36
|
+
this.#model = modelOrElement instanceof HTMLElement ? LINEAR_BEZIER : (modelOrElement ?? LINEAR_BEZIER);
|
|
42
37
|
this.contentElement.tabIndex = 0;
|
|
43
38
|
this.contentElement.setAttribute(
|
|
44
39
|
'jslog', `${VisualLogging.dialog('bezierEditor').parent('mapped').track({keydown: 'Enter|Escape'})}`);
|
|
@@ -78,7 +73,7 @@ export class BezierEditor extends BezierEditorBase {
|
|
|
78
73
|
this.animationTimingUI = new AnimationTimingUI({
|
|
79
74
|
model: this.model,
|
|
80
75
|
onChange: (model: AnimationTimingModel) => {
|
|
81
|
-
this.
|
|
76
|
+
this.model = model;
|
|
82
77
|
this.onchange();
|
|
83
78
|
this.unselectPresets();
|
|
84
79
|
this.debouncedStartPreviewAnimation();
|
|
@@ -98,9 +93,13 @@ export class BezierEditor extends BezierEditorBase {
|
|
|
98
93
|
this.label = this.header.createChild('span', 'source-code bezier-display-value');
|
|
99
94
|
}
|
|
100
95
|
|
|
101
|
-
|
|
102
|
-
this
|
|
103
|
-
|
|
96
|
+
get model(): AnimationTimingModel {
|
|
97
|
+
return this.#model;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
set model(model: AnimationTimingModel) {
|
|
101
|
+
this.#model = model;
|
|
102
|
+
this.animationTimingUI?.setModel(this.#model);
|
|
104
103
|
this.updateUI();
|
|
105
104
|
}
|
|
106
105
|
|
|
@@ -123,7 +122,7 @@ export class BezierEditor extends BezierEditorBase {
|
|
|
123
122
|
|
|
124
123
|
private onchange(): void {
|
|
125
124
|
this.updateUI();
|
|
126
|
-
this.
|
|
125
|
+
this.element.dispatchEvent(new BezierChangedEvent(this.model.asCSSText()));
|
|
127
126
|
}
|
|
128
127
|
|
|
129
128
|
private updateUI(): void {
|
|
@@ -182,7 +181,7 @@ export class BezierEditor extends BezierEditorBase {
|
|
|
182
181
|
this.selectedCategory.icon.classList.add('bezier-preset-selected');
|
|
183
182
|
const newModel = AnimationTimingModel.parse(category.presets[category.presetIndex].value);
|
|
184
183
|
if (newModel) {
|
|
185
|
-
this.
|
|
184
|
+
this.model = newModel;
|
|
186
185
|
this.onchange();
|
|
187
186
|
this.startPreviewAnimation();
|
|
188
187
|
}
|
|
@@ -201,7 +200,7 @@ export class BezierEditor extends BezierEditorBase {
|
|
|
201
200
|
const selectedPreset = this.selectedCategory.presets[this.selectedCategory.presetIndex].value;
|
|
202
201
|
const newModel = AnimationTimingModel.parse(selectedPreset);
|
|
203
202
|
if (newModel) {
|
|
204
|
-
this.
|
|
203
|
+
this.model = newModel;
|
|
205
204
|
this.onchange();
|
|
206
205
|
this.startPreviewAnimation();
|
|
207
206
|
}
|
|
@@ -237,14 +236,6 @@ export class BezierEditor extends BezierEditorBase {
|
|
|
237
236
|
}
|
|
238
237
|
}
|
|
239
238
|
|
|
240
|
-
export const enum Events {
|
|
241
|
-
BEZIER_CHANGED = 'BezierChanged',
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
export interface EventTypes {
|
|
245
|
-
[Events.BEZIER_CHANGED]: string;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
239
|
export const Presets: Array<Array<{
|
|
249
240
|
name: string,
|
|
250
241
|
value: string,
|
|
@@ -301,3 +292,20 @@ export interface PresetCategory {
|
|
|
301
292
|
icon: Element;
|
|
302
293
|
presetIndex: number;
|
|
303
294
|
}
|
|
295
|
+
|
|
296
|
+
export class BezierChangedEvent extends Event {
|
|
297
|
+
static readonly eventName = 'bezierchanged';
|
|
298
|
+
|
|
299
|
+
data: string;
|
|
300
|
+
|
|
301
|
+
constructor(bezier: string) {
|
|
302
|
+
super(BezierChangedEvent.eventName, {});
|
|
303
|
+
this.data = bezier;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
declare global {
|
|
308
|
+
interface HTMLElementEventMap {
|
|
309
|
+
[BezierChangedEvent.eventName]: BezierChangedEvent;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
@@ -25,6 +25,7 @@ export class SwatchPopoverHelper extends Common.ObjectWrapper.ObjectWrapper<Even
|
|
|
25
25
|
constructor() {
|
|
26
26
|
super();
|
|
27
27
|
this.popover = new UI.GlassPane.GlassPane();
|
|
28
|
+
this.popover.contentElement.classList.add('swatch-popover');
|
|
28
29
|
this.popover.setSizeBehavior(UI.GlassPane.SizeBehavior.MEASURE_CONTENT);
|
|
29
30
|
this.popover.setMarginBehavior(UI.GlassPane.MarginBehavior.DEFAULT_MARGIN);
|
|
30
31
|
this.popover.element.addEventListener('mousedown', e => e.consume(), false);
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
/* Match half of the combined width of the text input (--sys-size-17), gap (--sys-size-5), and 2D/range slider (--sys-size-19) below. */
|
|
53
53
|
width: calc((var(--sys-size-17) + var(--sys-size-5) + var(--sys-size-19)) / 2);
|
|
54
54
|
height: var(--sys-size-11);
|
|
55
|
-
padding:
|
|
55
|
+
padding: var(--sys-size-2) var(--sys-size-4);
|
|
56
56
|
line-height: var(--sys-size-8);
|
|
57
57
|
border: var(--sys-size-1) solid var(--divider-line);
|
|
58
58
|
color: var(--sys-color-on-surface);
|