<?php // $file = /home/bluedoor/www/dev/wp-content/plugins/yooessentials/modules/source/providers/GoogleSheet/config.json

return [
  'name' => 'google_sheet', 
  'title' => 'Google Sheet', 
  'description' => 'Source based on a Google Sheet spreadsheet.', 
  'group' => 'Structured Data', 
  'icon' => $filter->apply('url', '~yooessentials_url/modules/source/providers/GoogleSheet/icon.svg', $file), 
  'endpoints' => [
    'presave' => 'yooessentials/source/google-sheet'
  ], 
  'fields' => [
    'name' => [
      'label' => 'Name', 
      'description' => 'A name to identify this source.', 
      'attrs' => [
        'autofocus' => true, 
        'placeholder' => 'Google Sheet'
      ]
    ], 
    'account' => [
      'label' => 'Account', 
      'type' => 'yooessentials-connected-auth', 
      'connections' => [
        'google' => ['https://www.googleapis.com/auth/drive.readonly', 'https://www.googleapis.com/auth/spreadsheets.readonly']
      ], 
      'description' => 'The Google account which to authenticate with.'
    ], 
    'sheet_id' => [
      'label' => 'Spreadsheet', 
      'type' => 'yooessentials-select-dropdown-async', 
      'description' => 'The spreadsheet which to retrieve the data from.', 
      'watch' => 'account', 
      'endpoint' => 'yooessentials/source/google-sheet/spreadsheets'
    ], 
    'sheet_name' => [
      'label' => 'Sheet', 
      'description' => 'The spreadsheet sheet from which data to create the source.', 
      'type' => 'yooessentials-select-dropdown-async', 
      'endpoint' => 'yooessentials/source/google-sheet/sheets', 
      'watch' => 'sheet_id', 
      'placeholder' => 'Default'
    ], 
    '_columns' => [
      'description' => 'The range of columns to restricts the sheet data with.', 
      'type' => 'grid', 
      'width' => '1-2', 
      'fields' => [
        'start_column' => [
          'label' => 'Start Column', 
          'type' => 'text', 
          'attrs' => [
            'placeholder' => 'A'
          ]
        ], 
        'end_column' => [
          'label' => 'End Column', 
          'type' => 'text', 
          'attrs' => [
            'placeholder' => 'Z'
          ]
        ]
      ]
    ], 
    'cache_default' => $config->get('yooessentials.source.fields.cache_default_limited')
  ]
];
