- {isEditing && (
-
-
-
- {layoutManager.renderEditor?.()}
-
- )}
- {children}
-
- );
-}
-
-function getStyles(theme: GrafanaTheme2) {
- return {
- editHeader: css({
- width: '100%',
- display: 'flex',
- gap: theme.spacing(1),
- padding: theme.spacing(0, 1, 0.5, 1),
- margin: theme.spacing(0, 0, 1, 0),
- alignItems: 'flex-end',
- borderBottom: `1px solid ${theme.colors.border.weak}`,
- paddingBottom: theme.spacing(1),
-
- '&:hover, &:focus-within': {
- '& > div': {
- opacity: 1,
- },
- },
-
- '& > div': {
- marginBottom: 0,
- marginRight: theme.spacing(1),
- },
- }),
- wrapper: css({
- display: 'flex',
- flexDirection: 'column',
- flex: '1 1 0',
- width: '100%',
- }),
- icon: css({
- display: 'flex',
- alignItems: 'center',
- cursor: 'pointer',
- background: 'transparent',
- border: 'none',
- gap: theme.spacing(1),
- }),
- rowTitle: css({}),
- rowActions: css({
- display: 'flex',
- opacity: 0,
- [theme.transitions.handleMotion('no-preference', 'reduce')]: {
- transition: 'opacity 200ms ease-in',
- },
-
- '&:hover, &:focus-within': {
- opacity: 1,
- },
- }),
- };
-}
-
-function changeLayoutTo(currentLayout: DashboardLayoutManager, newLayoutDescriptor: LayoutRegistryItem) {
- const layoutParent = currentLayout.parent;
- if (layoutParent && isLayoutParent(layoutParent)) {
- layoutParent.switchLayout(newLayoutDescriptor.createFromLayout(currentLayout));
- }
-}
diff --git a/public/app/features/dashboard-scene/scene/layouts-shared/layoutRegistry.ts b/public/app/features/dashboard-scene/scene/layouts-shared/layoutRegistry.ts
index 2fbd9e9ecc2..95f345e71b9 100644
--- a/public/app/features/dashboard-scene/scene/layouts-shared/layoutRegistry.ts
+++ b/public/app/features/dashboard-scene/scene/layouts-shared/layoutRegistry.ts
@@ -2,8 +2,13 @@ import { Registry } from '@grafana/data';
import { DefaultGridLayoutManager } from '../layout-default/DefaultGridLayoutManager';
import { ResponsiveGridLayoutManager } from '../layout-responsive-grid/ResponsiveGridLayoutManager';
+import { RowsLayoutManager } from '../layout-rows/RowsLayoutManager';
import { LayoutRegistryItem } from '../types';
export const layoutRegistry: Registry