import { type ReactNode } from "react"; import { type IColorPalette, type ITheme, type ObjRef } from "@gooddata/sdk-model"; import { type IDialogBaseProps } from "../typings.js"; import { type TStylingEditorDialogFooterProps } from "./StylingEditorDialogFooter.js"; /** * @internal */ export type StylingPickerItemContent = ITheme | IColorPalette; /** * @internal */ export interface IStylingPickerItem { name?: string; ref?: ObjRef; content: T; } /** * @internal */ export interface IStylingEditorDialogProps extends TStylingEditorDialogFooterProps, Pick { title: string; tooltip?: string; stylingItem?: IStylingPickerItem; examples?: IStylingPickerItem[]; exampleToColorPreview?: (example: T) => string[]; locale?: string; onExit?: (name: string, definition: string) => void; onInvalidDefinition?: (ref: ObjRef) => void; showBackButton?: boolean; /** * Optional validation of the parsed definition content (e.g. checking theme color values). * * @remarks * Called only when the definition is valid JSON. Return a localized error message to block * submission and display it, or undefined when the content is valid. */ validateDefinition?: (content: T) => string | undefined; /** * Optional non-blocking check of the parsed definition content. * * @remarks * Called only when the definition is valid JSON. Return a localized message to display it as a * warning, or undefined when there is nothing to report. Unlike {@link IStylingEditorDialogProps.validateDefinition} * this never prevents submission — use it for content that applies but degrades the result. */ validateDefinitionWarning?: (content: T) => string | undefined; /** * Optionally replaces the definition editor, e.g. with a syntax-highlighting one. * * @remarks * `value` is the definition as JSON text, and `onChange` expects JSON text back — the same * contract as the plain textarea rendered when this is not supplied. Anything richer (a language * toggle and its persistence, for instance) stays owned by the caller. */ renderDefinitionEditor?: (props: { value: string; onChange: (next: string) => void; }) => ReactNode; } /** * @internal */ export declare function StylingEditorDialog(props: IStylingEditorDialogProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=StylingEditorDialog.d.ts.map