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

astro-portabletext

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astro-portabletext - npm Package Compare versions

Comparing version 0.8.1 to 0.9.0-next.0

./lib/index.js

6

lib/context.d.ts

@@ -6,10 +6,4 @@ import type { TypedObject } from "@portabletext/types";

getUnknownComponent: () => Component;
getWarningMessage: () => string;
notifyMissingComponentHandler: (message?: string) => void;
/** @deprecated Use `getDefaultComponent` */
next: () => Component;
/** @deprecated Use `notifyMissingComponentHandler` */
onMissingComponent: (message?: string) => void;
}
export declare const key: unique symbol;
export declare function useContext(node: TypedObject): Context;

6

lib/internal.d.ts

@@ -1,2 +0,2 @@

import type { Props, SomePortableTextComponents } from "./types";
import type { Props, SomePortableTextComponents, TypedObject } from "./types";
/**

@@ -21,3 +21,3 @@ * Helper for component to throw an error

*/
export type Component<P extends Props = Props> = (props: P) => any;
export type Component<T extends TypedObject = any> = (props: Props<T>) => any;
/**

@@ -27,3 +27,3 @@ * For internal use

*/
export type ComponentOrRecord<P extends Props = Props> = Component<P> | Record<string, Component<P>>;
export type ComponentOrRecord<T extends TypedObject = any> = Component<T> | Record<string, Component<T>>;
/**

@@ -30,0 +30,0 @@ * @internal

@@ -46,35 +46,35 @@ import type { ToolkitListNestMode, ToolkitNestedPortableTextSpan, ToolkitPortableTextList, ToolkitPortableTextListItem, ToolkitTextNode } from "@portabletext/toolkit";

*/
block: ComponentOrRecord<Props<Block>>;
block: ComponentOrRecord<Block>;
/**
* Used when a `block` handler isn't found
*/
unknownBlock: Component<Props<Block>>;
unknownBlock: Component<Block>;
/**
* How lists should be rendered
*/
list: ComponentOrRecord<Props<List>>;
list: ComponentOrRecord<List>;
/**
* Used when a `list` handler isn't found
*/
unknownList: Component<Props<List>>;
unknownList: Component<List>;
/**
* How list items should be rendered
*/
listItem: ComponentOrRecord<Props<ListItem>>;
listItem: ComponentOrRecord<ListItem>;
/**
* Used when a `listItem` handler isn't found
*/
unknownListItem: Component<Props<ListItem>>;
unknownListItem: Component<ListItem>;
/**
* How marked text should be rendered
*/
mark: ComponentOrRecord<Props<Mark>>;
mark: ComponentOrRecord<Mark<any>>;
/**
* Used when a `mark` handler isn't found
*/
unknownMark: Component<Props<Mark>>;
unknownMark: Component<Mark<any>>;
/**
* How line breaks should be rendered
*/
hardBreak: Component<Props<TextNode>>;
hardBreak: Component<TextNode>;
}

@@ -145,8 +145,8 @@ /**

* @example
* import type { Mark, Props } from "astro-portabletext/types";
* type Greet = Mark<{ msg: string }>;
* const props = Astro.props as Props<Greet>;
* import type { Mark, Props as $ } from "astro-portabletext/types";
*
* export type Props = $<Mark<{ msg: string }>>;
*/
export interface Mark<MarkDef extends Record<string, any> | undefined = undefined> extends ToolkitNestedPortableTextSpan {
markDef: MarkDef extends Record<string, any> ? MarkDef & PortableTextMarkDefinition : undefined;
markDef: MarkDef & PortableTextMarkDefinition;
markKey: string;

@@ -153,0 +153,0 @@ }

{
"name": "astro-portabletext",
"version": "0.8.1",
"version": "0.9.0-next.0",
"type": "module",

@@ -5,0 +5,0 @@ "description": "Render Portable Text with Astro",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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