From 8f945c7c449d48580ad67fc0d44f68e403868c9b Mon Sep 17 00:00:00 2001 From: Angelo Ashmore Date: Tue, 13 Jan 2026 16:45:52 -1000 Subject: [PATCH 1/2] feat: rename JSXMapSerializer to RichTextComponents Renames the `JSXMapSerializer` type to `RichTextComponents` for a clearer, more intuitive naming convention. The old name is kept as a deprecated alias for backwards compatibility. Co-Authored-By: Claude Opus 4.5 --- src/PrismicRichText.tsx | 9 +++++++-- src/index.ts | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/PrismicRichText.tsx b/src/PrismicRichText.tsx index a8a7b75..ca52f5c 100644 --- a/src/PrismicRichText.tsx +++ b/src/PrismicRichText.tsx @@ -39,7 +39,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 +89,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"; From 6516f8695be216e82ffa2c1924427d9d65382de2 Mon Sep 17 00:00:00 2001 From: Angelo Ashmore Date: Tue, 13 Jan 2026 18:36:20 -1000 Subject: [PATCH 2/2] chore: format PrismicRichText.tsx with prettier Co-Authored-By: Claude Opus 4.5 --- src/PrismicRichText.tsx | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/PrismicRichText.tsx b/src/PrismicRichText.tsx index 9b3a418..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