2016-11-23 16:23:32 -02:00
|
|
|
import React from 'react';
|
|
|
|
|
2018-05-25 10:15:01 -06:00
|
|
|
export const IDENTIFIER_FIELDS = ['title', 'path'];
|
|
|
|
|
2016-11-23 16:23:32 -02:00
|
|
|
export const INFERABLE_FIELDS = {
|
|
|
|
title: {
|
|
|
|
type: 'string',
|
|
|
|
secondaryTypes: [],
|
2017-01-19 13:44:40 -02:00
|
|
|
synonyms: ['title', 'name', 'label', 'headline', 'header'],
|
2018-08-07 14:46:54 -06:00
|
|
|
defaultPreview: value => <h1>{value}</h1>, // eslint-disable-line react/display-name
|
2016-11-23 16:23:32 -02:00
|
|
|
fallbackToFirstField: true,
|
|
|
|
showError: true,
|
|
|
|
},
|
|
|
|
shortTitle: {
|
|
|
|
type: 'string',
|
|
|
|
secondaryTypes: [],
|
2017-01-19 13:44:40 -02:00
|
|
|
synonyms: ['short_title', 'shortTitle', 'short'],
|
2018-08-07 14:46:54 -06:00
|
|
|
defaultPreview: value => <h2>{value}</h2>, // eslint-disable-line react/display-name
|
2016-11-23 16:23:32 -02:00
|
|
|
fallbackToFirstField: false,
|
|
|
|
showError: false,
|
|
|
|
},
|
|
|
|
author: {
|
|
|
|
type: 'string',
|
|
|
|
secondaryTypes: [],
|
2017-01-19 13:44:40 -02:00
|
|
|
synonyms: ['author', 'name', 'by', 'byline', 'owner'],
|
2018-08-07 14:46:54 -06:00
|
|
|
defaultPreview: value => <strong>{value}</strong>, // eslint-disable-line react/display-name
|
2016-11-23 16:23:32 -02:00
|
|
|
fallbackToFirstField: false,
|
|
|
|
showError: false,
|
|
|
|
},
|
2019-02-08 12:26:59 -05:00
|
|
|
date: {
|
|
|
|
type: 'datetime',
|
|
|
|
secondaryTypes: ['date'],
|
|
|
|
synonyms: ['date', 'publishDate', 'publish_date'],
|
|
|
|
defaultPreview: value => value,
|
|
|
|
fallbackToFirstField: false,
|
|
|
|
showError: false,
|
|
|
|
},
|
2016-11-23 16:23:32 -02:00
|
|
|
description: {
|
|
|
|
type: 'string',
|
|
|
|
secondaryTypes: ['text', 'markdown'],
|
2018-08-07 14:46:54 -06:00
|
|
|
synonyms: [
|
|
|
|
'shortDescription',
|
|
|
|
'short_description',
|
|
|
|
'shortdescription',
|
|
|
|
'description',
|
|
|
|
'intro',
|
|
|
|
'introduction',
|
|
|
|
'brief',
|
|
|
|
'content',
|
|
|
|
'biography',
|
|
|
|
'bio',
|
|
|
|
'summary',
|
|
|
|
],
|
2016-11-23 16:23:32 -02:00
|
|
|
defaultPreview: value => value,
|
|
|
|
fallbackToFirstField: false,
|
|
|
|
showError: false,
|
|
|
|
},
|
|
|
|
image: {
|
|
|
|
type: 'image',
|
|
|
|
secondaryTypes: [],
|
2020-03-26 19:23:31 +02:00
|
|
|
synonyms: [
|
|
|
|
'image',
|
|
|
|
'thumbnail',
|
|
|
|
'thumb',
|
|
|
|
'picture',
|
|
|
|
'avatar',
|
|
|
|
'photo',
|
|
|
|
'cover',
|
|
|
|
'hero',
|
|
|
|
'logo',
|
|
|
|
],
|
2016-11-23 16:23:32 -02:00
|
|
|
defaultPreview: value => value,
|
|
|
|
fallbackToFirstField: false,
|
|
|
|
showError: false,
|
|
|
|
},
|
|
|
|
};
|