diff --git a/src/PrismicRichText.tsx b/src/PrismicRichText.tsx index 4b5ded7..5a06cd7 100644 --- a/src/PrismicRichText.tsx +++ b/src/PrismicRichText.tsx @@ -1,11 +1,5 @@ -import { - cloneElement, - type ComponentType, - type FC, - Fragment, - isValidElement, - type ReactNode, -} from "react"; +import { type LinkProps, PrismicLink } from "./PrismicLink.js"; +import { devMsg } from "./lib/devMsg.js"; import { isFilled, type LinkResolverFunction, @@ -20,10 +14,14 @@ import { type RichTextMapSerializer, } from "@prismicio/client/richtext"; import { DEV } from "esm-env"; - -import { devMsg } from "./lib/devMsg.js"; - -import { type LinkProps, PrismicLink } from "./PrismicLink.js"; +import { + cloneElement, + type ComponentType, + type FC, + Fragment, + isValidElement, + type ReactNode, +} from "react"; /** * A function mapping rich text block types to React Components. It is used to @@ -39,7 +37,12 @@ export type JSXFunctionSerializer = RichTextFunctionSerializer; * * @see Templating rich text fields {@link https://prismic.io/docs/fields/rich-text} */ -export type JSXMapSerializer = RichTextMapSerializer; +export type RichTextComponents = RichTextMapSerializer; + +/** + * @deprecated Use `RichTextComponents` instead. + */ +export type JSXMapSerializer = RichTextComponents; /** Props for ``. */ export type PrismicRichTextProps = { @@ -84,7 +87,7 @@ export type PrismicRichTextProps = { * }; * ``` */ - components?: JSXMapSerializer | JSXFunctionSerializer; + components?: RichTextComponents | JSXFunctionSerializer; /** * The React component rendered for links when the URL is internal. diff --git a/src/index.ts b/src/index.ts index de69e68..2b0fc05 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,6 +10,7 @@ export type { PrismicTextProps } from "./PrismicText.js"; export { PrismicRichText } from "./PrismicRichText.js"; export type { PrismicRichTextProps, + RichTextComponents, JSXMapSerializer, JSXFunctionSerializer, } from "./PrismicRichText.js";