I'm trying to write a document schema in Sanity which includes a multi-media "content blocks" field. This is currently defined as a block type field – an array type with the standard block subtype and additional custom subtypes for things like images (an image type with some extra fields) and embedded videos (an object type with various fields).
It's easy for me to attach extra data to the image and video block definitions for presentational purposes – e.g. a width dropdown which might have values of "normal" or "full-bleed". For the image subtype this is an extra field in the fields property; likewise adding to the video block subtype's fields property has the same effect.
However I also need a way to attach this sort of extra data to the standard block subtype, and it appears that there's no analogous way of adding extra fields to the schema. I wanted to confirm that this is actually the case and see if there are any other methods I should be aware of that might help me achieve this. For the sake of example let's say I want to add the same width property to my text blocks. Can this be done?
Would it be workable to try to implement this using styles somehow (i.e. wrapping the block in a style definition which triggered some behaviour on the front-end)? Or perhaps a custom annotation that's included somewhere in the block, to which this extra data could be piggybacked?
Thanks in advance!