#
# Twitter Card mixin
#
'Neos.Seo:TwitterCardMixin':
  abstract: true
  ui:
    inspector:
      groups:
        twittercard:
          label: i18n
          icon: 'icon-twitter'
          position: 400
          tab: seo
  properties:
    twitterCardType:
      type: string
      ui:
        label: i18n
        inspector:
          group: 'twittercard'
          editor: 'Neos.Neos/Inspector/Editors/SelectBoxEditor'
          editorOptions:
            allowEmpty: true
            placeholder: i18n
            values:
              summary:
                label: i18n
                icon: 'icon-square'
              summary_large_image:
                label: i18n
                icon: 'icon-image'
    twitterCardCreator:
      type: string
      ui:
        label: i18n
        inspector:
          group: 'twittercard'
          editorOptions:
            placeholder: i18n
      validation:
        'Neos.Neos/Validation/RegularExpressionValidator':
          regularExpression: '/^@[a-z0-9_]{1,15}$/i'
    twitterCardTitle:
      type: string
      ui:
        label: i18n
        inspector:
          group: 'twittercard'
          editor: 'Neos.Neos/Inspector/Editors/TextAreaEditor'
          editorOptions:
            placeholder: 'ClientEval: node.properties.openGraphTitle || node.properties.titleOverride || node.properties.title'
      validation:
        'Neos.Neos/Validation/StringLengthValidator':
          maximum: 70
    twitterCardDescription:
      type: string
      ui:
        label: i18n
        inspector:
          group: 'twittercard'
          editor: 'Neos.Neos/Inspector/Editors/TextAreaEditor'
          editorOptions:
            placeholder: 'ClientEval: node.properties.openGraphDescription || node.properties.metaDescription || "Neos.Seo:NodeTypes.TwitterCardMixin:properties.twitterCardDescription.textAreaEditor.placeholder"'
      validation:
        'Neos.Neos/Validation/StringLengthValidator':
          maximum: 200
    twitterCardImage:
      type: Neos\Media\Domain\Model\ImageInterface
      ui:
        label: i18n
        inspector:
          group: 'twittercard'
          editorOptions:
            features:
              crop: true
            crop:
              aspectRatio:
                options:
                  twoOne:
                    width: 1200
                    height: 600
                    label: 'Summary Card Large Image'
                  square:
                    width: 600
                    height: 600
                    label: 'Summary Card'
                  fourFive: ~
                  fiveSeven: ~
                  twoThree: ~
                  fourThree: ~
                  sixteenNine: ~
                enableOriginal: false
                allowCustom: false
                defaultOption: 'ClientEval: node.properties.twitterCardType == "summary_large_image" ? "twoOne" : "square"'
                forceCrop: true
