Skip to content

Commit

Permalink
fix(schema definition): remove icon
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhg committed Dec 20, 2024
1 parent 0e0d52f commit b83c1e4
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions packages/editor/src/editor/define-schema.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import {Schema as SanitySchema} from '@sanity/schema'
import {
defineField,
defineType,
type BlockDecoratorDefinition,
type ObjectSchemaType,
} from '@sanity/types'
import {defineField, defineType, type ObjectSchemaType} from '@sanity/types'
import startCase from 'lodash.startcase'
import type {PortableTextMemberSchemaTypes} from '../types/editor'
import {createEditorSchema} from './create-editor-schema'
Expand All @@ -15,7 +10,6 @@ import {createEditorSchema} from './create-editor-schema'
export type BaseDefinition = {
name: string
title?: string
icon?: BlockDecoratorDefinition['icon']
}

/**
Expand Down Expand Up @@ -57,7 +51,6 @@ export function compileSchemaDefinition<
// fields to objects with the name `image`
name: blockObject.name === 'image' ? 'tmp-image' : blockObject.name,
title: blockObject.title,
icon: blockObject.icon,
fields: [],
}),
) ?? []
Expand All @@ -67,7 +60,6 @@ export function compileSchemaDefinition<
type: 'object',
name: inlineObject.name,
title: inlineObject.title,
icon: inlineObject.icon,
fields: [],
}),
) ?? []
Expand All @@ -86,27 +78,23 @@ export function compileSchemaDefinition<
definition?.decorators?.map((decorator) => ({
title: decorator.title ?? startCase(decorator.name),
value: decorator.name,
icon: decorator.icon,
})) ?? [],
annotations:
definition?.annotations?.map((annotation) => ({
name: annotation.name,
type: 'object',
title: annotation.title,
icon: annotation.icon,
})) ?? [],
},
lists:
definition?.lists?.map((list) => ({
value: list.name,
title: list.title ?? startCase(list.name),
icon: list.icon,
})) ?? [],
styles:
definition?.styles?.map((style) => ({
value: style.name,
title: style.title ?? startCase(style.name),
icon: style.icon,
})) ?? [],
},
],
Expand Down

0 comments on commit b83c1e4

Please sign in to comment.