This is a Sanity Studio v3 plugin.
With this plugin, you can finally copy/paste referenced blocks in array
type of fields in Sanity Studio.
npm i @superside-oss/sanity-plugin-copy-paste
or
yarn add @superside-oss/sanity-plugin-copy-paste
Add it as a plugin in sanity.config.ts
(or .js):
import {defineConfig} from 'sanity'
import {copyPastePlugin} from '@superside-oss/sanity-plugin-copy-paste'
export default defineConfig({
//...
plugins: [copyPastePlugin()],
})
And then insert in any object you want as a field:
import {copyPaste} from '@superside-oss/sanity-plugin-copy-paste'
export default defineType({
// ...
fields: [
defineField(copyPaste),
// ...
],
})
MIT © Superside
This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.
See Testing a plugin in Sanity Studio on how to run this plugin with hot-reload in the studio.