// 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 = {
	itemsSpaceBetween?: FormatBreakpointStateAttr<AttrVal>;
	itemsAlignment?: FormatBreakpointStateAttr<AttrVal>;
	itemMinWidth?: FormatBreakpointStateAttr<AttrVal>;
	itemTypography?: FormatBreakpointStateAttr<TypographyValue>;
	itemNormalColor?: FormatBreakpointStateAttr<AttrVal>;
	itemNormalBgColor?: FormatBreakpointStateAttr<AttrVal>;
	itemCheckedColor?: FormatBreakpointStateAttr<AttrVal>;
	itemCheckedBgColor?: FormatBreakpointStateAttr<AttrVal>;
	itemCheckedBorderColor?: FormatBreakpointStateAttr<AttrVal>;
	itemPadding?: FormatBreakpointStateAttr<SpacingValue>;
	itemBorder?: FormatBreakpointStateAttr<BorderValue>;
	labelTypography?: FormatBreakpointStateAttr<TypographyValue>;
	labelColor?: FormatBreakpointStateAttr<AttrVal>;
	labelGapY?: FormatBreakpointStateAttr<AttrVal>;
	labelAlignment?: FormatBreakpointStateAttr<AttrVal>;
	applyTypography?: FormatBreakpointStateAttr<TypographyValue>;
	applyNormalColor?: FormatBreakpointStateAttr<AttrVal>;
	applyNormalBgColor?: FormatBreakpointStateAttr<AttrVal>;
	applyHoverColor?: FormatBreakpointStateAttr<AttrVal>;
	applyHoverBgColor?: FormatBreakpointStateAttr<AttrVal>;
	applyHoverBorderColor?: FormatBreakpointStateAttr<AttrVal>;
	applyBorder?: FormatBreakpointStateAttr<BorderValue>;
	applySpacing?: FormatBreakpointStateAttr<SpacingValue>;
	applyButtonAlignment?: FormatBreakpointStateAttr<AttrVal>;
};

export interface AlphabetAttrs 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 AlphabetEditProps = ModuleEditProps<AlphabetAttrs>;
