Sanity Studio v4.22.0: Smart typography in the Portable Text Editor, and minor bugfixes

Smart typography in the Portable Text Editor

Sanity Studio’s Portable Text Editor includes the @portabletext/plugin-typography plugin. This transforms common characters into their nicer equivalents: double hyphens(--) into em dashes (—), "straight quotes" becomes “smart quotes,” and more. You can enable smart typography globally by enabling it in sanity.config.ts, or field-by-field basis.

export default defineConfig({
// ... rest of config,
form: {
components: {
portableText: {
plugins: (props) => {
return props.renderDefault({
...props,
plugins: {
...props.plugins,
typography: {
enabled: true
}
}
})
}
},
},
}
})

For the full list of behaviors and configuration options, go to the Portable Text Editor for Sanity Studio documentation.

Notable bugfixes

Fixes unique key errors when deleting and reverting objects in the middle of an array.

Fixes resolution of @sanity/vision in pnpm projects with enableGlobalVirtualStore set to true (thanks RJWadley for the fix!)

Fixes toolbar style selection states (like strikethrough) not displaying when the Portable Text Toolbar is collapsed into a dropdown menu

Fixes backward text selection breaking across blocks in fullscreen Portable Text inputs

sanity no longer show a warning if deployment.appId is missing from sanity.cli.ts

Fixes --replace and --missing flags for sanity dataset import to correctly handle release system documents. Previously, these flags only affected regular documents, causing “there is already a release with that ID” errors even when --replace was specified.

Restores the delete document action to draft documents. This action deletes all versions of the document, including published and draft.

Fixes an issue where studios with no plugins incorrectly redirecting to the content releases or scheduled drafts screens.

Fixes studios embedded in Next.js throwing errors like this:

Package jsdom can't be external
The request jsdom matches serverExternalPackages (or the default list).
The package resolves to a different version when requested from the project directory (26.1.0) compared to the package requested from the importing module (27.1.0).
Make sure to install the same version of the package in both locations.