This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugins.tsx
82 lines (71 loc) · 2.04 KB
/
plugins.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// ./plugins.tsx
import AlignmentControl from './components/tina/AlignmentControl'
import FillControl from './components/tina/FillControl'
import TypeControl from './components/tina/TypeControl'
import ImageControl from './components/tina/ImageControl'
import PaddingControl from './components/tina/PaddingControl'
import BorderControl from './components/tina/BorderControl'
import SelectField from './components/tina/SelectField'
import FeatureContentField from './components/tina/FeatureContentField'
import FeatureImageField from './components/tina/FeatureImageField'
import RuledTitle from './components/tina/RuledTitle'
import { TextField } from 'tinacms'
export const emailFieldPlugin = {
Component: TextField,
__type: 'field',
name: 'text-email',
validate: (email, allValues, meta, field) => {
let isValidEmail = /.*@.*\..*/.test(email)
if (!isValidEmail) return 'Invalid email address'
},
}
export const selectFieldPlugin = {
Component: SelectField,
__type: 'field',
name: 'selectField',
}
export const alignmentControlFieldPlugin = {
Component: AlignmentControl,
__type: 'field',
name: 'alignmentControl',
}
export const typeControlFieldPlugin = {
Component: TypeControl,
__type: 'field',
name: 'typeControl',
}
export const fillControlFieldPlugin = {
Component: FillControl,
__type: 'field',
name: 'fillControl',
}
export const imageControlFieldPlugin = {
Component: ImageControl,
__type: 'field',
name: 'imageControl',
}
export const paddingControlFieldPlugin = {
Component: PaddingControl,
__type: 'field',
name: 'paddingControl',
}
export const borderControlFieldPlugin = {
Component: BorderControl,
__type: 'field',
name: 'borderControl',
}
export const featureContentFieldPlugin = {
Component: FeatureContentField,
__type: 'field',
name: 'featureContentField',
}
export const featureImageFieldPlugin = {
Component: FeatureImageField,
__type: 'field',
name: 'featureImageField',
}
export const ruledTitlePlugin = {
Component: RuledTitle,
__type: 'field',
name: 'ruledTitle',
}