UNPKG

@mantine/tiptap

Version:

Rich text editor based on tiptap

46 lines (45 loc) 1.41 kB
"use client"; import RichTextEditor_module_default from "../RichTextEditor.module.mjs"; import { useRichTextEditorContext } from "../RichTextEditor.context.mjs"; import { Box, Typography, factory, useProps } from "@mantine/core"; import { EditorContent } from "@tiptap/react"; import { jsx } from "react/jsx-runtime"; //#region packages/@mantine/tiptap/src/RichTextEditorContent/RichTextEditorContent.tsx const RichTextEditorContent = factory((_props) => { const { classNames, className, style, styles, vars, ...others } = useProps("RichTextEditorContent", null, _props); const ctx = useRichTextEditorContext(); if (ctx.withTypographyStyles) return /* @__PURE__ */ jsx(Typography, { ...ctx.getStyles("Typography", { className, style, styles, classNames }), unstyled: ctx.unstyled, children: /* @__PURE__ */ jsx(Box, { component: EditorContent, editor: ctx.editor, ...ctx.getStyles("content", { classNames, styles }), ...others }) }); return /* @__PURE__ */ jsx(Box, { component: EditorContent, editor: ctx.editor, ...ctx.getStyles("content", { classNames, styles, className, style }), ...others }); }); RichTextEditorContent.classes = RichTextEditor_module_default; RichTextEditorContent.displayName = "@mantine/tiptap/RichTextEditorContent"; //#endregion export { RichTextEditorContent }; //# sourceMappingURL=RichTextEditorContent.mjs.map