UNPKG

@mantine/tiptap

Version:

Rich text editor based on tiptap

54 lines (53 loc) 2.09 kB
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 @default false */ 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 function RichTextEditorControlBase({ className, icon: Icon, ...others }: RichTextEditorControlBaseProps & { icon: React.FC<{ style: React.CSSProperties; }>; }): import("react/jsx-runtime").JSX.Element; export declare namespace RichTextEditorControlBase { var displayName: string; } 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): { (props: RichTextEditorControlBaseProps): import("react/jsx-runtime").JSX.Element; displayName: string; };