Problem/Motivation

Today, forms are implemented with ComponentForm, nesting:

  • ComponentPropsForm, nesting:
    • ComponentPropForm
  • ComponentSlotsForm, nesting:
    • ComponentSlotForm

UI Patterns 2 has started as a SDC wrapper, however, SDC is not special anymore. SDC is only one source plugin for slots, alongside Icon, Layout, WYSIWYG… Not the only one with slots, and not the only one with props defined the JSON schema.

So, we need to make it generic.

Proposed resolution

  • Wrap ComponentSlotsForm in a SourceWithSlotsTrait
  • Wrap ComponentPropsForm in SourceWithPropsTrait

The hierarchy under SourceInterface becomes:

  • SourceWithChoicesInterface
  • SourceWithSlotsInterface & SourceWithSlotsTrait
    • ComponentSource
    • LayoutSource
  • NEW SourceWithPropsInterface with SourceWithSlotsTrait, compatible with all sources with settings defined as JSON schema:
    • ComponentSource
    • IconRenderableSource (in UI Icons for now)
    • "Code components", if we do them one day

Comments

pdureau created an issue.