-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
What problem does this address?
InnerBlocks Component gives us a lot of power and the existing options for templates and locking for instance are great. However I recently ran into a use case where I have a parent block using an InnerBlocks component and wanted to use the core/paragraph block as a child block. However the block's default allowedFormats from the Formats API allows for things like Inline Images that due to design limitations of this particular block don't make sense to allow due to space.
I could create my own custom Paragraph block but that doesn't seem great when the core Paragraph block is perfect if I could disable certain formats. I can do that via a filter on the block but if I want to allow Inline Images elsewhere then it gets more complicated and I suppose I'd have to have my filter of the core/paragraph block try to determine if this instance of the block is a child of my custom parent block.
What is your proposed solution?
Could we make it easier to modify allowedFormats option of RichText in nested child blocks for instance?
Could the allowedBlocks prop on InnerBlocks be expanded to allow for more than just an array of strings with the block names? Could you pass an object instead that specifies the allowed block and some options to be passed to the block in just that instance when it is nested in that InnerBlocks context?