# Schema for the configuration files of the Navigation module.

navigation.settings:
  type: config_object
  label: 'Navigation settings'
  constraints:
    FullyValidatable: ~
  mapping:
    logo:
      type: mapping
      label: 'Logo settings'
      mapping:
        provider:
          type: string
          label: 'Select Navigation logo handling'
          constraints:
            Choice:
              choices:
                - default
                - hide
                - custom
        path:
          type: string
          label: 'Path'
          constraints:
            NotNull: [ ]
        max:
          type: mapping
          label: 'Logo maximum settings'
          mapping:
            filesize:
              type: integer
              label: 'Maximum file sizes (bytes)'
              constraints:
                NotNull: [ ]
                PositiveOrZero: ~
            height:
              type: integer
              label: 'Logo expected height'
              constraints:
                NotNull: [ ]
                PositiveOrZero: ~
            width:
              type: integer
              label: 'Logo expected width'
              constraints:
                NotNull: [ ]
                PositiveOrZero: ~
          constraints:
            ValidKeys: '<infer>'
      constraints:
        ValidKeys: '<infer>'

navigation.block_layout:
  type: config_object
  mapping:
    sections:
      type: sequence
      sequence:
        type: layout_builder.section

block.settings.navigation_menu:*:
  type: block_settings
  label: 'Menu block'
  mapping:
    level:
      type: integer
      label: 'Starting level'
    depth:
      type: integer
      label: 'Maximum number of levels'

block.settings.navigation_link:
  type: block_settings
  label: 'Link block'
  mapping:
    title:
      type: label
      label: 'Link title'
    uri:
      type: string
      label: 'URL'
    icon_class:
      type: string
      label: 'Icon CSS Class'
      constraints:
        Regex:
          pattern: '/^[a-z0-9_-]+$/'
          message: "The %value icon CSS class is not valid."
  constraints:
    FullyValidatable: ~
