@mantine/tiptap
Version:
Rich text editor based on tiptap
44 lines (43 loc) • 1.96 kB
TypeScript
import { BoxProps, CompoundStylesApiProps, ElementProps, Factory } from '@mantine/core';
import { RichTextEditorLabels } from '../labels';
export type RichTextEditorControlStylesNames = 'control';
export interface RichTextEditorControlProps extends BoxProps, CompoundStylesApiProps<RichTextEditorControlFactory>, ElementProps<'button'> {
/** Determines whether the control should have active state, false by default */
active?: boolean;
/** Determines whether the control can be interacted with, set `false` to make the control to act as a label */
interactive?: boolean;
}
export type RichTextEditorControlFactory = Factory<{
props: RichTextEditorControlProps;
ref: HTMLButtonElement;
stylesNames: RichTextEditorControlStylesNames;
compound: true;
}>;
export declare const RichTextEditorControl: import("@mantine/core").MantineComponent<{
props: RichTextEditorControlProps;
ref: HTMLButtonElement;
stylesNames: RichTextEditorControlStylesNames;
compound: true;
}>;
export interface RichTextEditorControlBaseProps extends RichTextEditorControlProps {
icon?: React.FC<{
style: React.CSSProperties;
}>;
}
export declare const RichTextEditorControlBase: import("react").ForwardRefExoticComponent<RichTextEditorControlBaseProps & import("react").RefAttributes<HTMLButtonElement>>;
export interface CreateControlProps {
label: keyof RichTextEditorLabels;
icon: React.FC<{
style: React.CSSProperties;
}>;
isActive?: {
name: string;
attributes?: Record<string, any> | string;
};
isDisabled?: (editor: any) => boolean;
operation: {
name: string;
attributes?: Record<string, any> | string;
};
}
export declare function createControl({ label, isActive, operation, icon, isDisabled, }: CreateControlProps): import("react").ForwardRefExoticComponent<RichTextEditorControlBaseProps & import("react").RefAttributes<HTMLButtonElement>>;