-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuilder.config.js
More file actions
148 lines (142 loc) · 3.6 KB
/
Copy pathbuilder.config.js
File metadata and controls
148 lines (142 loc) · 3.6 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import { Builder } from '@builder.io/react'
import dynamic from 'next/dynamic'
Builder.registerComponent(
dynamic(() => import('./components/Card')),
{
name: 'Card',
image: 'https://tabler-icons.io/static/tabler-icons/icons-png/id-badge.png',
inputs: [
{
name: 'title',
type: 'string',
required: true,
defaultValue: 'I am a React + Tailwind component!',
},
{
name: 'description',
type: 'text',
defaultValue:
'You can find my source code at: https://github.com/BuilderIO/blog-example/blob/main/components/Card.js',
required: true,
},
{
name: 'imgSrc',
defaultValue:
'https://cdn.builder.io/api/v1/image/assets%2Fccda6c7abf4c4b8195aa67d47de420dd%2F784e7fa828bd440391e222589df3968c',
friendlyName: 'image',
type: 'file',
allowedFileTypes: ['png', 'jpg', 'webp'],
},
{
name: 'href',
friendlyName: 'link',
type: 'url',
},
],
}
)
Builder.registerComponent(
dynamic(() => import('./components/Pre')),
{
name: 'Code',
image: 'https://tabler-icons.io/static/tabler-icons/icons-png/code-asterix.png',
inputs: [
{
name: 'children',
friendlyName: 'code',
type: 'code',
options: {
language: 'javascript',
},
defaultValue: `const hello = 'world'`,
required: true,
},
],
}
)
Builder.registerComponent(
dynamic(() => import('./components/PageTitle')),
{
name: 'PageTitle',
image: 'https://tabler-icons.io/static/tabler-icons/icons-png/heading.png',
inputs: [
{
name: 'children',
friendlyName: 'title',
type: 'string',
required: true,
defaultValue: 'I am a React + Tailwind component!',
},
],
}
)
Builder.registerComponent(
dynamic(async () => (await import('./components/NewsletterForm')).BlogNewsletterForm),
{
name: 'NewsletterForm',
image: 'https://tabler-icons.io/static/tabler-icons/icons-png/mail-opened.png',
inputs: [{ name: 'title', type: 'string', defaultValue: 'Subscribe to the newsletter' }],
}
)
Builder.registerComponent(
dynamic(async () => (await import('./components/social-icons')).SocialIconRow),
{
name: 'SocialIcons',
image: 'https://tabler-icons.io/static/tabler-icons/icons-png/brand-twitter.png',
}
)
Builder.registerComponent(
dynamic(() => import('./components/TOCInline')),
{
name: 'TableOfContents',
image: 'https://tabler-icons.io/static/tabler-icons/icons-png/list.png',
inputs: [
{
name: 'toc',
friendlyName: 'contents',
type: 'list',
defaultValue: [
{
value: 'Hello world',
href: '#hello-world',
depth: 1,
},
],
subFields: [
{
name: 'value',
friendlyName: 'title',
type: 'string',
required: true,
defaultValue: 'Hello World',
},
{
name: 'url',
type: 'string',
defaultValue: '#hello-world',
required: true,
},
{
name: 'depth',
type: 'number',
defaultValue: 1,
step: 1,
min: 1,
max: 10,
},
],
},
],
}
)
Builder.register('insertMenu', {
name: 'Blog Post Components',
items: [
{ name: 'NewsletterForm' },
{ name: 'Card' },
{ name: 'Code' },
{ name: 'PageTitle' },
{ name: 'SocialIcons' },
{ name: 'TableOfContents' },
],
})