@prismicio/richtext
Advanced tools
Comparing version 2.0.0-alpha.0 to 2.0.0-alpha.1
import * as _prismicio_types from '@prismicio/types'; | ||
import { RichTextNodeType, RTBlockNode, RTInlineNode, RTHeading1Node, RTHeading2Node, RTHeading3Node, RTHeading4Node, RTHeading5Node, RTHeading6Node, RTParagraphNode, RTPreformattedNode, RTStrongNode, RTEmNode, RTListItemNode, RTOListItemNode, RTListNode, RTOListNode, RTImageNode, RTEmbedNode, RTLinkNode, RTLabelNode, RTSpanNode, RTTextNodeBase, RTNode, RichTextField } from '@prismicio/types'; | ||
import { RichTextNodeType, RTAnyNode, RTHeading1Node, RTHeading2Node, RTHeading3Node, RTHeading4Node, RTHeading5Node, RTHeading6Node, RTParagraphNode, RTPreformattedNode, RTStrongNode, RTEmNode, RTListItemNode, RTOListItemNode, RTListNode, RTOListNode, RTImageNode, RTEmbedNode, RTLinkNode, RTLabelNode, RTSpanNode, RTNode, RichTextField } from '@prismicio/types'; | ||
export { RichTextNodeType as Element } from '@prismicio/types'; | ||
@@ -18,5 +18,3 @@ | ||
*/ | ||
declare type RichTextMapSerializerFunction<ReturnType, Node extends { | ||
type: RichTextNodeType; | ||
} = RTBlockNode | RTInlineNode, TextType = string | undefined, ChildrenType = ReturnType> = (payload: { | ||
declare type RichTextMapSerializerFunction<ReturnType, Node extends RTAnyNode = RTAnyNode, TextType = string | undefined, ChildrenType = ReturnType> = (payload: { | ||
type: Node["type"]; | ||
@@ -72,6 +70,2 @@ node: Node; | ||
} | ||
declare type RTAnyNode = RTBlockNode | RTInlineNode | RTBlockSpanNode; | ||
interface RTBlockSpanNode extends RTTextNodeBase { | ||
type: RichTextNodeType.span; | ||
} | ||
@@ -156,3 +150,3 @@ /** | ||
*/ | ||
declare const composeSerializers: <SerializerReturnType>(serializers_0: RichTextFunctionSerializer<SerializerReturnType>, ...serializers_1: RichTextFunctionSerializer<SerializerReturnType>[]) => (type: _prismicio_types.RichTextNodeType, node: RTAnyNode, text: string | undefined, children: SerializerReturnType[], key: string) => SerializerReturnType; | ||
declare const composeSerializers: <SerializerReturnType>(serializers_0: RichTextFunctionSerializer<SerializerReturnType> | RichTextFunctionSerializer<SerializerReturnType | null>, ...serializers_1: (RichTextFunctionSerializer<SerializerReturnType> | RichTextFunctionSerializer<SerializerReturnType | null>)[]) => (type: _prismicio_types.RichTextNodeType, node: _prismicio_types.RTAnyNode, text: string | undefined, children: SerializerReturnType[], key: string) => SerializerReturnType; | ||
@@ -159,0 +153,0 @@ /** |
{ | ||
"name": "@prismicio/richtext", | ||
"version": "2.0.0-alpha.0", | ||
"version": "2.0.0-alpha.1", | ||
"description": "A parser and serializer for Prismic's Rich Text format", | ||
@@ -44,3 +44,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@prismicio/types": "^0.0.10" | ||
"@prismicio/types": "^0.0.11" | ||
}, | ||
@@ -47,0 +47,0 @@ "devDependencies": { |
import { | ||
RichTextNodeType, | ||
RTAnyNode, | ||
RTBlockNode, | ||
RTEmbedNode, | ||
RTImageNode, | ||
RTInlineNode, | ||
@@ -10,4 +9,5 @@ RTListItemNode, | ||
RTOListItemNode, | ||
RTTextNode, | ||
} from "@prismicio/types"; | ||
import { RTAnyNode, Tree, TreeNode } from "./types"; | ||
import { Tree, TreeNode } from "./types"; | ||
@@ -124,3 +124,3 @@ const uuid = (): string => { | ||
spans: RTInlineNode[], | ||
node: Exclude<RTNode, RTImageNode | RTEmbedNode>, | ||
node: RTTextNode, | ||
parentSpan?: RTInlineNode, | ||
@@ -127,0 +127,0 @@ ): TreeNode[] => { |
@@ -23,4 +23,10 @@ import { RichTextError } from "./RichTextError"; | ||
...serializers: [ | ||
RichTextFunctionSerializer<SerializerReturnType>, | ||
...RichTextFunctionSerializer<SerializerReturnType>[] | ||
( | ||
| RichTextFunctionSerializer<SerializerReturnType> | ||
| RichTextFunctionSerializer<SerializerReturnType | null> | ||
), | ||
...( | ||
| RichTextFunctionSerializer<SerializerReturnType> | ||
| RichTextFunctionSerializer<SerializerReturnType | null> | ||
)[] | ||
] | ||
@@ -27,0 +33,0 @@ ) => { |
import { | ||
RichTextNodeType, | ||
RTBlockNode, | ||
RTAnyNode, | ||
RTEmbedNode, | ||
@@ -13,3 +13,2 @@ RTEmNode, | ||
RTImageNode, | ||
RTInlineNode, | ||
RTLabelNode, | ||
@@ -25,3 +24,2 @@ RTLinkNode, | ||
RTStrongNode, | ||
RTTextNodeBase, | ||
} from "@prismicio/types"; | ||
@@ -53,3 +51,3 @@ | ||
ReturnType, | ||
Node extends { type: RichTextNodeType } = RTBlockNode | RTInlineNode, | ||
Node extends RTAnyNode = RTAnyNode, | ||
TextType = string | undefined, | ||
@@ -164,9 +162,2 @@ ChildrenType = ReturnType, | ||
// Helpers | ||
export type RTAnyNode = RTBlockNode | RTInlineNode | RTBlockSpanNode; | ||
// Internal node type used when building the tree | ||
export interface RTBlockSpanNode extends RTTextNodeBase { | ||
type: RichTextNodeType.span; | ||
} | ||
export const RichTextReversedNodeType = { | ||
@@ -173,0 +164,0 @@ [RichTextNodeType.listItem]: "listItem", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
53737
15
1
982
+ Added@prismicio/types@0.0.11(transitive)
- Removed@prismicio/types@0.0.10(transitive)
Updated@prismicio/types@^0.0.11