File
Blob: src/sites/static-renderer/index.ts
| 1 | import type { JSONContent } from "@tiptap/core"; |
| 2 | import type { Node as ProseMirrorNode } from "@tiptap/pm/model"; |
| 3 | import { renderToReactElement } from "@tiptap/static-renderer/pm/react"; |
| 4 | import type { ReactNode } from "react"; |
| 5 | import { createHeadlessEditorExtensions } from "@/shared/editor/schema"; |
| 6 | import { createBlandSitesStaticNodeMappings } from "./node-mappings"; |
| 7 | |
| 8 | export function renderBlandSitesDocumentToReactElement(content: ProseMirrorNode | JSONContent): ReactNode { |
| 9 | return renderToReactElement({ |
| 10 | content, |
| 11 | extensions: createHeadlessEditorExtensions(), |
| 12 | options: { |
| 13 | nodeMapping: createBlandSitesStaticNodeMappings(), |
| 14 | }, |
| 15 | }); |
| 16 | } |
| 17 | |
| 18 | export type { SitesPageMentionRenderInfo } from "@/sites/types"; |