56 lines
1.4 KiB
TypeScript
56 lines
1.4 KiB
TypeScript
import {defineConfig, isDev} from 'sanity'
|
|
|
|
import {structureTool} from 'sanity/structure'
|
|
import {schemaTypes} from './schemaTypes'
|
|
import {structure} from './structure'
|
|
|
|
import {visionTool} from '@sanity/vision'
|
|
import {colorInput} from '@sanity/color-input'
|
|
import {imageHotspotArrayPlugin} from 'sanity-plugin-hotspot-array'
|
|
import {media, mediaAssetSource} from 'sanity-plugin-media'
|
|
import {customDocumentActions} from './plugins/customDocumentActions'
|
|
import {productReviewTemplates} from './schemaTypes/documents/productReviewTemplates'
|
|
import Navbar from './components/studio/Navbar'
|
|
|
|
const devOnlyPlugins = [visionTool()]
|
|
|
|
export default defineConfig({
|
|
name: 'default',
|
|
title: 'ABiiR',
|
|
|
|
projectId: '4dfq02gp',
|
|
dataset: 'production',
|
|
|
|
plugins: [
|
|
structureTool({structure}),
|
|
colorInput(),
|
|
imageHotspotArrayPlugin(),
|
|
customDocumentActions(),
|
|
media(),
|
|
...(isDev ? devOnlyPlugins : []),
|
|
],
|
|
|
|
schema: {
|
|
types: schemaTypes,
|
|
templates: (prev) => [...prev, ...productReviewTemplates],
|
|
},
|
|
|
|
form: {
|
|
file: {
|
|
assetSources: (previousAssetSources) => {
|
|
return previousAssetSources.filter((assetSource) => assetSource !== mediaAssetSource)
|
|
},
|
|
},
|
|
image: {
|
|
assetSources: (previousAssetSources) => {
|
|
return previousAssetSources.filter((assetSource) => assetSource === mediaAssetSource)
|
|
},
|
|
},
|
|
},
|
|
|
|
studio: {
|
|
components: {
|
|
navbar: Navbar,
|
|
},
|
|
},
|
|
}) |