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-07-31 15:03:46 -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-07-31 15:03:46 -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-07-31 15:03:46 -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,
|
|
|
|
},
|
|
|
|
description: {
|
|
|
|
type: 'string',
|
|
|
|
secondaryTypes: ['text', 'markdown'],
|
2017-01-19 13:44:40 -02: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: [],
|
2018-05-23 14:40:19 -04:00
|
|
|
synonyms: ['image', 'thumbnail', 'thumb', 'picture', 'avatar', 'photo', 'cover'],
|
2016-11-23 16:23:32 -02:00
|
|
|
defaultPreview: value => value,
|
|
|
|
fallbackToFirstField: false,
|
|
|
|
showError: false,
|
|
|
|
},
|
|
|
|
};
|