@liveblocks/react-ui
Version:
A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.
39 lines (36 loc) • 1.05 kB
JavaScript
import { jsx } from 'react/jsx-runtime';
import { useComponents, ComponentsProvider } from '../../components.js';
import { Markdown } from '../../primitives/Markdown.js';
import { cn } from '../../utils/cn.js';
import { CodeBlock as CodeBlock$1 } from './CodeBlock.js';
function Link({ href, title, children }) {
const { Anchor } = useComponents();
return /* @__PURE__ */ jsx(Anchor, { href, title, children });
}
function CodeBlock({ language, code }) {
return /* @__PURE__ */ jsx(CodeBlock$1, { title: language || "Plain text", code });
}
const defaultMarkdownComponents = {
Link,
CodeBlock
};
function Prose({
content,
partial,
components,
className,
...props
}) {
return /* @__PURE__ */ jsx(ComponentsProvider, { components, children: /* @__PURE__ */ jsx(
Markdown,
{
content,
components: { ...defaultMarkdownComponents, ...components?.markdown },
className: cn("lb-root lb-prose", className),
partial,
...props
}
) });
}
export { Prose };
//# sourceMappingURL=Prose.js.map