@portabletext/react
Advanced tools
Comparing version 3.0.4 to 3.0.5
@@ -21,3 +21,3 @@ import type {ArbitraryTypedObject} from '@portabletext/types' | ||
parent: PortableTextReactComponents, | ||
overrides: PortableTextComponents | ||
overrides: PortableTextComponents, | ||
): PortableTextReactComponents | ||
@@ -30,3 +30,3 @@ | ||
nodeType: NodeType | ||
} | ||
}, | ||
) => void | ||
@@ -123,3 +123,3 @@ | ||
export declare interface PortableTextMarkComponentProps< | ||
M extends TypedObject = ArbitraryTypedObject | ||
M extends TypedObject = ArbitraryTypedObject, | ||
> { | ||
@@ -160,3 +160,3 @@ /** | ||
export declare interface PortableTextProps< | ||
B extends TypedObject = PortableTextBlock | ArbitraryTypedObject | ||
B extends TypedObject = PortableTextBlock | ArbitraryTypedObject, | ||
> { | ||
@@ -163,0 +163,0 @@ /** |
@@ -130,7 +130,7 @@ const _excluded = ["block", "list", "listItem", "marks", "types"], | ||
const getTemplate = (type, prop) => "[@portabletext/react] Unknown ".concat(type, ", specify a component for it in the `components.").concat(prop, "` prop"); | ||
const unknownTypeWarning = typeName => getTemplate("block type \"".concat(typeName, "\""), "types"); | ||
const unknownMarkWarning = markType => getTemplate("mark type \"".concat(markType, "\""), "marks"); | ||
const unknownBlockStyleWarning = blockStyle => getTemplate("block style \"".concat(blockStyle, "\""), "block"); | ||
const unknownListStyleWarning = listStyle => getTemplate("list style \"".concat(listStyle, "\""), "list"); | ||
const unknownListItemStyleWarning = listStyle => getTemplate("list item style \"".concat(listStyle, "\""), "listItem"); | ||
const unknownTypeWarning = typeName => getTemplate('block type "'.concat(typeName, '"'), "types"); | ||
const unknownMarkWarning = markType => getTemplate('mark type "'.concat(markType, '"'), "marks"); | ||
const unknownBlockStyleWarning = blockStyle => getTemplate('block style "'.concat(blockStyle, '"'), "block"); | ||
const unknownListStyleWarning = listStyle => getTemplate('list style "'.concat(listStyle, '"'), "list"); | ||
const unknownListItemStyleWarning = listStyle => getTemplate('list item style "'.concat(listStyle, '"'), "listItem"); | ||
function printWarning(message) { | ||
@@ -137,0 +137,0 @@ console.warn(message); |
@@ -134,7 +134,7 @@ 'use strict'; | ||
const getTemplate = (type, prop) => "[@portabletext/react] Unknown ".concat(type, ", specify a component for it in the `components.").concat(prop, "` prop"); | ||
const unknownTypeWarning = typeName => getTemplate("block type \"".concat(typeName, "\""), "types"); | ||
const unknownMarkWarning = markType => getTemplate("mark type \"".concat(markType, "\""), "marks"); | ||
const unknownBlockStyleWarning = blockStyle => getTemplate("block style \"".concat(blockStyle, "\""), "block"); | ||
const unknownListStyleWarning = listStyle => getTemplate("list style \"".concat(listStyle, "\""), "list"); | ||
const unknownListItemStyleWarning = listStyle => getTemplate("list item style \"".concat(listStyle, "\""), "listItem"); | ||
const unknownTypeWarning = typeName => getTemplate('block type "'.concat(typeName, '"'), "types"); | ||
const unknownMarkWarning = markType => getTemplate('mark type "'.concat(markType, '"'), "marks"); | ||
const unknownBlockStyleWarning = blockStyle => getTemplate('block style "'.concat(blockStyle, '"'), "block"); | ||
const unknownListStyleWarning = listStyle => getTemplate('list style "'.concat(listStyle, '"'), "list"); | ||
const unknownListItemStyleWarning = listStyle => getTemplate('list item style "'.concat(listStyle, '"'), "listItem"); | ||
function printWarning(message) { | ||
@@ -141,0 +141,0 @@ console.warn(message); |
{ | ||
"name": "@portabletext/react", | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"description": "Render Portable Text with React", | ||
@@ -25,4 +25,4 @@ "keywords": [ | ||
"node": { | ||
"import": "./dist/react-portable-text.cjs.mjs", | ||
"require": "./dist/react-portable-text.js" | ||
"module": "./dist/react-portable-text.esm.js", | ||
"import": "./dist/react-portable-text.cjs.mjs" | ||
}, | ||
@@ -123,10 +123,10 @@ "import": "./dist/react-portable-text.esm.js", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.20.7", | ||
"@commitlint/cli": "^17.6.6", | ||
"@commitlint/config-conventional": "^17.6.6", | ||
"@sanity/pkg-utils": "^2.3.3", | ||
"@sanity/semantic-release-preset": "^4.1.1", | ||
"@sanity/ui": "^1.6.0", | ||
"@commitlint/cli": "^17.7.1", | ||
"@commitlint/config-conventional": "^17.7.0", | ||
"@sanity/pkg-utils": "^2.4.8", | ||
"@sanity/semantic-release-preset": "^4.1.3", | ||
"@sanity/ui": "^1.7.10", | ||
"@types/leaflet": "^1.9.3", | ||
"@types/react": "^18.2.14", | ||
"@types/react-dom": "^18.2.6", | ||
"@types/react": "^18.2.21", | ||
"@types/react-dom": "^18.2.7", | ||
"@types/refractor": "^3.0.2", | ||
@@ -136,18 +136,18 @@ "@types/styled-components": "^5.1.26", | ||
"@types/ws": "^8.5.5", | ||
"@typescript-eslint/eslint-plugin": "^5.60.1", | ||
"@typescript-eslint/parser": "^5.60.1", | ||
"@vitejs/plugin-react": "^4.0.1", | ||
"@typescript-eslint/eslint-plugin": "^5.62.0", | ||
"@typescript-eslint/parser": "^5.62.0", | ||
"@vitejs/plugin-react": "^4.0.4", | ||
"commitizen": "^4.3.0", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"esbuild": "^0.18.9", | ||
"esbuild": "^0.19.2", | ||
"esbuild-register": "^3.4.2", | ||
"eslint": "^8.43.0", | ||
"eslint-config-prettier": "^8.8.0", | ||
"eslint": "^8.47.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-config-sanity": "^6.0.0", | ||
"eslint-plugin-react": "^7.32.2", | ||
"eslint-plugin-react": "^7.33.2", | ||
"husky": "^8.0.3", | ||
"leaflet": "^1.9.4", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^2.8.8", | ||
"prettier-plugin-packagejson": "^2.4.3", | ||
"prettier": "^3.0.2", | ||
"prettier-plugin-packagejson": "^2.4.5", | ||
"react": "^18.2.0", | ||
@@ -161,7 +161,7 @@ "react-dom": "^18.2.0", | ||
"rollup-plugin-visualizer": "^5.9.2", | ||
"semantic-release": "^21.0.5", | ||
"semantic-release": "^21.0.9", | ||
"styled-components": "^5.3.11", | ||
"tap": "^16.3.7", | ||
"typescript": "^5.1.3", | ||
"vite": "^4.3.9" | ||
"tap": "^16.3.8", | ||
"typescript": "^5.1.6", | ||
"vite": "^4.4.9" | ||
}, | ||
@@ -171,3 +171,3 @@ "peerDependencies": { | ||
}, | ||
"packageManager": "pnpm@8.6.3", | ||
"packageManager": "pnpm@8.6.12", | ||
"engines": { | ||
@@ -174,0 +174,0 @@ "node": "^14.13.1 || >=16.0.0" |
@@ -11,17 +11,17 @@ # @portabletext/react | ||
* [Installation](#installation) | ||
* [Basic usage](#basic-usage) | ||
* [Styling](#styling-the-output) | ||
* [Customizing components](#customizing-components) | ||
* [Available components](#available-components) | ||
* [types](#types) | ||
* [marks](#marks) | ||
* [block](#block) | ||
* [list](#list) | ||
* [listItem](#listItem) | ||
* [hardBreak](#hardBreak) | ||
* [unknown components](#unknownMark) | ||
* [Disable warnings / Handling unknown types](#disabling-warnings--handling-unknown-types) | ||
* [Rendering Plain Text](#rendering-plain-text) | ||
* [Typing Portable Text](#typing-portable-text) | ||
- [Installation](#installation) | ||
- [Basic usage](#basic-usage) | ||
- [Styling](#styling-the-output) | ||
- [Customizing components](#customizing-components) | ||
- [Available components](#available-components) | ||
- [types](#types) | ||
- [marks](#marks) | ||
- [block](#block) | ||
- [list](#list) | ||
- [listItem](#listItem) | ||
- [hardBreak](#hardBreak) | ||
- [unknown components](#unknownMark) | ||
- [Disable warnings / Handling unknown types](#disabling-warnings--handling-unknown-types) | ||
- [Rendering Plain Text](#rendering-plain-text) | ||
- [Typing Portable Text](#typing-portable-text) | ||
@@ -347,3 +347,3 @@ ## Installation | ||
S extends string = PortableTextBlockStyle, | ||
L extends string = PortableTextListItemType | ||
L extends string = PortableTextListItemType, | ||
> {} | ||
@@ -355,3 +355,2 @@ ``` | ||
```ts | ||
import {PortableTextBlock, PortableTextMarkDefinition, PortableTextSpan} from '@portabletext/types' | ||
@@ -405,3 +404,2 @@ | ||
// TYPE FOR PORTABLE TEXT FIELD ITEMS | ||
@@ -408,0 +406,0 @@ type PortableTextFieldType = CustomPortableTextBlock | MyCustomBlock |
@@ -5,3 +5,3 @@ import type {PortableTextReactComponents, PortableTextComponents} from '../types' | ||
parent: PortableTextReactComponents, | ||
overrides: PortableTextComponents | ||
overrides: PortableTextComponents, | ||
): PortableTextReactComponents { | ||
@@ -24,3 +24,3 @@ const {block, list, listItem, marks, types, ...rest} = overrides | ||
overrides: PortableTextComponents, | ||
key: 'block' | 'list' | 'listItem' | 'marks' | 'types' | ||
key: 'block' | 'list' | 'listItem' | 'marks' | 'types', | ||
): PortableTextReactComponents[typeof key] { | ||
@@ -27,0 +27,0 @@ const override = overrides[key] |
@@ -22,3 +22,3 @@ import type {ComponentType, ReactNode} from 'react' | ||
export interface PortableTextProps< | ||
B extends TypedObject = PortableTextBlock | ArbitraryTypedObject | ||
B extends TypedObject = PortableTextBlock | ArbitraryTypedObject, | ||
> { | ||
@@ -291,3 +291,3 @@ /** | ||
message: string, | ||
options: {type: string; nodeType: NodeType} | ||
options: {type: string; nodeType: NodeType}, | ||
) => void | ||
@@ -294,0 +294,0 @@ |
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
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
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
142647
1981
413