# Load default processing options
imports:
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
  - { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }
  #- { resource: 'EXT:rte_ckeditor/Configuration/RTE/Editor/LinkBrowser.yaml' }
  - { resource: "EXT:rte_ckeditor_image/Configuration/RTE/Plugin.yaml" }
# Additional optional TYPO3 specific configuration is available via ./Editor/LinkBrowser.yaml
# See https://docs.typo3.org/c/typo3/cms-rte-ckeditor/main/en-us/Configuration/Reference.html
#
# The keys typing.transformations.extra.from and htmlSupport.allow.name allow
# to have a special array with a key `pattern` that allows to specify Regular Expressions:
# - { from: { pattern: '(typoscript|TYPOScript|typo3script)$' }, to: 'TypoScript' }
# see https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/12.4.x/Important-104827-AllowToUseRegularExpressionsInCKEditorYAML.html
#
# Add configuration for the editor
# For complete documentation see https://ckeditor.com/docs/ckeditor5/latest/features/index.html
#
# exemples in :
# https://github.com/TYPO3/typo3/tree/13.4/typo3/sysext/rte_ckeditor/Configuration/RTE

editor:
  config:
    contentsCss:
      - "EXT:zab_site/Resources/Public/Dist/assets/editor.css"
    allowTags:
      - figure
      - iframe
    toolbar:
      items:
        - heading
        - style
        - "|"
        - bold
        - italic
        - underline
        - strikethrough
        # - specialCharacters
        - "|"
        - blockQuote
        - bulletedList
        - numberedList
        - alignment
        - "|"
        - link
        - insertImage
        - mediaEmbed
        - "|"
        - insertTable
        - TableProperties
        #- TableCellProperties
        #- '|'
        #- fontBackgroundColor
        #- fontColor
        #- fontSize
        - "|"
        - undo
        - redo
        - "|"
        - bookmark
        - removeFormat
        - showBlocks
        - sourceEditing

    heading:
      options:
        - { model: "paragraph", title: "Paragraph" }
        - { model: "heading1", view: "h1", title: "Heading 1" }
        - { model: "heading2", view: "h2", title: "Heading 2" }
        - { model: "heading3", view: "h3", title: "Heading 3" }
        - { model: "heading4", view: "h4", title: "Heading 4" }
        - { model: "heading5", view: "h5", title: "Heading 5" }
        - { model: "heading6", view: "h6", title: "Heading 6" }

    style:
      showPreview: false
      definitions:
        - { name: "Text Large", element: "p", classes: ["text-lg"] }
        - { name: "Button Primary", element: "a", classes: ["btn-primary"] }
        - { name: "Button Secondary", element: "a", classes: ["btn-secondary"] }
        - { name: "Button Link", element: "a", classes: ["btn-link"] }
        - {
            name: "Button Link External",
            element: "a",
            classes: ["btn-link-url"],
          }
        - { name: "Underline Mono", element: "a", classes: ["underline-mono"] }
        # - { name: 'Button Small', element: 'a', classes: ['btn-sm'] }

        # - { name: 'List Chevron', element: 'ul', classes: ['list-chevron'] }
        - { name: "List Check ul", element: "ul", classes: ["list-check"] }
        - { name: "List Uncheck ul", element: "ul", classes: ["list-uncheck"] }
        - {
            name: "List Extended Center",
            element: "ul",
            classes: ["list-extended"],
          }

        - { name: "List Style", element: "ol", classes: ["list-style"] }
        - { name: "List Check ol", element: "ol", classes: ["list-check"] }
        - { name: "List Uncheck ol", element: "ol", classes: ["list-uncheck"] }

        - { name: "Title (h4)", element: "span", classes: ["heading-4"] }
        - { name: "Title (h5)", element: "span", classes: ["heading-5"] }

    alignment:
      options:
        - { name: "left", className: "text-start" }
        - { name: "center", className: "text-center" }
        - { name: "right", className: "text-end" }
        - { name: "justify", className: "text-justify" }

    fontColor:
      colorPicker: false
      colors:
        - { label: "Tea Green", color: "#c9e2af" }
        - { label: "Columbia", color: "#c0e1eb" }
        - { label: "Feldspar", color: "#ffd6ad" }
        - { label: "Papaya", color: "#f9efd1" }

    fontBackgroundColor:
      colorPicker: true
      colors:
        - { label: "Tea Green", color: "#c9e2af" }
        - { label: "Columbia", color: "#c0e1eb" }
        - { label: "Feldspar", color: "#ffd6ad" }
        - { label: "Papaya", color: "#f9efd1" }

    table:
      tableProperties:
        colorPicker: false
        backgroundColors:
          - { label: "Gray", color: "#e9e9e9" }
          - { label: "Tea Green", color: "#c9e2af" }
          - { label: "Columbia", color: "#c0e1eb" }
          - { label: "Feldspar", color: "#ffd6ad" }
          - { label: "Papaya", color: "#f9efd1" }

    fontSize:
      options:
        - "default"
        - 18
        - 20
        #- 26
        #- 36
        #- 40
        #- 52

    importModules:
      - { module: "@ckeditor/ckeditor5-word-count", exports: ["WordCount"] }
      # Provides fontFamily, fontSize, fontColor, and fontBackgroundColor toolbar items
      - { module: "@ckeditor/ckeditor5-font", exports: ["Font"] }
      # Provides showBlocks toolbar item
      - { module: "@ckeditor/ckeditor5-show-blocks", exports: ["ShowBlocks"] }
      # Built via Vite + JavaScriptModules.php importmap
      - {
          module: "@zab-site/ckeditor5",
          exports: ["Bookmark", "MediaEmbed", /*'MediaClass'*/],
        }

    mediaEmbed:
      previewsInData: true
