table: directus_settings

fields:
  - field: id
    hidden: true

  - field: project_name
    interface: input
    options:
      iconRight: title
      placeholder: $t:field_options.directus_settings.project_name_placeholder
    translations:
      language: en-US
      translations: Name
    width: half

  - field: project_descriptor
    interface: input
    options:
      iconRight: title
      placeholder: $t:field_options.directus_settings.project_name_placeholder
    translations:
      language: en-US
      translations: Name
    width: half

  - field: project_url
    interface: input
    options:
      iconRight: link
      placeholder: https://example.com
    translations:
      language: en-US
      translations: Website
    width: full

  - field: branding_divider
    interface: presentation-divider
    options:
      icon: palette
      title: $t:fields.directus_settings.branding
    special:
      - alias
      - no-data
    width: full

  - field: project_color
    interface: select-color
    note: $t:field_options.directus_settings.project_color_note
    translations:
      language: en-US
      translations: Brand Color
    width: half

  - field: project_logo
    interface: file
    note: $t:field_options.directus_settings.project_logo_note
    translations:
      language: en-US
      translations: Brand Logo
    width: half

  - field: public_foreground
    interface: file
    translations:
      language: en-US
      translations: Login Foreground
    width: half

  - field: public_background
    interface: file
    translations:
      language: en-US
      translations: Login Background
    width: half

  - field: public_note
    interface: input
    options:
      placeholder: $t:field_options.directus_settings.public_note_placeholder
      iconRight: info
    width: full

  - field: custom_css
    interface: input-code
    options:
      language: css
      lineNumber: true
      template: |
        #app, #main-content {
          --border-radius-outline: 0px !important;
          --border-radius: 0px !important;
        }
    width: full

  - field: modules_divider
    interface: presentation-divider
    options:
      icon: menu_open
      title: $t:modules
    special:
      - alias
      - no-data
    width: full

  - field: module_bar
    interface: system-modules
    special: json

  - field: security_divider
    interface: presentation-divider
    options:
      icon: shield
      title: $t:security
    special:
      - alias
      - no-data
    width: full

  - field: auth_password_policy
    interface: select-dropdown
    options:
      choices:
        - value: null
          text: $t:field_options.directus_settings.auth_password_policy.none_text
        - value: '/^.{8,}$/'
          text: $t:field_options.directus_settings.auth_password_policy.weak_text
        - value: "/(?=^.{8,}$)(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&*()_+}{';'?>.<,])(?!.*\\s).*$/"
          text: $t:field_options.directus_settings.auth_password_policy.strong_text
      allowOther: true
    width: half

  - field: auth_login_attempts
    interface: input
    options:
      iconRight: lock
      placeholder: $t:unlimited
    width: half

  - field: files_divider
    interface: presentation-divider
    options:
      icon: folder
      title: $t:fields.directus_settings.files_and_thumbnails
    special:
      - alias
      - no-data
    width: full

  - field: storage_asset_transform
    interface: select-dropdown
    options:
      choices:
        - value: all
          text: $t:fields.directus_settings.transformations_all
        - value: none
          text: $t:fields.directus_settings.transformations_none
        - value: presets
          text: $t:fields.directus_settings.transformations_presets
    width: half

  - field: storage_default_folder
    interface: system-folder
    width: half
    note: $t:interfaces.system-folder.field_hint

  - field: storage_asset_presets
    interface: list
    options:
      fields:
        - field: key
          name: $t:key
          type: string
          schema:
            is_nullable: false
          meta:
            interface: input
            options:
              slug: true
              onlyOnCreate: false
            width: full
        - field: fit
          name: $t:field_options.directus_settings.storage_asset_presets.fit_label
          type: string
          schema:
            is_nullable: false
          meta:
            interface: select-dropdown
            options:
              choices:
                - value: contain
                  text: $t:field_options.directus_settings.storage_asset_presets.fit.contain_text
                - value: cover
                  text: $t:field_options.directus_settings.storage_asset_presets.fit.cover_text
                - value: inside
                  text: $t:field_options.directus_settings.storage_asset_presets.fit.fit_text
                - value: outside
                  text: $t:field_options.directus_settings.storage_asset_presets.fit.outside_text
            width: half
        - field: width
          name: $t:width
          type: integer
          schema:
            is_nullable: false
          meta:
            interface: input
            width: half
        - field: height
          name: $t:height
          type: integer
          schema:
            is_nullable: false
          meta:
            interface: input
            width: half
        - field: quality
          type: integer
          name: $t:quality
          schema:
            default_value: 80
            is_nullable: false
          meta:
            interface: slider
            options:
              max: 100
              min: 0
              step: 1
            width: half
        - field: withoutEnlargement
          name: $t:field_options.directus_settings.storage_asset_presets.upscaling
          type: boolean
          schema:
            default_value: false
          meta:
            interface: boolean
            width: half
            options:
              label: $t:no_upscale
        - field: format
          name: $t:format
          type: string
          schema:
            is_nullable: false
            default_value: ''
          meta:
            interface: select-dropdown
            options:
              allowNone: true
              choices:
                - value: jpeg
                  text: JPEG
                - value: png
                  text: PNG
                - value: webp
                  text: WebP
                - value: tiff
                  text: Tiff
            width: half
        - field: transforms
          name: $t:field_options.directus_settings.additional_transforms
          type: json
          schema:
            is_nullable: false
            default_value: []
          meta:
            note: $t:field_options.directus_settings.transforms_note

            interface: json
            options:
              template: >
                [
                  ["blur", 45],
                  ["grayscale"],
                  ["extend", { "right": 500, "background": "rgb(255, 0, 0)" }]
                ]
              placeholder: >
                [
                  ["blur", 45],
                  ["grayscale"],
                  ["extend", { "right": 500, "background": "rgb(255, 0, 0)" }]
                ]
            width: full
      template: '{{key}}'
    special: json
    width: full

  - field: map_divider
    interface: presentation-divider
    options:
      icon: map
      title: $t:fields.directus_settings.mapping
    special:
      - alias
      - no-data
    width: full

  - field: mapbox_key
    interface: input
    options:
      icon: key
      title: $t:field_options.directus_settings.mapbox_key
      placeholder: $t:field_options.directus_settings.mapbox_placeholder
      iconLeft: vpn_key
      font: monospace
    width: full

  - field: basemaps
    interface: list
    special: json
    options:
      template: '{{name}}'
      fields:
        - field: name
          name: $t:name
          schema:
            is_nullable: false
          meta:
            interface: text-input
            options:
              placeholder: $t:field_options.directus_settings.basemaps_name_placeholder
        - field: type
          name: $t:type
          meta:
            interface: select-dropdown
            options:
              choices:
                - value: raster
                  text: $t:field_options.directus_settings.basemaps_raster
                - value: tile
                  text: $t:field_options.directus_settings.basemaps_tile
                - value: style
                  text: $t:field_options.directus_settings.basemaps_style
        - field: url
          name: $t:url
          schema:
            is_nullable: false
          meta:
            interface: text-input
            options:
              placeholder: http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png
        - field: tileSize
          name: $t:tile_size
          type: integer
          schema:
            is_nullable: true
          meta:
            interface: input
            options:
              placeholder: '512'
            conditions:
              - name: typeNeqRaster
                rule:
                  type:
                    _neq: 'raster'
                hidden: true
        - field: attribution
          name: $t:fields.directus_settings.attribution
          type: string
          schema:
            is_nullable: true
          meta:
            interface: input
            options:
              placeholder: $t:fields.directus_settings.attribution_placeholder
