import type { Options } from '@popperjs/core'; import type { Editor } from 'grapesjs'; import { CSSProperties } from 'react'; import type { ColorFieldProps } from '../components/ColorField'; import type { StudioColorPickerProps } from '../components/public/StudioColorPicker'; import type { StudioIconProps } from '../components/public/StudioIcon'; import { StudioPanelResizableProps } from '../components/public/types/StudioPanelSchema'; import type { ContextMenuCoords } from '../store/ContextMenuStore'; import { StudioLayoutColumnConfigProps, StudioLayoutComponentsConfigProps, StudioLayoutRowConfigProps } from './layoutComponents'; export type RootLayoutConfig = StudioLayoutRowConfigProps | StudioLayoutColumnConfigProps; export type ResponsiveLayoutConfig = Record; export interface LayoutOverridePropsByKey { colorPicker: StudioColorPickerProps; colorField: ColorFieldProps; } export type LayoutOverrideKey = keyof LayoutOverridePropsByKey; export type LayoutOverrideCallback = (props: { props: LayoutOverridePropsByKey[K]; editor?: Editor; }) => LayoutOverridePropsByKey[K] | undefined; export type LayoutOverridesConfig = { [K in LayoutOverrideKey]?: LayoutOverrideCallback; }; export interface LayoutConfig { default?: RootLayoutConfig; responsive?: ResponsiveLayoutConfig; overrides?: LayoutOverridesConfig; } export declare enum LayoutPosition { left = "left", right = "right", top = "top", bottom = "bottom", center = "center" } export interface LayoutHeader extends Pick { label?: string; className?: string; close?: boolean; onClose?: () => void; style?: React.CSSProperties; } export declare enum LayoutPlacers { popover = "popover", absolute = "absolute", static = "static", dialog = "dialog" } export interface LayoutPlacerAbsolute { type: `${LayoutPlacers.absolute}`; position: LayoutPosition | `${LayoutPosition}`; resizable?: StudioPanelResizableProps; } export interface LayoutPlacerPopover extends ContextMenuCoords { type: `${LayoutPlacers.popover}`; options?: Partial; closeOnClickAway?: boolean; isOnCanvas?: boolean; } export interface LayoutPlacerStatic { type: `${LayoutPlacers.static}`; layoutId: string; skipCleanup?: boolean; resizable?: StudioPanelResizableProps; } export interface LayoutPlacerDialog { type: `${LayoutPlacers.dialog}`; title?: string; fullH?: boolean; size?: 'xl' | 'l' | 'm' | 's'; } export interface LayoutCommandProps { id: string; layout: StudioLayoutComponentsConfigProps['type'] | StudioLayoutComponentsConfigProps; disablePropagation?: boolean; placer?: LayoutPlacerAbsolute | LayoutPlacerPopover | LayoutPlacerStatic | LayoutPlacerDialog; props?: Record; className?: string; header?: LayoutHeader | false; style?: CSSProperties; full?: boolean; toRemove?: boolean; }