mui-tiptap
Version:
A Material-UI (MUI) styled WYSIWYG rich text editor, using Tiptap
44 lines (43 loc) • 1.93 kB
TypeScript
import { type BoxProps } from "@mui/material";
import type { Except } from "type-fest";
export type RichTextContentClasses = ReturnType<typeof useStyles>["classes"];
export type RichTextContentProps = Except<BoxProps, "children" | "component"> & {
/** Optional additional className to provide to the root element. */
className?: string;
/** Override or extend existing styles. */
classes?: Partial<RichTextContentClasses>;
/**
* Whether to disable all default styles applied to the rich text content.
*
* Useful if you want to apply your own styles instead, or simply inherit
* external page styles.
*
* Warning: several utility styles will also be omitted if you disable default
* styles. (For instance, these handle table editability, displaying content
* from the Placeholder extension, etc. such as the styles here:
* https://github.com/sjdemartini/mui-tiptap/blob/7c94b6860a66835c35b9a7a5994fa773202654ac/src/styles.ts#L370-L417.)
* You may need to add equivalent CSS back yourself depending on the
* extensions you use.
*/
disableDefaultStyles?: boolean;
};
declare const useStyles: (params: {
disableDefaultStyles?: boolean | undefined;
}, muiStyleOverridesParams?: {
props: Record<string, unknown>;
ownerState?: Record<string, unknown> | undefined;
} | undefined) => {
classes: Record<"root" | "readonly" | "editable", string>;
theme: import("@mui/material").Theme;
css: import("tss-react").Css;
cx: import("tss-react").Cx;
};
/**
* A component for rendering a MUI-styled version of Tiptap rich text editor
* content.
*
* Must be a child of the RichTextEditorProvider so that the `editor` context is
* available.
*/
export default function RichTextContent({ className, classes: overrideClasses, disableDefaultStyles, ...boxProps }: RichTextContentProps): import("react/jsx-runtime").JSX.Element;
export {};