// Divi dependencies.
import { ModuleEditProps } from '@divi/module-library';
import {
	InternalAttrs,
	type Element, FormatBreakpointStateAttr,
} from '@divi/types';

import type {
    AttrVal,
    BorderValue,
    TypographyValue,
    SpacingValue,
} from '../custom-types';

type BaseDecoration = Element.Decoration.PickedAttributes<
    | 'animation'
    | 'background'
    | 'border'
    | 'boxShadow'
    | 'disabledOn'
    | 'filters'
    | 'overflow'
    | 'position'
    | 'scroll'
    | 'sizing'
    | 'spacing'
    | 'sticky'
    | 'transform'
    | 'transition'
    | 'zIndex'
>;

type DecorationExtras = {
    titleColor?: FormatBreakpointStateAttr<AttrVal>;
    titleTypography?: FormatBreakpointStateAttr<TypographyValue>;
    filtersPosition?: FormatBreakpointStateAttr<AttrVal>;
    filtersGap?: FormatBreakpointStateAttr<AttrVal>;
    filtersTypography?: FormatBreakpointStateAttr<TypographyValue>;
    filterColor?: FormatBreakpointStateAttr<AttrVal>;
    filterBgColor?: FormatBreakpointStateAttr<AttrVal>;
    filterHoverColor?: FormatBreakpointStateAttr<AttrVal>;
    filterHoverBgColor?: FormatBreakpointStateAttr<AttrVal>;
    filterSpacing?: FormatBreakpointStateAttr<SpacingValue>;
    filterBorder?: FormatBreakpointStateAttr<BorderValue>;
    removeSize?: FormatBreakpointStateAttr<AttrVal>;
    removeColor?: FormatBreakpointStateAttr<AttrVal>;
    removeYOffset?: FormatBreakpointStateAttr<AttrVal>;
    removeXOffset?: FormatBreakpointStateAttr<AttrVal>;
};

export interface ActiveFiltersAttrs extends InternalAttrs {
	module?: {
		meta?: Element.Meta.Attributes;
		advanced?: {
			link?: Element.Advanced.Link.Attributes;
			htmlAttributes?: Element.Advanced.IdClasses.Attributes;
			text?: Element.Advanced.Text.Attributes;
		};
        decoration?: BaseDecoration & DecorationExtras;
	};

	[key: string]: any;
}

export type ActiveFiltersEditProps = ModuleEditProps<ActiveFiltersAttrs>;
