<?php

return [
    'sources' => [
        'filters' => [
            'before' => [
                'label' => 'Before',
                'description' => 'Add text before the content field.',
            ],
            'after' => [
                'label' => 'After',
                'description' => 'Add text after the content field.',
            ],
            'search' => [
                'label' => 'Search',
                'description' =>
                    'Select a predefined search pattern or enter a custom string or regular expression to search for. The regular expression has to be enclosed between slashes. For example `my-string` or `/ab+c/`.',
                'type' => 'data-list',
                'options' => [
                    'URL Protocol' => '/https?:\\/\\/(www\\.)?/',
                    'Hyphen and Underscore' => '/[\\-_]/',
                ],
            ],
            'replace' => [
                'label' => 'Replace',
                'description' =>
                    'Enter the replacement string which may contain references. If left empty, the search matches will be removed.',
            ],
            'transform' => [
                'label' => 'Transform Text',
                'description' => 'Select a predefined transform pattern',
                'type' => 'select',
                'options' => [
                    'None' => '',
                    'Uppercase' => 0,
                    'Lowercase' => 1,
                    'Title Case' => 2,
                ],
            ],
            'limit' => [
                'label' => 'Content Length',
                'description' =>
                    'Limit the content length to a number of characters. All HTML elements will be stripped.',
                'type' => 'number',
                'attrs' => [
                    'placeholder' => 'No limit.',
                ],
            ],
            'preserve' => [
                'type' => 'checkbox',
                'text' => 'Preserve words',
            ],
            'date' => [
                'label' => 'Date Format',
                'description' => 'Select a predefined date format or enter a custom format.',
                'type' => 'data-list',
                'default' => '',
                'options' => [
                    'Aug 6, 1999 (M j, Y)' => 'M j, Y',
                    'August 06, 1999 (F d, Y)' => 'F d, Y',
                    '08/06/1999 (m/d/Y)' => 'm/d/Y',
                    '08.06.1999 (m.d.Y)' => 'm.d.Y',
                    '6 Aug, 1999 (j M, Y)' => 'j M, Y',
                    'Tuesday, Aug 06 (l, M d)' => 'l, M d',
                    '15:00 (G:i)' => 'G:i',
                    '3:00 pm (g:i A)' => 'g:i a',
                    '1999-09-06 15:00:00' => 'Y-m-d H:i:s',
                ],
                'attrs' => [
                    'placeholder' => 'Default',
                ],
            ],
        ],
        'directives' => [
            'slice' => [
                'fields' => [
                    '_grid' => [
                        'description' => 'Set the starting point and limit the number of items.',
                        'type' => 'grid',
                        'width' => '1-2',
                        'fields' => [
                            'offset' => [
                                'label' => 'Start',
                                'type' => 'number',
                                'default' => 0,
                                'modifier' => 1,
                                'attrs' => [
                                    'min' => 1,
                                    'required' => true,
                                ],
                            ],
                            'limit' => [
                                'label' => 'Quantity',
                                'type' => 'limit',
                                'attrs' => [
                                    'placeholder' => 'No limit',
                                    'min' => 0,
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
        'conditionMultipleOptions' => [
            'label' => 'Source',
            'options' => [
                [
                    'text' => 'First Item',
                    'value' => '#first',
                ],
                [
                    'text' => 'Last Item',
                    'value' => '#last',
                ],
                [
                    'text' => 'Item Index',
                    'value' => '#index',
                ],
            ],
        ],
    ],
];
