@payloadcms/plugin-form-builder 3.0.0-beta.9 → 3.0.0-beta.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/collections/FormSubmissions/hooks/createCharge.d.ts +3 -0
- package/dist/collections/FormSubmissions/hooks/createCharge.d.ts.map +1 -0
- package/dist/collections/FormSubmissions/hooks/createCharge.js.map +1 -1
- package/dist/collections/FormSubmissions/hooks/sendEmail.d.ts +6 -0
- package/dist/collections/FormSubmissions/hooks/sendEmail.d.ts.map +1 -0
- package/dist/collections/FormSubmissions/hooks/sendEmail.js +5 -6
- package/dist/collections/FormSubmissions/hooks/sendEmail.js.map +1 -1
- package/dist/collections/FormSubmissions/index.d.ts +4 -0
- package/dist/collections/FormSubmissions/index.d.ts.map +1 -0
- package/dist/collections/FormSubmissions/index.js +64 -62
- package/dist/collections/FormSubmissions/index.js.map +1 -1
- package/dist/collections/Forms/DynamicFieldSelector.d.ts +6 -0
- package/dist/collections/Forms/DynamicFieldSelector.d.ts.map +1 -0
- package/dist/collections/Forms/DynamicFieldSelector.js +7 -6
- package/dist/collections/Forms/DynamicFieldSelector.js.map +1 -1
- package/dist/collections/Forms/DynamicPriceSelector.d.ts +4 -0
- package/dist/collections/Forms/DynamicPriceSelector.d.ts.map +1 -0
- package/dist/collections/Forms/DynamicPriceSelector.js +24 -15
- package/dist/collections/Forms/DynamicPriceSelector.js.map +1 -1
- package/dist/collections/Forms/fields.d.ts +6 -0
- package/dist/collections/Forms/fields.d.ts.map +1 -0
- package/dist/collections/Forms/fields.js +2 -5
- package/dist/collections/Forms/fields.js.map +1 -1
- package/dist/collections/Forms/index.d.ts +4 -0
- package/dist/collections/Forms/index.d.ts.map +1 -0
- package/dist/collections/Forms/index.js +149 -145
- package/dist/collections/Forms/index.js.map +1 -1
- package/dist/exports/client.d.ts +3 -0
- package/dist/exports/client.d.ts.map +1 -0
- package/dist/exports/client.js +4 -0
- package/dist/exports/client.js.map +1 -0
- package/dist/exports/types.d.ts +2 -0
- package/dist/exports/types.d.ts.map +1 -0
- package/dist/exports/types.js +3 -0
- package/dist/exports/types.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -16
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +184 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js.map +1 -1
- package/dist/utilities/getPaymentTotal.d.ts +5 -0
- package/dist/utilities/getPaymentTotal.d.ts.map +1 -0
- package/dist/utilities/getPaymentTotal.js.map +1 -1
- package/dist/utilities/lexical/converters/heading.d.ts +3 -0
- package/dist/utilities/lexical/converters/heading.d.ts.map +1 -0
- package/dist/utilities/lexical/converters/heading.js.map +1 -1
- package/dist/utilities/lexical/converters/linebreak.d.ts +3 -0
- package/dist/utilities/lexical/converters/linebreak.d.ts.map +1 -0
- package/dist/utilities/lexical/converters/linebreak.js.map +1 -1
- package/dist/utilities/lexical/converters/link.d.ts +3 -0
- package/dist/utilities/lexical/converters/link.d.ts.map +1 -0
- package/dist/utilities/lexical/converters/link.js.map +1 -1
- package/dist/utilities/lexical/converters/list.d.ts +4 -0
- package/dist/utilities/lexical/converters/list.d.ts.map +1 -0
- package/dist/utilities/lexical/converters/list.js.map +1 -1
- package/dist/utilities/lexical/converters/paragraph.d.ts +3 -0
- package/dist/utilities/lexical/converters/paragraph.d.ts.map +1 -0
- package/dist/utilities/lexical/converters/paragraph.js.map +1 -1
- package/dist/utilities/lexical/converters/quote.d.ts +3 -0
- package/dist/utilities/lexical/converters/quote.d.ts.map +1 -0
- package/dist/utilities/lexical/converters/quote.js.map +1 -1
- package/dist/utilities/lexical/converters/text.d.ts +3 -0
- package/dist/utilities/lexical/converters/text.d.ts.map +1 -0
- package/dist/utilities/lexical/converters/text.js.map +1 -1
- package/dist/utilities/lexical/defaultConverters.d.ts +3 -0
- package/dist/utilities/lexical/defaultConverters.d.ts.map +1 -0
- package/dist/utilities/lexical/defaultConverters.js.map +1 -1
- package/dist/utilities/lexical/nodeFormat.d.ts +39 -0
- package/dist/utilities/lexical/nodeFormat.d.ts.map +1 -0
- package/dist/utilities/lexical/nodeFormat.js.map +1 -1
- package/dist/utilities/lexical/serializeLexical.d.ts +9 -0
- package/dist/utilities/lexical/serializeLexical.d.ts.map +1 -0
- package/dist/utilities/lexical/serializeLexical.js.map +1 -1
- package/dist/utilities/lexical/types.d.ts +14 -0
- package/dist/utilities/lexical/types.d.ts.map +1 -0
- package/dist/utilities/lexical/types.js.map +1 -1
- package/dist/utilities/replaceDoubleCurlys.d.ts +8 -0
- package/dist/utilities/replaceDoubleCurlys.d.ts.map +1 -0
- package/dist/utilities/replaceDoubleCurlys.js.map +1 -1
- package/dist/utilities/slate/serializeSlate.d.ts +12 -0
- package/dist/utilities/slate/serializeSlate.d.ts.map +1 -0
- package/dist/utilities/slate/serializeSlate.js.map +1 -1
- package/package.json +53 -40
- package/src/index.ts +0 -55
- package/types.d.ts +0 -1
- package/types.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { deepMergeWithSourceArrays } from 'payload';
|
|
2
2
|
import { fields } from './fields.js';
|
|
3
3
|
// all settings can be overridden by the config
|
|
4
4
|
export const generateFormCollection = (formConfig)=>{
|
|
@@ -53,6 +53,151 @@ export const generateFormCollection = (formConfig)=>{
|
|
|
53
53
|
condition: (_, siblingData)=>siblingData?.type === 'custom'
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
+
const defaultFields = [
|
|
57
|
+
{
|
|
58
|
+
name: 'title',
|
|
59
|
+
type: 'text',
|
|
60
|
+
required: true
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'fields',
|
|
64
|
+
type: 'blocks',
|
|
65
|
+
blocks: Object.entries(formConfig?.fields || {}).map(([fieldKey, fieldConfig])=>{
|
|
66
|
+
// let the config enable/disable fields with either boolean values or objects
|
|
67
|
+
if (fieldConfig !== false) {
|
|
68
|
+
const block = fields[fieldKey];
|
|
69
|
+
if (block === undefined && typeof fieldConfig === 'object') {
|
|
70
|
+
return fieldConfig;
|
|
71
|
+
}
|
|
72
|
+
if (typeof block === 'object' && typeof fieldConfig === 'object') {
|
|
73
|
+
return deepMergeWithSourceArrays(block, fieldConfig);
|
|
74
|
+
}
|
|
75
|
+
if (typeof block === 'function') {
|
|
76
|
+
return block(fieldConfig);
|
|
77
|
+
}
|
|
78
|
+
return block;
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}).filter(Boolean)
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'submitButtonLabel',
|
|
85
|
+
type: 'text',
|
|
86
|
+
localized: true
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: 'confirmationType',
|
|
90
|
+
type: 'radio',
|
|
91
|
+
admin: {
|
|
92
|
+
description: 'Choose whether to display an on-page message or redirect to a different page after they submit the form.',
|
|
93
|
+
layout: 'horizontal'
|
|
94
|
+
},
|
|
95
|
+
defaultValue: 'message',
|
|
96
|
+
options: [
|
|
97
|
+
{
|
|
98
|
+
label: 'Message',
|
|
99
|
+
value: 'message'
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
label: 'Redirect',
|
|
103
|
+
value: 'redirect'
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: 'confirmationMessage',
|
|
109
|
+
type: 'richText',
|
|
110
|
+
admin: {
|
|
111
|
+
condition: (_, siblingData)=>siblingData?.confirmationType === 'message'
|
|
112
|
+
},
|
|
113
|
+
localized: true,
|
|
114
|
+
required: true
|
|
115
|
+
},
|
|
116
|
+
redirect,
|
|
117
|
+
{
|
|
118
|
+
name: 'emails',
|
|
119
|
+
type: 'array',
|
|
120
|
+
admin: {
|
|
121
|
+
description: "Send custom emails when the form submits. Use comma separated lists to send the same email to multiple recipients. To reference a value from this form, wrap that field's name with double curly brackets, i.e. {{firstName}}."
|
|
122
|
+
},
|
|
123
|
+
fields: [
|
|
124
|
+
{
|
|
125
|
+
type: 'row',
|
|
126
|
+
fields: [
|
|
127
|
+
{
|
|
128
|
+
name: 'emailTo',
|
|
129
|
+
type: 'text',
|
|
130
|
+
admin: {
|
|
131
|
+
placeholder: '"Email Sender" <sender@email.com>',
|
|
132
|
+
width: '100%'
|
|
133
|
+
},
|
|
134
|
+
label: 'Email To'
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: 'cc',
|
|
138
|
+
type: 'text',
|
|
139
|
+
admin: {
|
|
140
|
+
style: {
|
|
141
|
+
maxWidth: '50%'
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
label: 'CC'
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: 'bcc',
|
|
148
|
+
type: 'text',
|
|
149
|
+
admin: {
|
|
150
|
+
style: {
|
|
151
|
+
maxWidth: '50%'
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
label: 'BCC'
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
type: 'row',
|
|
160
|
+
fields: [
|
|
161
|
+
{
|
|
162
|
+
name: 'replyTo',
|
|
163
|
+
type: 'text',
|
|
164
|
+
admin: {
|
|
165
|
+
placeholder: '"Reply To" <reply-to@email.com>',
|
|
166
|
+
width: '50%'
|
|
167
|
+
},
|
|
168
|
+
label: 'Reply To'
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: 'emailFrom',
|
|
172
|
+
type: 'text',
|
|
173
|
+
admin: {
|
|
174
|
+
placeholder: '"Email From" <email-from@email.com>',
|
|
175
|
+
width: '50%'
|
|
176
|
+
},
|
|
177
|
+
label: 'Email From'
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: 'subject',
|
|
183
|
+
type: 'text',
|
|
184
|
+
defaultValue: "You've received a new message.",
|
|
185
|
+
label: 'Subject',
|
|
186
|
+
localized: true,
|
|
187
|
+
required: true
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: 'message',
|
|
191
|
+
type: 'richText',
|
|
192
|
+
admin: {
|
|
193
|
+
description: 'Enter the message that should be sent in this email.'
|
|
194
|
+
},
|
|
195
|
+
label: 'Message',
|
|
196
|
+
localized: true
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
];
|
|
56
201
|
const config = {
|
|
57
202
|
...formConfig?.formOverrides || {},
|
|
58
203
|
slug: formConfig?.formOverrides?.slug || 'forms',
|
|
@@ -65,150 +210,9 @@ export const generateFormCollection = (formConfig)=>{
|
|
|
65
210
|
useAsTitle: 'title',
|
|
66
211
|
...formConfig?.formOverrides?.admin || {}
|
|
67
212
|
},
|
|
68
|
-
fields:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
type: 'text',
|
|
72
|
-
required: true
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: 'fields',
|
|
76
|
-
type: 'blocks',
|
|
77
|
-
blocks: Object.entries(formConfig?.fields || {}).map(([fieldKey, fieldConfig])=>{
|
|
78
|
-
// let the config enable/disable fields with either boolean values or objects
|
|
79
|
-
if (fieldConfig !== false) {
|
|
80
|
-
const block = fields[fieldKey];
|
|
81
|
-
if (block === undefined && typeof fieldConfig === 'object') {
|
|
82
|
-
return fieldConfig;
|
|
83
|
-
}
|
|
84
|
-
if (typeof block === 'object' && typeof fieldConfig === 'object') {
|
|
85
|
-
return merge(block, fieldConfig, {
|
|
86
|
-
arrayMerge: (_, sourceArray)=>sourceArray
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
if (typeof block === 'function') {
|
|
90
|
-
return block(fieldConfig);
|
|
91
|
-
}
|
|
92
|
-
return block;
|
|
93
|
-
}
|
|
94
|
-
return null;
|
|
95
|
-
}).filter(Boolean)
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
name: 'submitButtonLabel',
|
|
99
|
-
type: 'text',
|
|
100
|
-
localized: true
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
name: 'confirmationType',
|
|
104
|
-
type: 'radio',
|
|
105
|
-
admin: {
|
|
106
|
-
description: 'Choose whether to display an on-page message or redirect to a different page after they submit the form.',
|
|
107
|
-
layout: 'horizontal'
|
|
108
|
-
},
|
|
109
|
-
defaultValue: 'message',
|
|
110
|
-
options: [
|
|
111
|
-
{
|
|
112
|
-
label: 'Message',
|
|
113
|
-
value: 'message'
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
label: 'Redirect',
|
|
117
|
-
value: 'redirect'
|
|
118
|
-
}
|
|
119
|
-
]
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: 'confirmationMessage',
|
|
123
|
-
type: 'richText',
|
|
124
|
-
admin: {
|
|
125
|
-
condition: (_, siblingData)=>siblingData?.confirmationType === 'message'
|
|
126
|
-
},
|
|
127
|
-
localized: true,
|
|
128
|
-
required: true
|
|
129
|
-
},
|
|
130
|
-
redirect,
|
|
131
|
-
{
|
|
132
|
-
name: 'emails',
|
|
133
|
-
type: 'array',
|
|
134
|
-
admin: {
|
|
135
|
-
description: "Send custom emails when the form submits. Use comma separated lists to send the same email to multiple recipients. To reference a value from this form, wrap that field's name with double curly brackets, i.e. {{firstName}}."
|
|
136
|
-
},
|
|
137
|
-
fields: [
|
|
138
|
-
{
|
|
139
|
-
type: 'row',
|
|
140
|
-
fields: [
|
|
141
|
-
{
|
|
142
|
-
name: 'emailTo',
|
|
143
|
-
type: 'text',
|
|
144
|
-
admin: {
|
|
145
|
-
placeholder: '"Email Sender" <sender@email.com>',
|
|
146
|
-
width: '100%'
|
|
147
|
-
},
|
|
148
|
-
label: 'Email To'
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
name: 'cc',
|
|
152
|
-
type: 'text',
|
|
153
|
-
admin: {
|
|
154
|
-
width: '50%'
|
|
155
|
-
},
|
|
156
|
-
label: 'CC'
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
name: 'bcc',
|
|
160
|
-
type: 'text',
|
|
161
|
-
admin: {
|
|
162
|
-
width: '50%'
|
|
163
|
-
},
|
|
164
|
-
label: 'BCC'
|
|
165
|
-
}
|
|
166
|
-
]
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
type: 'row',
|
|
170
|
-
fields: [
|
|
171
|
-
{
|
|
172
|
-
name: 'replyTo',
|
|
173
|
-
type: 'text',
|
|
174
|
-
admin: {
|
|
175
|
-
placeholder: '"Reply To" <reply-to@email.com>',
|
|
176
|
-
width: '50%'
|
|
177
|
-
},
|
|
178
|
-
label: 'Reply To'
|
|
179
|
-
},
|
|
180
|
-
{
|
|
181
|
-
name: 'emailFrom',
|
|
182
|
-
type: 'text',
|
|
183
|
-
admin: {
|
|
184
|
-
placeholder: '"Email From" <email-from@email.com>',
|
|
185
|
-
width: '50%'
|
|
186
|
-
},
|
|
187
|
-
label: 'Email From'
|
|
188
|
-
}
|
|
189
|
-
]
|
|
190
|
-
},
|
|
191
|
-
{
|
|
192
|
-
name: 'subject',
|
|
193
|
-
type: 'text',
|
|
194
|
-
defaultValue: "You've received a new message.",
|
|
195
|
-
label: 'Subject',
|
|
196
|
-
localized: true,
|
|
197
|
-
required: true
|
|
198
|
-
},
|
|
199
|
-
{
|
|
200
|
-
name: 'message',
|
|
201
|
-
type: 'richText',
|
|
202
|
-
admin: {
|
|
203
|
-
description: 'Enter the message that should be sent in this email.'
|
|
204
|
-
},
|
|
205
|
-
label: 'Message',
|
|
206
|
-
localized: true
|
|
207
|
-
}
|
|
208
|
-
]
|
|
209
|
-
},
|
|
210
|
-
...formConfig?.formOverrides?.fields || []
|
|
211
|
-
]
|
|
213
|
+
fields: formConfig?.formOverrides?.fields && typeof formConfig?.formOverrides?.fields === 'function' ? formConfig.formOverrides.fields({
|
|
214
|
+
defaultFields
|
|
215
|
+
}) : defaultFields
|
|
212
216
|
};
|
|
213
217
|
return config;
|
|
214
218
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/collections/Forms/index.ts"],"sourcesContent":["import type { Block, CollectionConfig, Field } from 'payload/types'\n\nimport merge from 'deepmerge'\n\nimport type { FieldConfig, PluginConfig } from '../../types.js'\n\nimport { fields } from './fields.js'\n\n// all settings can be overridden by the config\nexport const generateFormCollection = (formConfig: PluginConfig): CollectionConfig => {\n const redirect: Field = {\n name: 'redirect',\n type: 'group',\n admin: {\n condition: (_, siblingData) => siblingData?.confirmationType === 'redirect',\n hideGutter: true,\n },\n fields: [\n {\n name: 'url',\n type: 'text',\n label: 'URL to redirect to',\n required: true,\n },\n ],\n }\n\n if (formConfig.redirectRelationships) {\n redirect.fields.unshift({\n name: 'reference',\n type: 'relationship',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'reference',\n },\n label: 'Document to link to',\n maxDepth: 2,\n relationTo: formConfig.redirectRelationships,\n required: true,\n })\n\n redirect.fields.unshift({\n name: 'type',\n type: 'radio',\n admin: {\n layout: 'horizontal',\n },\n defaultValue: 'reference',\n options: [\n {\n label: 'Internal link',\n value: 'reference',\n },\n {\n label: 'Custom URL',\n value: 'custom',\n },\n ],\n })\n\n if (redirect.fields[2].type !== 'row') redirect.fields[2].label = 'Custom URL'\n\n redirect.fields[2].admin = {\n condition: (_, siblingData) => siblingData?.type === 'custom',\n }\n }\n\n const config: CollectionConfig = {\n ...(formConfig?.formOverrides || {}),\n slug: formConfig?.formOverrides?.slug || 'forms',\n access: {\n read: () => true,\n ...(formConfig?.formOverrides?.access || {}),\n },\n admin: {\n enableRichTextRelationship: false,\n useAsTitle: 'title',\n ...(formConfig?.formOverrides?.admin || {}),\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n },\n {\n name: 'fields',\n type: 'blocks',\n blocks: Object.entries(formConfig?.fields || {})\n .map(([fieldKey, fieldConfig]) => {\n // let the config enable/disable fields with either boolean values or objects\n if (fieldConfig !== false) {\n const block = fields[fieldKey]\n\n if (block === undefined && typeof fieldConfig === 'object') {\n return fieldConfig\n }\n\n if (typeof block === 'object' && typeof fieldConfig === 'object') {\n return merge<FieldConfig>(block, fieldConfig, {\n arrayMerge: (_, sourceArray) => sourceArray,\n })\n }\n\n if (typeof block === 'function') {\n return block(fieldConfig)\n }\n\n return block\n }\n\n return null\n })\n .filter(Boolean) as Block[],\n },\n {\n name: 'submitButtonLabel',\n type: 'text',\n localized: true,\n },\n {\n name: 'confirmationType',\n type: 'radio',\n admin: {\n description:\n 'Choose whether to display an on-page message or redirect to a different page after they submit the form.',\n layout: 'horizontal',\n },\n defaultValue: 'message',\n options: [\n {\n label: 'Message',\n value: 'message',\n },\n {\n label: 'Redirect',\n value: 'redirect',\n },\n ],\n },\n {\n name: 'confirmationMessage',\n type: 'richText',\n admin: {\n condition: (_, siblingData) => siblingData?.confirmationType === 'message',\n },\n localized: true,\n required: true,\n },\n redirect,\n {\n name: 'emails',\n type: 'array',\n admin: {\n description:\n \"Send custom emails when the form submits. Use comma separated lists to send the same email to multiple recipients. To reference a value from this form, wrap that field's name with double curly brackets, i.e. {{firstName}}.\",\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'emailTo',\n type: 'text',\n admin: {\n placeholder: '\"Email Sender\" <sender@email.com>',\n width: '100%',\n },\n label: 'Email To',\n },\n {\n name: 'cc',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'CC',\n },\n {\n name: 'bcc',\n type: 'text',\n admin: {\n width: '50%',\n },\n label: 'BCC',\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'replyTo',\n type: 'text',\n admin: {\n placeholder: '\"Reply To\" <reply-to@email.com>',\n width: '50%',\n },\n label: 'Reply To',\n },\n {\n name: 'emailFrom',\n type: 'text',\n admin: {\n placeholder: '\"Email From\" <email-from@email.com>',\n width: '50%',\n },\n label: 'Email From',\n },\n ],\n },\n {\n name: 'subject',\n type: 'text',\n defaultValue: \"You've received a new message.\",\n label: 'Subject',\n localized: true,\n required: true,\n },\n {\n name: 'message',\n type: 'richText',\n admin: {\n description: 'Enter the message that should be sent in this email.',\n },\n label: 'Message',\n localized: true,\n },\n ],\n },\n ...(formConfig?.formOverrides?.fields || []),\n ],\n }\n\n return config\n}\n"],"names":["merge","fields","generateFormCollection","formConfig","redirect","name","type","admin","condition","_","siblingData","confirmationType","hideGutter","label","required","redirectRelationships","unshift","maxDepth","relationTo","layout","defaultValue","options","value","config","formOverrides","slug","access","read","enableRichTextRelationship","useAsTitle","blocks","Object","entries","map","fieldKey","fieldConfig","block","undefined","arrayMerge","sourceArray","filter","Boolean","localized","description","placeholder","width"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAOA,WAAW,YAAW;AAI7B,SAASC,MAAM,QAAQ,cAAa;AAEpC,+CAA+C;AAC/C,OAAO,MAAMC,yBAAyB,CAACC;IACrC,MAAMC,WAAkB;QACtBC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,WAAW,CAACC,GAAGC,cAAgBA,aAAaC,qBAAqB;YACjEC,YAAY;QACd;QACAX,QAAQ;YACN;gBACEI,MAAM;gBACNC,MAAM;gBACNO,OAAO;gBACPC,UAAU;YACZ;SACD;IACH;IAEA,IAAIX,WAAWY,qBAAqB,EAAE;QACpCX,SAASH,MAAM,CAACe,OAAO,CAAC;YACtBX,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,WAAW,CAACC,GAAGC,cAAgBA,aAAaJ,SAAS;YACvD;YACAO,OAAO;YACPI,UAAU;YACVC,YAAYf,WAAWY,qBAAqB;YAC5CD,UAAU;QACZ;QAEAV,SAASH,MAAM,CA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,OAAOA,MAAMD;wBACf;wBAEA,OAAOC;oBACT;oBAEA,OAAO;gBACT,GACCI,MAAM,CAACC;YACZ;YACA;gBACEpC,MAAM;gBACNC,MAAM;gBACNoC,WAAW;YACb;YACA;gBACErC,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBACLoC,aACE;oBACFxB,QAAQ;gBACV;gBACAC,cAAc;gBACdC,SAAS;oBACP;wBACER,OAAO;wBACPS,OAAO;oBACT;oBACA;wBACET,OAAO;wBACPS,OAAO;oBACT;iBACD;YACH;YACA;gBACEjB,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBACLC,WAAW,CAACC,GAAGC,cAAgBA,aAAaC,qBAAqB;gBACnE;gBACA+B,WAAW;gBACX5B,UAAU;YACZ;YACAV;YACA;gBACEC,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBACLoC,aACE;gBACJ;gBACA1C,QAAQ;oBACN;wBACEK,MAAM;wBACNL,QAAQ;4BACN;gCACEI,MAAM;gCACNC,MAAM;gCACNC,OAAO;oCACLqC,aAAa;oCACbC,OAAO;gCACT;gCACAhC,OAAO;4BACT;4BACA;gCACER,MAAM;gCACNC,MAAM;gCACNC,OAAO;oCACLsC,OAAO;gCACT;gCACAhC,OAAO;4BACT;4BACA;gCACER,MAAM;gCACNC,MAAM;gCACNC,OAAO;oCACLsC,OAAO;gCACT;gCACAhC,OAAO;4BACT;yBACD;oBACH;oBACA;wBACEP,MAAM;wBACNL,QAAQ;4BACN;gCACEI,MAAM;gCACNC,MAAM;gCACNC,OAAO;oCACLqC,aAAa;oCACbC,OAAO;gCACT;gCACAhC,OAAO;4BACT;4BACA;gCACER,MAAM;gCACNC,MAAM;gCACNC,OAAO;oCACLqC,aAAa;oCACbC,OAAO;gCACT;gCACAhC,OAAO;4BACT;yBACD;oBACH;oBACA;wBACER,MAAM;wBACNC,MAAM;wBACNc,cAAc;wBACdP,OAAO;wBACP6B,WAAW;wBACX5B,UAAU;oBACZ;oBACA;wBACET,MAAM;wBACNC,MAAM;wBACNC,OAAO;4BACLoC,aAAa;wBACf;wBACA9B,OAAO;wBACP6B,WAAW;oBACb;iBACD;YACH;eACIvC,YAAYqB,eAAevB,UAAU,EAAE;SAC5C;IACH;IAEA,OAAOsB;AACT,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/Forms/index.ts"],"sourcesContent":["import type { Block, CollectionConfig, Field } from 'payload'\n\nimport { deepMergeWithSourceArrays } from 'payload'\n\nimport type { FormBuilderPluginConfig } from '../../types.js'\n\nimport { fields } from './fields.js'\n\n// all settings can be overridden by the config\nexport const generateFormCollection = (formConfig: FormBuilderPluginConfig): CollectionConfig => {\n const redirect: Field = {\n name: 'redirect',\n type: 'group',\n admin: {\n condition: (_, siblingData) => siblingData?.confirmationType === 'redirect',\n hideGutter: true,\n },\n fields: [\n {\n name: 'url',\n type: 'text',\n label: 'URL to redirect to',\n required: true,\n },\n ],\n }\n\n if (formConfig.redirectRelationships) {\n redirect.fields.unshift({\n name: 'reference',\n type: 'relationship',\n admin: {\n condition: (_, siblingData) => siblingData?.type === 'reference',\n },\n label: 'Document to link to',\n maxDepth: 2,\n relationTo: formConfig.redirectRelationships,\n required: true,\n })\n\n redirect.fields.unshift({\n name: 'type',\n type: 'radio',\n admin: {\n layout: 'horizontal',\n },\n defaultValue: 'reference',\n options: [\n {\n label: 'Internal link',\n value: 'reference',\n },\n {\n label: 'Custom URL',\n value: 'custom',\n },\n ],\n })\n\n if (redirect.fields[2].type !== 'row') redirect.fields[2].label = 'Custom URL'\n\n redirect.fields[2].admin = {\n condition: (_, siblingData) => siblingData?.type === 'custom',\n }\n }\n\n const defaultFields: Field[] = [\n {\n name: 'title',\n type: 'text',\n required: true,\n },\n {\n name: 'fields',\n type: 'blocks',\n blocks: Object.entries(formConfig?.fields || {})\n .map(([fieldKey, fieldConfig]) => {\n // let the config enable/disable fields with either boolean values or objects\n if (fieldConfig !== false) {\n const block = fields[fieldKey]\n\n if (block === undefined && typeof fieldConfig === 'object') {\n return fieldConfig\n }\n\n if (typeof block === 'object' && typeof fieldConfig === 'object') {\n return deepMergeWithSourceArrays(block, fieldConfig)\n }\n\n if (typeof block === 'function') {\n return block(fieldConfig)\n }\n\n return block\n }\n\n return null\n })\n .filter(Boolean) as Block[],\n },\n {\n name: 'submitButtonLabel',\n type: 'text',\n localized: true,\n },\n {\n name: 'confirmationType',\n type: 'radio',\n admin: {\n description:\n 'Choose whether to display an on-page message or redirect to a different page after they submit the form.',\n layout: 'horizontal',\n },\n defaultValue: 'message',\n options: [\n {\n label: 'Message',\n value: 'message',\n },\n {\n label: 'Redirect',\n value: 'redirect',\n },\n ],\n },\n {\n name: 'confirmationMessage',\n type: 'richText',\n admin: {\n condition: (_, siblingData) => siblingData?.confirmationType === 'message',\n },\n localized: true,\n required: true,\n },\n redirect,\n {\n name: 'emails',\n type: 'array',\n admin: {\n description:\n \"Send custom emails when the form submits. Use comma separated lists to send the same email to multiple recipients. To reference a value from this form, wrap that field's name with double curly brackets, i.e. {{firstName}}.\",\n },\n fields: [\n {\n type: 'row',\n fields: [\n {\n name: 'emailTo',\n type: 'text',\n admin: {\n placeholder: '\"Email Sender\" <sender@email.com>',\n width: '100%',\n },\n label: 'Email To',\n },\n {\n name: 'cc',\n type: 'text',\n admin: {\n style: {\n maxWidth: '50%',\n },\n },\n label: 'CC',\n },\n {\n name: 'bcc',\n type: 'text',\n admin: {\n style: {\n maxWidth: '50%',\n },\n },\n label: 'BCC',\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'replyTo',\n type: 'text',\n admin: {\n placeholder: '\"Reply To\" <reply-to@email.com>',\n width: '50%',\n },\n label: 'Reply To',\n },\n {\n name: 'emailFrom',\n type: 'text',\n admin: {\n placeholder: '\"Email From\" <email-from@email.com>',\n width: '50%',\n },\n label: 'Email From',\n },\n ],\n },\n {\n name: 'subject',\n type: 'text',\n defaultValue: \"You've received a new message.\",\n label: 'Subject',\n localized: true,\n required: true,\n },\n {\n name: 'message',\n type: 'richText',\n admin: {\n description: 'Enter the message that should be sent in this email.',\n },\n label: 'Message',\n localized: true,\n },\n ],\n },\n ]\n\n const config: CollectionConfig = {\n ...(formConfig?.formOverrides || {}),\n slug: formConfig?.formOverrides?.slug || 'forms',\n access: {\n read: () => true,\n ...(formConfig?.formOverrides?.access || {}),\n },\n admin: {\n enableRichTextRelationship: false,\n useAsTitle: 'title',\n ...(formConfig?.formOverrides?.admin || {}),\n },\n fields:\n formConfig?.formOverrides?.fields && typeof formConfig?.formOverrides?.fields === 'function'\n ? formConfig.formOverrides.fields({ defaultFields })\n : defaultFields,\n }\n\n return config\n}\n"],"names":["deepMergeWithSourceArrays","fields","generateFormCollection","formConfig","redirect","name","type","admin","condition","_","siblingData","confirmationType","hideGutter","label","required","redirectRelationships","unshift","maxDepth","relationTo","layout","defaultValue","options","value","defaultFields","blocks","Object","entries","map","fieldKey","fieldConfig","block","undefined","filter","Boolean","localized","description","placeholder","width","style","maxWidth","config","formOverrides","slug","access","read","enableRichTextRelationship","useAsTitle"],"mappings":"AAEA,SAASA,yBAAyB,QAAQ,UAAS;AAInD,SAASC,MAAM,QAAQ,cAAa;AAEpC,+CAA+C;AAC/C,OAAO,MAAMC,yBAAyB,CAACC;IACrC,MAAMC,WAAkB;QACtBC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,WAAW,CAACC,GAAGC,cAAgBA,aAAaC,qBAAqB;YACjEC,YAAY;QACd;QACAX,QAAQ;YACN;gBACEI,MAAM;gBACNC,MAAM;gBACNO,OAAO;gBACPC,UAAU;YACZ;SACD;IACH;IAEA,IAAIX,WAAWY,qBAAqB,EAAE;QACpCX,SAASH,MAAM,CAACe,OAAO,CAAC;YACtBX,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,WAAW,CAACC,GAAGC,cAAgBA,aAAaJ,SAAS;YACvD;YACAO,OAAO;YACPI,UAAU;YACVC,YAAYf,WAAWY,qBAAqB;YAC5CD,UAAU;QACZ;QAEAV,SAASH,MAAM,CAACe,OAAO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GAAI3C,YAAYsC,eAAelC,SAAS,CAAC,CAAC;QAC5C;QACAN,QACEE,YAAYsC,eAAexC,UAAU,OAAOE,YAAYsC,eAAexC,WAAW,aAC9EE,WAAWsC,aAAa,CAACxC,MAAM,CAAC;YAAEsB;QAAc,KAChDA;IACR;IAEA,OAAOiB;AACT,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/exports/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAA;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["export { DynamicFieldSelector } from '../collections/Forms/DynamicFieldSelector.js'\nexport { DynamicPriceSelector } from '../collections/Forms/DynamicPriceSelector.js'\n"],"names":["DynamicFieldSelector","DynamicPriceSelector"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,+CAA8C;AACnF,SAASC,oBAAoB,QAAQ,+CAA8C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export type { BeforeEmail, BlockConfig, CheckboxField, CountryField, Email, EmailField, FieldConfig, FieldValues, FieldsConfig, Form, FormBuilderPluginConfig as PluginConfig, FormFieldBlock, FormSubmission, FormattedEmail, HandlePayment, MessageField, PaymentField, PaymentFieldConfig, PriceCondition, Redirect, SelectField, SelectFieldOption, StateField, SubmissionValue, TextAreaField, TextField, isValidBlockConfig, } from '../types.js';
|
|
2
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/exports/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,YAAY,EACZ,KAAK,EACL,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,IAAI,EACJ,uBAAuB,IAAI,YAAY,EACvC,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,eAAe,EACf,aAAa,EACb,SAAS,EACT,kBAAkB,GACnB,MAAM,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/exports/types.ts"],"sourcesContent":["export type {\n BeforeEmail,\n BlockConfig,\n CheckboxField,\n CountryField,\n Email,\n EmailField,\n FieldConfig,\n FieldValues,\n FieldsConfig,\n Form,\n FormBuilderPluginConfig as PluginConfig,\n FormFieldBlock,\n FormSubmission,\n FormattedEmail,\n HandlePayment,\n MessageField,\n PaymentField,\n PaymentFieldConfig,\n PriceCondition,\n Redirect,\n SelectField,\n SelectFieldOption,\n StateField,\n SubmissionValue,\n TextAreaField,\n TextField,\n isValidBlockConfig,\n} from '../types.js'\n"],"names":[],"mappings":"AAAA,WA4BoB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Config } from 'payload';
|
|
2
|
+
import type { FormBuilderPluginConfig } from './types.js';
|
|
3
|
+
export { fields } from './collections/Forms/fields.js';
|
|
4
|
+
export { getPaymentTotal } from './utilities/getPaymentTotal.js';
|
|
5
|
+
export declare const formBuilderPlugin: (incomingFormConfig: FormBuilderPluginConfig) => (config: Config) => Config;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAKzD,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAEhE,eAAO,MAAM,iBAAiB,uBACP,uBAAuB,cACnC,MAAM,KAAG,MA0BjB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { generateSubmissionCollection } from './collections/FormSubmissions/inde
|
|
|
2
2
|
import { generateFormCollection } from './collections/Forms/index.js';
|
|
3
3
|
export { fields } from './collections/Forms/fields.js';
|
|
4
4
|
export { getPaymentTotal } from './utilities/getPaymentTotal.js';
|
|
5
|
-
const
|
|
5
|
+
export const formBuilderPlugin = (incomingFormConfig)=>(config)=>{
|
|
6
6
|
const formConfig = {
|
|
7
7
|
...incomingFormConfig,
|
|
8
8
|
fields: {
|
|
@@ -21,20 +21,6 @@ const FormBuilder = (incomingFormConfig)=>(config)=>{
|
|
|
21
21
|
};
|
|
22
22
|
return {
|
|
23
23
|
...config,
|
|
24
|
-
// admin: {
|
|
25
|
-
// ...config.admin,
|
|
26
|
-
// webpack: (webpackConfig) => ({
|
|
27
|
-
// ...webpackConfig,
|
|
28
|
-
// resolve: {
|
|
29
|
-
// ...webpackConfig.resolve,
|
|
30
|
-
// alias: {
|
|
31
|
-
// ...webpackConfig.resolve.alias,
|
|
32
|
-
// [path.resolve(__dirname, 'collections/FormSubmissions/hooks/sendEmail.ts')]: path.resolve(__dirname, 'mocks/serverModule.js'),
|
|
33
|
-
// [path.resolve(__dirname, 'collections/FormSubmissions/hooks/createCharge.ts')]: path.resolve(__dirname, 'mocks/serverModule.js'),
|
|
34
|
-
// },
|
|
35
|
-
// },
|
|
36
|
-
// })
|
|
37
|
-
// },
|
|
38
24
|
collections: [
|
|
39
25
|
...config?.collections || [],
|
|
40
26
|
generateFormCollection(formConfig),
|
|
@@ -42,6 +28,5 @@ const FormBuilder = (incomingFormConfig)=>(config)=>{
|
|
|
42
28
|
]
|
|
43
29
|
};
|
|
44
30
|
};
|
|
45
|
-
export default FormBuilder;
|
|
46
31
|
|
|
47
32
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from 'payload
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from 'payload'\n\nimport type { FormBuilderPluginConfig } from './types.js'\n\nimport { generateSubmissionCollection } from './collections/FormSubmissions/index.js'\nimport { generateFormCollection } from './collections/Forms/index.js'\n\nexport { fields } from './collections/Forms/fields.js'\nexport { getPaymentTotal } from './utilities/getPaymentTotal.js'\n\nexport const formBuilderPlugin =\n (incomingFormConfig: FormBuilderPluginConfig) =>\n (config: Config): Config => {\n const formConfig: FormBuilderPluginConfig = {\n ...incomingFormConfig,\n fields: {\n checkbox: true,\n country: true,\n email: true,\n message: true,\n number: true,\n payment: false,\n select: true,\n state: true,\n text: true,\n textarea: true,\n ...incomingFormConfig.fields,\n },\n }\n\n return {\n ...config,\n collections: [\n ...(config?.collections || []),\n generateFormCollection(formConfig),\n generateSubmissionCollection(formConfig),\n ],\n }\n }\n"],"names":["generateSubmissionCollection","generateFormCollection","fields","getPaymentTotal","formBuilderPlugin","incomingFormConfig","config","formConfig","checkbox","country","email","message","number","payment","select","state","text","textarea","collections"],"mappings":"AAIA,SAASA,4BAA4B,QAAQ,yCAAwC;AACrF,SAASC,sBAAsB,QAAQ,+BAA8B;AAErE,SAASC,MAAM,QAAQ,gCAA+B;AACtD,SAASC,eAAe,QAAQ,iCAAgC;AAEhE,OAAO,MAAMC,oBACX,CAACC,qBACD,CAACC;QACC,MAAMC,aAAsC;YAC1C,GAAGF,kBAAkB;YACrBH,QAAQ;gBACNM,UAAU;gBACVC,SAAS;gBACTC,OAAO;gBACPC,SAAS;gBACTC,QAAQ;gBACRC,SAAS;gBACTC,QAAQ;gBACRC,OAAO;gBACPC,MAAM;gBACNC,UAAU;gBACV,GAAGZ,mBAAmBH,MAAM;YAC9B;QACF;QAEA,OAAO;YACL,GAAGI,MAAM;YACTY,aAAa;mBACPZ,QAAQY,eAAe,EAAE;gBAC7BjB,uBAAuBM;gBACvBP,6BAA6BO;aAC9B;QACH;IACF,EAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import type { Block, CollectionBeforeChangeHook, CollectionConfig, Field, TypeWithID } from 'payload';
|
|
2
|
+
export interface BlockConfig {
|
|
3
|
+
block: Block;
|
|
4
|
+
validate?: (value: unknown) => boolean | string;
|
|
5
|
+
}
|
|
6
|
+
export declare function isValidBlockConfig(blockConfig: BlockConfig | string): blockConfig is BlockConfig;
|
|
7
|
+
export interface FieldValues {
|
|
8
|
+
[key: string]: boolean | null | number | string | undefined;
|
|
9
|
+
}
|
|
10
|
+
export type PaymentFieldConfig = {
|
|
11
|
+
paymentProcessor: Partial<SelectField>;
|
|
12
|
+
} & Partial<Field>;
|
|
13
|
+
export type FieldConfig = Partial<Field> | PaymentFieldConfig;
|
|
14
|
+
export interface FieldsConfig {
|
|
15
|
+
[key: string]: FieldConfig | boolean | undefined;
|
|
16
|
+
checkbox?: FieldConfig | boolean;
|
|
17
|
+
country?: FieldConfig | boolean;
|
|
18
|
+
email?: FieldConfig | boolean;
|
|
19
|
+
message?: FieldConfig | boolean;
|
|
20
|
+
number?: FieldConfig | boolean;
|
|
21
|
+
payment?: FieldConfig | boolean;
|
|
22
|
+
select?: FieldConfig | boolean;
|
|
23
|
+
state?: FieldConfig | boolean;
|
|
24
|
+
text?: FieldConfig | boolean;
|
|
25
|
+
textarea?: FieldConfig | boolean;
|
|
26
|
+
}
|
|
27
|
+
type BeforeChangeParams<T extends TypeWithID = any> = Parameters<CollectionBeforeChangeHook<T>>[0];
|
|
28
|
+
export type BeforeEmail<T extends TypeWithID = any> = (emails: FormattedEmail[], beforeChangeParams: BeforeChangeParams<T>) => FormattedEmail[] | Promise<FormattedEmail[]>;
|
|
29
|
+
export type HandlePayment = (data: any) => void;
|
|
30
|
+
export type FieldsOverride = (args: {
|
|
31
|
+
defaultFields: Field[];
|
|
32
|
+
}) => Field[];
|
|
33
|
+
export type FormBuilderPluginConfig = {
|
|
34
|
+
beforeEmail?: BeforeEmail;
|
|
35
|
+
fields?: FieldsConfig;
|
|
36
|
+
formOverrides?: {
|
|
37
|
+
fields?: FieldsOverride;
|
|
38
|
+
} & Partial<Omit<CollectionConfig, 'fields'>>;
|
|
39
|
+
formSubmissionOverrides?: {
|
|
40
|
+
fields?: FieldsOverride;
|
|
41
|
+
} & Partial<Omit<CollectionConfig, 'fields'>>;
|
|
42
|
+
handlePayment?: HandlePayment;
|
|
43
|
+
redirectRelationships?: string[];
|
|
44
|
+
};
|
|
45
|
+
export interface TextField {
|
|
46
|
+
blockName?: string;
|
|
47
|
+
blockType: 'text';
|
|
48
|
+
defaultValue?: string;
|
|
49
|
+
label?: string;
|
|
50
|
+
name: string;
|
|
51
|
+
required?: boolean;
|
|
52
|
+
width?: number;
|
|
53
|
+
}
|
|
54
|
+
export interface TextAreaField {
|
|
55
|
+
blockName?: string;
|
|
56
|
+
blockType: 'textarea';
|
|
57
|
+
defaultValue?: string;
|
|
58
|
+
label?: string;
|
|
59
|
+
name: string;
|
|
60
|
+
required?: boolean;
|
|
61
|
+
width?: number;
|
|
62
|
+
}
|
|
63
|
+
export interface SelectFieldOption {
|
|
64
|
+
label: string;
|
|
65
|
+
value: string;
|
|
66
|
+
}
|
|
67
|
+
export interface SelectField {
|
|
68
|
+
blockName?: string;
|
|
69
|
+
blockType: 'select';
|
|
70
|
+
defaultValue?: string;
|
|
71
|
+
label?: string;
|
|
72
|
+
name: string;
|
|
73
|
+
options: SelectFieldOption[];
|
|
74
|
+
required?: boolean;
|
|
75
|
+
width?: number;
|
|
76
|
+
}
|
|
77
|
+
export interface PriceCondition {
|
|
78
|
+
condition: 'equals' | 'hasValue' | 'notEquals';
|
|
79
|
+
fieldToUse: string;
|
|
80
|
+
operator: 'add' | 'divide' | 'multiply' | 'subtract';
|
|
81
|
+
valueForCondition: string;
|
|
82
|
+
valueForOperator: number | string;
|
|
83
|
+
valueType: 'static' | 'valueOfField';
|
|
84
|
+
}
|
|
85
|
+
export interface PaymentField {
|
|
86
|
+
basePrice: number;
|
|
87
|
+
blockName?: string;
|
|
88
|
+
blockType: 'payment';
|
|
89
|
+
defaultValue?: string;
|
|
90
|
+
label?: string;
|
|
91
|
+
name: string;
|
|
92
|
+
paymentProcessor: string;
|
|
93
|
+
priceConditions: PriceCondition[];
|
|
94
|
+
required?: boolean;
|
|
95
|
+
width?: number;
|
|
96
|
+
}
|
|
97
|
+
export interface EmailField {
|
|
98
|
+
blockName?: string;
|
|
99
|
+
blockType: 'email';
|
|
100
|
+
defaultValue?: string;
|
|
101
|
+
label?: string;
|
|
102
|
+
name: string;
|
|
103
|
+
required?: boolean;
|
|
104
|
+
width?: number;
|
|
105
|
+
}
|
|
106
|
+
export interface StateField {
|
|
107
|
+
blockName?: string;
|
|
108
|
+
blockType: 'state';
|
|
109
|
+
defaultValue?: string;
|
|
110
|
+
label?: string;
|
|
111
|
+
name: string;
|
|
112
|
+
required?: boolean;
|
|
113
|
+
width?: number;
|
|
114
|
+
}
|
|
115
|
+
export interface CountryField {
|
|
116
|
+
blockName?: string;
|
|
117
|
+
blockType: 'country';
|
|
118
|
+
defaultValue?: string;
|
|
119
|
+
label?: string;
|
|
120
|
+
name: string;
|
|
121
|
+
required?: boolean;
|
|
122
|
+
width?: number;
|
|
123
|
+
}
|
|
124
|
+
export interface CheckboxField {
|
|
125
|
+
blockName?: string;
|
|
126
|
+
blockType: 'checkbox';
|
|
127
|
+
defaultValue?: boolean;
|
|
128
|
+
label?: string;
|
|
129
|
+
name: string;
|
|
130
|
+
required?: boolean;
|
|
131
|
+
width?: number;
|
|
132
|
+
}
|
|
133
|
+
export interface MessageField {
|
|
134
|
+
blockName?: string;
|
|
135
|
+
blockType: 'message';
|
|
136
|
+
message: unknown;
|
|
137
|
+
}
|
|
138
|
+
export type FormFieldBlock = CheckboxField | CountryField | EmailField | MessageField | PaymentField | SelectField | StateField | TextAreaField | TextField;
|
|
139
|
+
export interface Email {
|
|
140
|
+
bcc?: string;
|
|
141
|
+
cc?: string;
|
|
142
|
+
emailFrom: string;
|
|
143
|
+
emailTo: string;
|
|
144
|
+
message?: any;
|
|
145
|
+
replyTo?: string;
|
|
146
|
+
subject: string;
|
|
147
|
+
}
|
|
148
|
+
export interface FormattedEmail {
|
|
149
|
+
bcc?: string;
|
|
150
|
+
cc?: string;
|
|
151
|
+
from: string;
|
|
152
|
+
html: string;
|
|
153
|
+
replyTo: string;
|
|
154
|
+
subject: string;
|
|
155
|
+
to: string;
|
|
156
|
+
}
|
|
157
|
+
export interface Redirect {
|
|
158
|
+
reference?: {
|
|
159
|
+
relationTo: string;
|
|
160
|
+
value: string | unknown;
|
|
161
|
+
};
|
|
162
|
+
type: 'custom' | 'reference';
|
|
163
|
+
url: string;
|
|
164
|
+
}
|
|
165
|
+
export interface Form {
|
|
166
|
+
confirmationMessage?: any;
|
|
167
|
+
confirmationType: 'message' | 'redirect';
|
|
168
|
+
emails: Email[];
|
|
169
|
+
fields: FormFieldBlock[];
|
|
170
|
+
id: string;
|
|
171
|
+
redirect?: Redirect;
|
|
172
|
+
submitButtonLabel?: string;
|
|
173
|
+
title: string;
|
|
174
|
+
}
|
|
175
|
+
export interface SubmissionValue {
|
|
176
|
+
field: string;
|
|
177
|
+
value: unknown;
|
|
178
|
+
}
|
|
179
|
+
export interface FormSubmission {
|
|
180
|
+
form: Form | string;
|
|
181
|
+
submissionData: SubmissionValue[];
|
|
182
|
+
}
|
|
183
|
+
export {};
|
|
184
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,0BAA0B,EAC1B,gBAAgB,EAChB,KAAK,EACL,UAAU,EACX,MAAM,SAAS,CAAA;AAEhB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