-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathstrapi-admin.js
91 lines (87 loc) · 2.28 KB
/
strapi-admin.js
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
83
84
85
86
87
88
89
90
91
import React from 'react';
import styled from 'styled-components';
import { Icon } from '@strapi/design-system/Icon';
import { Flex } from '@strapi/design-system/Flex';
import OakIcon from './lib/Icon';
const IconBox = styled(Flex)`
background-color: #f0f0ff;
border: 1px solid #d9d8ff;
padding: 1px;
`;
export default {
register (app) {
app.createHook('oak:addons:add');
app.customFields.register({
name: 'oak',
pluginId: 'oak',
type: 'text',
icon: () => (
<IconBox
justifyContent="center"
alignItems="center"
width={7}
height={6}
hasRadius
>
<Icon as={OakIcon} />
</IconBox>
),
intlLabel: {
id: 'oak.field.builder.label',
defaultMessage: 'Oak content',
},
intlDescription: {
id: 'oak.field.builder.description',
defaultMessage: 'A field to build content with Oak',
},
components: {
Input: () => import('./lib/BuilderField'),
},
options: {
base: [{
intlLabel: {
id: 'oak.options.editor.label',
defaultMessage: 'Choose editor',
},
description: {
id: 'oak.options.editor.description',
defaultMessage: 'Select a text editor',
},
name: 'options.editor',
type: 'select',
options: [{
key: 'ckeditor',
value: 'ckeditor',
metadatas: {
intlLabel: {
id: 'oak.options.editor.ckeditor.label',
defaultMessage: 'CKEditor 5',
},
},
}, {
key: 'remirror',
value: 'remirror',
metadatas: {
intlLabel: {
id: 'oak.options.editor.remirror.label',
defaultMessage: 'Remirror',
},
},
}],
}],
advanced: [{
intlLabel: {
id: 'oak.options.debug.label',
defaultMessage: 'Debug mode',
},
description: {
id: 'oak.options.debug.description',
defaultMessage: 'Enable debug mode',
},
name: 'options.debug',
type: 'checkbox',
}],
},
});
},
};