1.0.0
Rich Text Resolver v1.0.0 release
No longer in beta, v1 release brings several new features as well as a number of breaking changes that need to be addressed for a successful upgrade.
Breaking changes
Types and interfaces
- all types are now pulled from @portabletext/types package
IPortableTextBaseItem
removed, all custom block types extend fromArbitraryTypedObject
insteadIPortableTextParagraph
removed, replaced withPortableTextStrictBlock
IPortableTextListBlock
removed, replaced withPortableTextStrictListItemBlock
IOutputResult
is nowParseResult
IPortableTextItem
is now calledPortableTextItem
, a union of two types:PortableTextObject
represents all top-level block types returned from the transform methodPortableTextInternalObject
represents nested portable text objects (references, marks etc.)
- all interfaces and types with capital
I
prefix were renamed without it
Methods
transformToPortableText
method now returnsPortableTextObject
resolveTable
now has two implementations, one for HTML and one for Vue, each in a corresponding util file
New features
Extending/modifying portable text blocks
A new traversePortableText
method goes through the whole subtree of a portable text object and applies a user-defined callback function on each node, allowing you to modify its properties or extend it with new ones. Readme
Default resolution
resolveImage
method added for HTML and Vue, allowing you to resolve customimage
_type blocks with your own resolution method or a default one (toHTMLImageDefault
andtoVueImageDefault
respectively)resolveTable
method reimplemented for HTML and Vue separately
Misc
- added missing type definitions, updated readme with properly typed examples
- added JSDoc comments to a large number of methods and types
- updated suggested Vue resolution package, added an example and related tests
- updated most of the dependencies
- TS:
Module
andModuleResolution
set toNodeNext
- newly using subpath exports
- subpath imports support to be added in subsequent versions
- named exports kept where necessary and for legacy purposes
- minor changes to transformation logic
What's Changed
- Release preparation by @pokornyd in #37
- Extend default resolution by @pokornyd in #39
- Unify interface naming conventions by @pokornyd in #42
- Bump follow-redirects from 1.15.3 to 1.15.5 by @dependabot in #41
Full Changelog: 0.0.5...1.0.0