services:
  netzmacht.contao_form_designer.fallback_layout:
    class: Netzmacht\Contao\FormDesigner\Layout\ContaoFormLayout
    arguments:
      - '%netzmacht.contao_form_designer.widgets%'
      - '%netzmacht.contao_form_designer.defaults%'

  netzmacht.contao_form_designer.layout_manager:
    class: Netzmacht\Contao\FormDesigner\LayoutManager
    public: true
    arguments:
      - '@event_dispatcher'
      - '@netzmacht.contao_form_designer.fallback_layout'

  netzmacht.contao_form_designer.layout_factory:
    class: Netzmacht\Contao\FormDesigner\Factory\DelegatingFormLayoutFactory
    arguments:
      - []

  netzmacht.contao_form_designer.factory.default:
    class: Netzmacht\Contao\FormDesigner\Factory\StandardFormLayoutFactory
    arguments:
      - '%netzmacht.contao_form_designer.widgets%'
      - '%netzmacht.contao_form_designer.defaults%'
    tags:
      - { name: 'netzmacht.contao_form_designer.factory' }

  netzmacht.contao_form_designer.repository.form:
    class: Netzmacht\Contao\FormDesigner\Model\Form\ContaoFormRepository

  netzmacht.contao_form_designer.repository.layout:
    class: Netzmacht\Contao\FormDesigner\Model\FormLayout\ContaoFormLayoutRepository
    arguments:
      - '@database_connection'
