Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@prismicio/richtext

Package Overview
Dependencies
Maintainers
18
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@prismicio/richtext - npm Package Compare versions

Comparing version 2.0.0-alpha.0 to 2.0.0-alpha.1

CHANGELOG.md

12

dist/index.d.ts
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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc