@payloadcms/plugin-form-builder 3.0.0-canary.f6e77b8 → 3.0.0-canary.f83d96a
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.map +1 -1
- package/dist/collections/FormSubmissions/hooks/createCharge.js.map +1 -1
- package/dist/collections/FormSubmissions/hooks/sendEmail.d.ts.map +1 -1
- package/dist/collections/FormSubmissions/hooks/sendEmail.js.map +1 -1
- package/dist/collections/FormSubmissions/index.d.ts +1 -1
- package/dist/collections/FormSubmissions/index.d.ts.map +1 -1
- package/dist/collections/FormSubmissions/index.js +62 -60
- package/dist/collections/FormSubmissions/index.js.map +1 -1
- package/dist/collections/Forms/DynamicFieldSelector.d.ts +1 -1
- package/dist/collections/Forms/DynamicFieldSelector.d.ts.map +1 -1
- package/dist/collections/Forms/DynamicFieldSelector.js +3 -3
- package/dist/collections/Forms/DynamicFieldSelector.js.map +1 -1
- package/dist/collections/Forms/DynamicPriceSelector.d.ts +1 -1
- package/dist/collections/Forms/DynamicPriceSelector.d.ts.map +1 -1
- package/dist/collections/Forms/DynamicPriceSelector.js +18 -9
- package/dist/collections/Forms/DynamicPriceSelector.js.map +1 -1
- package/dist/collections/Forms/fields.d.ts +2 -2
- package/dist/collections/Forms/fields.d.ts.map +1 -1
- package/dist/collections/Forms/fields.js.map +1 -1
- package/dist/collections/Forms/index.d.ts +1 -1
- package/dist/collections/Forms/index.d.ts.map +1 -1
- package/dist/collections/Forms/index.js +146 -144
- package/dist/collections/Forms/index.js.map +1 -1
- package/dist/exports/types.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -14
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +10 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utilities/getPaymentTotal.d.ts.map +1 -1
- package/dist/utilities/getPaymentTotal.js.map +1 -1
- package/dist/utilities/lexical/converters/heading.js.map +1 -1
- package/dist/utilities/lexical/converters/linebreak.js.map +1 -1
- package/dist/utilities/lexical/converters/link.js.map +1 -1
- package/dist/utilities/lexical/converters/list.js.map +1 -1
- package/dist/utilities/lexical/converters/paragraph.js.map +1 -1
- package/dist/utilities/lexical/converters/quote.js.map +1 -1
- package/dist/utilities/lexical/converters/text.js.map +1 -1
- package/dist/utilities/lexical/defaultConverters.js.map +1 -1
- package/dist/utilities/lexical/nodeFormat.js.map +1 -1
- package/dist/utilities/lexical/serializeLexical.js.map +1 -1
- package/dist/utilities/lexical/types.js.map +1 -1
- package/dist/utilities/replaceDoubleCurlys.d.ts.map +1 -1
- package/dist/utilities/replaceDoubleCurlys.js.map +1 -1
- package/dist/utilities/slate/serializeSlate.js.map +1 -1
- package/package.json +21 -15
|
@@ -53,6 +53,149 @@ 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 merge(block, fieldConfig, {
|
|
74
|
+
arrayMerge: (_, sourceArray)=>sourceArray
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (typeof block === 'function') {
|
|
78
|
+
return block(fieldConfig);
|
|
79
|
+
}
|
|
80
|
+
return block;
|
|
81
|
+
}
|
|
82
|
+
return null;
|
|
83
|
+
}).filter(Boolean)
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'submitButtonLabel',
|
|
87
|
+
type: 'text',
|
|
88
|
+
localized: true
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'confirmationType',
|
|
92
|
+
type: 'radio',
|
|
93
|
+
admin: {
|
|
94
|
+
description: 'Choose whether to display an on-page message or redirect to a different page after they submit the form.',
|
|
95
|
+
layout: 'horizontal'
|
|
96
|
+
},
|
|
97
|
+
defaultValue: 'message',
|
|
98
|
+
options: [
|
|
99
|
+
{
|
|
100
|
+
label: 'Message',
|
|
101
|
+
value: 'message'
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
label: 'Redirect',
|
|
105
|
+
value: 'redirect'
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'confirmationMessage',
|
|
111
|
+
type: 'richText',
|
|
112
|
+
admin: {
|
|
113
|
+
condition: (_, siblingData)=>siblingData?.confirmationType === 'message'
|
|
114
|
+
},
|
|
115
|
+
localized: true,
|
|
116
|
+
required: true
|
|
117
|
+
},
|
|
118
|
+
redirect,
|
|
119
|
+
{
|
|
120
|
+
name: 'emails',
|
|
121
|
+
type: 'array',
|
|
122
|
+
admin: {
|
|
123
|
+
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}}."
|
|
124
|
+
},
|
|
125
|
+
fields: [
|
|
126
|
+
{
|
|
127
|
+
type: 'row',
|
|
128
|
+
fields: [
|
|
129
|
+
{
|
|
130
|
+
name: 'emailTo',
|
|
131
|
+
type: 'text',
|
|
132
|
+
admin: {
|
|
133
|
+
placeholder: '"Email Sender" <sender@email.com>',
|
|
134
|
+
width: '100%'
|
|
135
|
+
},
|
|
136
|
+
label: 'Email To'
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'cc',
|
|
140
|
+
type: 'text',
|
|
141
|
+
admin: {
|
|
142
|
+
width: '50%'
|
|
143
|
+
},
|
|
144
|
+
label: 'CC'
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: 'bcc',
|
|
148
|
+
type: 'text',
|
|
149
|
+
admin: {
|
|
150
|
+
width: '50%'
|
|
151
|
+
},
|
|
152
|
+
label: 'BCC'
|
|
153
|
+
}
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
type: 'row',
|
|
158
|
+
fields: [
|
|
159
|
+
{
|
|
160
|
+
name: 'replyTo',
|
|
161
|
+
type: 'text',
|
|
162
|
+
admin: {
|
|
163
|
+
placeholder: '"Reply To" <reply-to@email.com>',
|
|
164
|
+
width: '50%'
|
|
165
|
+
},
|
|
166
|
+
label: 'Reply To'
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'emailFrom',
|
|
170
|
+
type: 'text',
|
|
171
|
+
admin: {
|
|
172
|
+
placeholder: '"Email From" <email-from@email.com>',
|
|
173
|
+
width: '50%'
|
|
174
|
+
},
|
|
175
|
+
label: 'Email From'
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: 'subject',
|
|
181
|
+
type: 'text',
|
|
182
|
+
defaultValue: "You've received a new message.",
|
|
183
|
+
label: 'Subject',
|
|
184
|
+
localized: true,
|
|
185
|
+
required: true
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: 'message',
|
|
189
|
+
type: 'richText',
|
|
190
|
+
admin: {
|
|
191
|
+
description: 'Enter the message that should be sent in this email.'
|
|
192
|
+
},
|
|
193
|
+
label: 'Message',
|
|
194
|
+
localized: true
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
}
|
|
198
|
+
];
|
|
56
199
|
const config = {
|
|
57
200
|
...formConfig?.formOverrides || {},
|
|
58
201
|
slug: formConfig?.formOverrides?.slug || 'forms',
|
|
@@ -65,150 +208,9 @@ export const generateFormCollection = (formConfig)=>{
|
|
|
65
208
|
useAsTitle: 'title',
|
|
66
209
|
...formConfig?.formOverrides?.admin || {}
|
|
67
210
|
},
|
|
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
|
-
]
|
|
211
|
+
fields: formConfig?.formOverrides?.fields && typeof formConfig?.formOverrides?.fields === 'function' ? formConfig.formOverrides.fields({
|
|
212
|
+
defaultFields
|
|
213
|
+
}) : defaultFields
|
|
212
214
|
};
|
|
213
215
|
return config;
|
|
214
216
|
};
|
|
@@ -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, 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 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,CAACe,OAAO,CAAC;YACtBX,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLY,QAAQ;YACV;YACAC,cAAc;YACdC,SAAS;gBACP;oBACER,OAAO;oBACPS,OAAO;gBACT;gBACA;oBACET,OAAO;oBACPS,OAAO;gBACT;aACD;QACH;QAEA,IAAIlB,SAASH,MAAM,CAAC,EAAE,CAACK,IAAI,KAAK,OAAOF,SAASH,MAAM,CAAC,EAAE,CAACY,KAAK,GAAG;QAElET,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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 merge from 'deepmerge'\n\nimport type { FieldConfig, 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 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 ]\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":["merge","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","arrayMerge","sourceArray","filter","Boolean","localized","description","placeholder","width","config","formOverrides","slug","access","read","enableRichTextRelationship","useAsTitle"],"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,CAACe,OAAO,CAAC;YACtBX,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLY,QAAQ;YACV;YACAC,cAAc;YACdC,SAAS;gBACP;oBACER,OAAO;oBACPS,OAAO;gBACT;gBACA;oBACET,OAAO;oBACPS,OAAO;gBACT;aACD;QACH;QAEA,IAAIlB,SAASH,MAAM,CAAC,EAAE,CAACK,IAAI,KAAK,OAAOF,SAASH,MAAM,CAAC,EAAE,CAACY,KAAK,GAAG;QAElET,SAASH,MAAM,CAAC,EAAE,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AO;gCACL+B,aAAa;gCACbC,OAAO;4BACT;4BACA1B,OAAO;wBACT;wBACA;4BACER,MAAM;4BACNC,MAAM;4BACNC,OAAO;gCACLgC,OAAO;4BACT;4BACA1B,OAAO;wBACT;wBACA;4BACER,MAAM;4BACNC,MAAM;4BACNC,OAAO;gCACLgC,OAAO;4BACT;4BACA1B,OAAO;wBACT;qBACD;gBACH;gBACA;oBACEP,MAAM;oBACNL,QAAQ;wBACN;4BACEI,MAAM;4BACNC,MAAM;4BACNC,OAAO;gCACL+B,aAAa;gCACbC,OAAO;4BACT;4BACA1B,OAAO;wBACT;wBACA;4BACER,MAAM;4BACNC,MAAM;4BACNC,OAAO;gCACL+B,aAAa;gCACbC,OAAO;4BACT;4BACA1B,OAAO;wBACT;qBACD;gBACH;gBACA;oBACER,MAAM;oBACNC,MAAM;oBACNc,cAAc;oBACdP,OAAO;oBACPuB,WAAW;oBACXtB,UAAU;gBACZ;gBACA;oBACET,MAAM;oBACNC,MAAM;oBACNC,OAAO;wBACL8B,aAAa;oBACf;oBACAxB,OAAO;oBACPuB,WAAW;gBACb;aACD;QACH;KACD;IAED,MAAMI,SAA2B;QAC/B,GAAIrC,YAAYsC,iBAAiB,CAAC,CAAC;QACnCC,MAAMvC,YAAYsC,eAAeC,QAAQ;QACzCC,QAAQ;YACNC,MAAM,IAAM;YACZ,GAAIzC,YAAYsC,eAAeE,UAAU,CAAC,CAAC;QAC7C;QACApC,OAAO;YACLsC,4BAA4B;YAC5BC,YAAY;YACZ,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"}
|
|
@@ -1 +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":[],"
|
|
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
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Config } from 'payload
|
|
1
|
+
import type { Config } from 'payload';
|
|
2
2
|
import type { FormBuilderPluginConfig } from './types.js';
|
|
3
3
|
export { fields } from './collections/Forms/fields.js';
|
|
4
4
|
export { getPaymentTotal } from './utilities/getPaymentTotal.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,
|
|
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
|
@@ -21,20 +21,6 @@ export const formBuilderPlugin = (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),
|
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
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Block, CollectionConfig, Field } from 'payload
|
|
1
|
+
import type { Block, CollectionConfig, Field } from 'payload';
|
|
2
2
|
export interface BlockConfig {
|
|
3
3
|
block: Block;
|
|
4
4
|
validate?: (value: unknown) => boolean | string;
|
|
@@ -26,11 +26,18 @@ export interface FieldsConfig {
|
|
|
26
26
|
}
|
|
27
27
|
export type BeforeEmail = (emails: FormattedEmail[]) => FormattedEmail[] | Promise<FormattedEmail[]>;
|
|
28
28
|
export type HandlePayment = (data: any) => void;
|
|
29
|
+
export type FieldsOverride = (args: {
|
|
30
|
+
defaultFields: Field[];
|
|
31
|
+
}) => Field[];
|
|
29
32
|
export type FormBuilderPluginConfig = {
|
|
30
33
|
beforeEmail?: BeforeEmail;
|
|
31
34
|
fields?: FieldsConfig;
|
|
32
|
-
formOverrides?: Partial<CollectionConfig
|
|
33
|
-
|
|
35
|
+
formOverrides?: Partial<Omit<CollectionConfig, 'fields'>> & {
|
|
36
|
+
fields: FieldsOverride;
|
|
37
|
+
};
|
|
38
|
+
formSubmissionOverrides?: Partial<Omit<CollectionConfig, 'fields'>> & {
|
|
39
|
+
fields: FieldsOverride;
|
|
40
|
+
};
|
|
34
41
|
handlePayment?: HandlePayment;
|
|
35
42
|
redirectRelationships?: string[];
|
|
36
43
|
};
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE7D,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,KAAK,CAAA;IACZ,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,GAAG,MAAM,CAAA;CAChD;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,GAAG,WAAW,IAAI,WAAW,CAMhG;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,M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M,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,WAAW,QAAQ;IACvB,SAAS,CAAC,EAAE;QACV,UAAU,EAAE,MAAM,CAAA;QAClB,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;KACxB,CAAA;IACD,IAAI,EAAE,QAAQ,GAAG,WAAW,CAAA;IAC5B,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,IAAI;IACnB,mBAAmB,CAAC,EAAE,GAAG,CAAA;IACzB,gBAAgB,EAAE,SAAS,GAAG,UAAU,CAAA;IACxC,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,OAAO,CAAA;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,IAAI,GAAG,MAAM,CAAA;IACnB,cAAc,EAAE,eAAe,EAAE,CAAA;CAClC"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { Block, CollectionConfig, Field } from 'payload
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { Block, CollectionConfig, Field } from 'payload'\n\nexport interface BlockConfig {\n block: Block\n validate?: (value: unknown) => boolean | string\n}\n\nexport function isValidBlockConfig(blockConfig: BlockConfig | string): blockConfig is BlockConfig {\n return (\n typeof blockConfig !== 'string' &&\n typeof blockConfig?.block?.slug === 'string' &&\n Array.isArray(blockConfig?.block?.fields)\n )\n}\n\nexport interface FieldValues {\n [key: string]: boolean | null | number | string | undefined\n}\n\nexport type PaymentFieldConfig = Partial<Field> & {\n paymentProcessor: Partial<SelectField>\n}\n\nexport type FieldConfig = Partial<Field> | PaymentFieldConfig\n\nexport interface FieldsConfig {\n [key: string]: FieldConfig | boolean | undefined\n checkbox?: FieldConfig | boolean\n country?: FieldConfig | boolean\n email?: FieldConfig | boolean\n message?: FieldConfig | boolean\n number?: FieldConfig | boolean\n payment?: FieldConfig | boolean\n select?: FieldConfig | boolean\n state?: FieldConfig | boolean\n text?: FieldConfig | boolean\n textarea?: FieldConfig | boolean\n}\n\nexport type BeforeEmail = (emails: FormattedEmail[]) => FormattedEmail[] | Promise<FormattedEmail[]>\nexport type HandlePayment = (data: any) => void\nexport type FieldsOverride = (args: { defaultFields: Field[] }) => Field[]\n\nexport type FormBuilderPluginConfig = {\n beforeEmail?: BeforeEmail\n fields?: FieldsConfig\n formOverrides?: Partial<Omit<CollectionConfig, 'fields'>> & { fields: FieldsOverride }\n formSubmissionOverrides?: Partial<Omit<CollectionConfig, 'fields'>> & { fields: FieldsOverride }\n handlePayment?: HandlePayment\n redirectRelationships?: string[]\n}\n\nexport interface TextField {\n blockName?: string\n blockType: 'text'\n defaultValue?: string\n label?: string\n name: string\n required?: boolean\n width?: number\n}\n\nexport interface TextAreaField {\n blockName?: string\n blockType: 'textarea'\n defaultValue?: string\n label?: string\n name: string\n required?: boolean\n width?: number\n}\n\nexport interface SelectFieldOption {\n label: string\n value: string\n}\n\nexport interface SelectField {\n blockName?: string\n blockType: 'select'\n defaultValue?: string\n label?: string\n name: string\n options: SelectFieldOption[]\n required?: boolean\n width?: number\n}\n\nexport interface PriceCondition {\n condition: 'equals' | 'hasValue' | 'notEquals'\n fieldToUse: string\n operator: 'add' | 'divide' | 'multiply' | 'subtract'\n valueForCondition: string\n valueForOperator: number | string // TODO: make this a number, see ./collections/Forms/DynamicPriceSelector.tsx\n valueType: 'static' | 'valueOfField'\n}\n\nexport interface PaymentField {\n basePrice: number\n blockName?: string\n blockType: 'payment'\n defaultValue?: string\n label?: string\n name: string\n paymentProcessor: string\n priceConditions: PriceCondition[]\n required?: boolean\n width?: number\n}\n\nexport interface EmailField {\n blockName?: string\n blockType: 'email'\n defaultValue?: string\n label?: string\n name: string\n required?: boolean\n width?: number\n}\n\nexport interface StateField {\n blockName?: string\n blockType: 'state'\n defaultValue?: string\n label?: string\n name: string\n required?: boolean\n width?: number\n}\n\nexport interface CountryField {\n blockName?: string\n blockType: 'country'\n defaultValue?: string\n label?: string\n name: string\n required?: boolean\n width?: number\n}\n\nexport interface CheckboxField {\n blockName?: string\n blockType: 'checkbox'\n defaultValue?: boolean\n label?: string\n name: string\n required?: boolean\n width?: number\n}\n\nexport interface MessageField {\n blockName?: string\n blockType: 'message'\n message: unknown\n}\n\nexport type FormFieldBlock =\n | CheckboxField\n | CountryField\n | EmailField\n | MessageField\n | PaymentField\n | SelectField\n | StateField\n | TextAreaField\n | TextField\n\nexport interface Email {\n bcc?: string\n cc?: string\n emailFrom: string\n emailTo: string\n message?: any // TODO: configure rich text type\n replyTo?: string\n subject: string\n}\n\nexport interface FormattedEmail {\n bcc?: string\n cc?: string\n from: string\n html: string\n replyTo: string\n subject: string\n to: string\n}\n\nexport interface Redirect {\n reference?: {\n relationTo: string\n value: string | unknown\n }\n type: 'custom' | 'reference'\n url: string\n}\n\nexport interface Form {\n confirmationMessage?: any // TODO: configure rich text type\n confirmationType: 'message' | 'redirect'\n emails: Email[]\n fields: FormFieldBlock[]\n id: string\n redirect?: Redirect\n submitButtonLabel?: string\n title: string\n}\n\nexport interface SubmissionValue {\n field: string\n value: unknown\n}\n\nexport interface FormSubmission {\n form: Form | string\n submissionData: SubmissionValue[]\n}\n"],"names":["isValidBlockConfig","blockConfig","block","slug","Array","isArray","fields"],"mappings":"AAOA,OAAO,SAASA,mBAAmBC,WAAiC;IAClE,OACE,OAAOA,gBAAgB,YACvB,OAAOA,aAAaC,OAAOC,SAAS,YACpCC,MAAMC,OAAO,CAACJ,aAAaC,OAAOI;AAEtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPaymentTotal.d.ts","sourceRoot":"","sources":["../../src/utilities/getPaymentTotal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAA;AAE5E,eAAO,MAAM,eAAe,SACpB,
|
|
1
|
+
{"version":3,"file":"getPaymentTotal.d.ts","sourceRoot":"","sources":["../../src/utilities/getPaymentTotal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAA;AAE5E,eAAO,MAAM,eAAe,SACpB,OAAO,CAAC,YAAY,CAAC,GAAG;IAC5B,WAAW,EAAE,WAAW,CAAA;CACzB,KACA,MA8CF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utilities/getPaymentTotal.ts"],"sourcesContent":["import type { FieldValues, PaymentField, PriceCondition } from '../types.js'\n\nexport const getPaymentTotal = (\n args: Partial<PaymentField> & {\n fieldValues: FieldValues\n },\n): number => {\n const { basePrice = 0, fieldValues, priceConditions } = args\n\n let total = basePrice\n\n if (Array.isArray(priceConditions) && priceConditions.length > 0) {\n priceConditions.forEach((priceCondition: PriceCondition) => {\n const { condition, fieldToUse, operator, valueForCondition, valueForOperator, valueType } =\n priceCondition\n\n const valueOfField = fieldValues?.[fieldToUse]\n\n if (valueOfField) {\n if (\n condition === 'hasValue' ||\n (condition === 'equals' && valueOfField === valueForCondition) ||\n (condition === 'notEquals' && valueOfField !== valueForCondition)\n ) {\n const valueToUse = Number(valueType === 'valueOfField' ? valueOfField : valueForOperator)\n switch (operator) {\n case 'add': {\n total += valueToUse\n break\n }\n case 'subtract': {\n total -= valueToUse\n break\n }\n case 'multiply': {\n total *= valueToUse\n break\n }\n case 'divide': {\n total /= valueToUse\n break\n }\n default: {\n break\n }\n }\n }\n }\n })\n }\n\n return total\n}\n"],"names":["getPaymentTotal","args","basePrice","fieldValues","priceConditions","total","Array","isArray","length","forEach","priceCondition","condition","fieldToUse","operator","valueForCondition","valueForOperator","valueType","valueOfField","valueToUse","Number"],"
|
|
1
|
+
{"version":3,"sources":["../../src/utilities/getPaymentTotal.ts"],"sourcesContent":["import type { FieldValues, PaymentField, PriceCondition } from '../types.js'\n\nexport const getPaymentTotal = (\n args: Partial<PaymentField> & {\n fieldValues: FieldValues\n },\n): number => {\n const { basePrice = 0, fieldValues, priceConditions } = args\n\n let total = basePrice\n\n if (Array.isArray(priceConditions) && priceConditions.length > 0) {\n priceConditions.forEach((priceCondition: PriceCondition) => {\n const { condition, fieldToUse, operator, valueForCondition, valueForOperator, valueType } =\n priceCondition\n\n const valueOfField = fieldValues?.[fieldToUse]\n\n if (valueOfField) {\n if (\n condition === 'hasValue' ||\n (condition === 'equals' && valueOfField === valueForCondition) ||\n (condition === 'notEquals' && valueOfField !== valueForCondition)\n ) {\n const valueToUse = Number(valueType === 'valueOfField' ? valueOfField : valueForOperator)\n switch (operator) {\n case 'add': {\n total += valueToUse\n break\n }\n case 'subtract': {\n total -= valueToUse\n break\n }\n case 'multiply': {\n total *= valueToUse\n break\n }\n case 'divide': {\n total /= valueToUse\n break\n }\n default: {\n break\n }\n }\n }\n }\n })\n }\n\n return total\n}\n"],"names":["getPaymentTotal","args","basePrice","fieldValues","priceConditions","total","Array","isArray","length","forEach","priceCondition","condition","fieldToUse","operator","valueForCondition","valueForOperator","valueType","valueOfField","valueToUse","Number"],"mappings":"AAEA,OAAO,MAAMA,kBAAkB,CAC7BC;IAIA,MAAM,EAAEC,YAAY,CAAC,EAAEC,WAAW,EAAEC,eAAe,EAAE,GAAGH;IAExD,IAAII,QAAQH;IAEZ,IAAII,MAAMC,OAAO,CAACH,oBAAoBA,gBAAgBI,MAAM,GAAG,GAAG;QAChEJ,gBAAgBK,OAAO,CAAC,CAACC;YACvB,MAAM,EAAEC,SAAS,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,iBAAiB,EAAEC,gBAAgB,EAAEC,SAAS,EAAE,GACvFN;YAEF,MAAMO,eAAed,aAAa,CAACS,WAAW;YAE9C,IAAIK,cAAc;gBAChB,IACEN,cAAc,cACbA,cAAc,YAAYM,iBAAiBH,qBAC3CH,cAAc,eAAeM,iBAAiBH,mBAC/C;oBACA,MAAMI,aAAaC,OAAOH,cAAc,iBAAiBC,eAAeF;oBACxE,OAAQF;wBACN,KAAK;4BAAO;gCACVR,SAASa;gCACT;4BACF;wBACA,KAAK;4BAAY;gCACfb,SAASa;gCACT;4BACF;wBACA,KAAK;4BAAY;gCACfb,SAASa;gCACT;4BACF;wBACA,KAAK;4BAAU;gCACbb,SAASa;gCACT;4BACF;wBACA;4BAAS;gCACP;4BACF;oBACF;gBACF;YACF;QACF;IACF;IAEA,OAAOb;AACT,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utilities/lexical/converters/heading.ts"],"sourcesContent":["import type { HTMLConverter } from '../types.js'\n\nimport { convertLexicalNodesToHTML } from '../serializeLexical.js'\n\nexport const HeadingHTMLConverter: HTMLConverter<any> = {\n async converter({ converters, node, parent, submissionData }) {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n submissionData,\n })\n\n return '<' + node?.tag + '>' + childrenText + '</' + node?.tag + '>'\n },\n nodeTypes: ['heading'],\n}\n"],"names":["convertLexicalNodesToHTML","HeadingHTMLConverter","converter","converters","node","parent","submissionData","childrenText","lexicalNodes","children","tag","nodeTypes"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/utilities/lexical/converters/heading.ts"],"sourcesContent":["import type { HTMLConverter } from '../types.js'\n\nimport { convertLexicalNodesToHTML } from '../serializeLexical.js'\n\nexport const HeadingHTMLConverter: HTMLConverter<any> = {\n async converter({ converters, node, parent, submissionData }) {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n submissionData,\n })\n\n return '<' + node?.tag + '>' + childrenText + '</' + node?.tag + '>'\n },\n nodeTypes: ['heading'],\n}\n"],"names":["convertLexicalNodesToHTML","HeadingHTMLConverter","converter","converters","node","parent","submissionData","childrenText","lexicalNodes","children","tag","nodeTypes"],"mappings":"AAEA,SAASA,yBAAyB,QAAQ,yBAAwB;AAElE,OAAO,MAAMC,uBAA2C;IACtD,MAAMC,WAAU,EAAEC,UAAU,EAAEC,IAAI,EAAEC,MAAM,EAAEC,cAAc,EAAE;QAC1D,MAAMC,eAAe,MAAMP,0BAA0B;YACnDG;YACAK,cAAcJ,KAAKK,QAAQ;YAC3BJ,QAAQ;gBACN,GAAGD,IAAI;gBACPC;YACF;YACAC;QACF;QAEA,OAAO,MAAMF,MAAMM,MAAM,MAAMH,eAAe,OAAOH,MAAMM,MAAM;IACnE;IACAC,WAAW;QAAC;KAAU;AACxB,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utilities/lexical/converters/linebreak.ts"],"sourcesContent":["import type { HTMLConverter } from '../types.js'\n\nexport const LinebreakHTMLConverter: HTMLConverter<any> = {\n converter() {\n return `<br>`\n },\n nodeTypes: ['linebreak'],\n}\n"],"names":["LinebreakHTMLConverter","converter","nodeTypes"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/utilities/lexical/converters/linebreak.ts"],"sourcesContent":["import type { HTMLConverter } from '../types.js'\n\nexport const LinebreakHTMLConverter: HTMLConverter<any> = {\n converter() {\n return `<br>`\n },\n nodeTypes: ['linebreak'],\n}\n"],"names":["LinebreakHTMLConverter","converter","nodeTypes"],"mappings":"AAEA,OAAO,MAAMA,yBAA6C;IACxDC;QACE,OAAO,CAAC,IAAI,CAAC;IACf;IACAC,WAAW;QAAC;KAAY;AAC1B,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utilities/lexical/converters/link.ts"],"sourcesContent":["import type { HTMLConverter } from '../types.js'\n\nimport { replaceDoubleCurlys } from '../../replaceDoubleCurlys.js'\nimport { convertLexicalNodesToHTML } from '../serializeLexical.js'\n\nexport const LinkHTMLConverter: HTMLConverter<any> = {\n async converter({ converters, node, parent, submissionData }) {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n submissionData,\n })\n\n const rel: string = node.fields.newTab ? ' rel=\"noopener noreferrer\"' : ''\n const target: string = node.fields.newTab ? ' target=\"_blank\"' : ''\n\n let href: string =\n node.fields.linkType === 'custom' ? node.fields.url : node.fields.doc?.value?.id\n\n if (submissionData) {\n href = replaceDoubleCurlys(href, submissionData)\n }\n\n return `<a href=\"${href}\"${target}${rel}>${childrenText}</a>`\n },\n nodeTypes: ['link'],\n}\n"],"names":["replaceDoubleCurlys","convertLexicalNodesToHTML","LinkHTMLConverter","converter","converters","node","parent","submissionData","childrenText","lexicalNodes","children","rel","fields","newTab","target","href","linkType","url","doc","value","id","nodeTypes"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/utilities/lexical/converters/link.ts"],"sourcesContent":["import type { HTMLConverter } from '../types.js'\n\nimport { replaceDoubleCurlys } from '../../replaceDoubleCurlys.js'\nimport { convertLexicalNodesToHTML } from '../serializeLexical.js'\n\nexport const LinkHTMLConverter: HTMLConverter<any> = {\n async converter({ converters, node, parent, submissionData }) {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n submissionData,\n })\n\n const rel: string = node.fields.newTab ? ' rel=\"noopener noreferrer\"' : ''\n const target: string = node.fields.newTab ? ' target=\"_blank\"' : ''\n\n let href: string =\n node.fields.linkType === 'custom' ? node.fields.url : node.fields.doc?.value?.id\n\n if (submissionData) {\n href = replaceDoubleCurlys(href, submissionData)\n }\n\n return `<a href=\"${href}\"${target}${rel}>${childrenText}</a>`\n },\n nodeTypes: ['link'],\n}\n"],"names":["replaceDoubleCurlys","convertLexicalNodesToHTML","LinkHTMLConverter","converter","converters","node","parent","submissionData","childrenText","lexicalNodes","children","rel","fields","newTab","target","href","linkType","url","doc","value","id","nodeTypes"],"mappings":"AAEA,SAASA,mBAAmB,QAAQ,+BAA8B;AAClE,SAASC,yBAAyB,QAAQ,yBAAwB;AAElE,OAAO,MAAMC,oBAAwC;IACnD,MAAMC,WAAU,EAAEC,UAAU,EAAEC,IAAI,EAAEC,MAAM,EAAEC,cAAc,EAAE;QAC1D,MAAMC,eAAe,MAAMP,0BAA0B;YACnDG;YACAK,cAAcJ,KAAKK,QAAQ;YAC3BJ,QAAQ;gBACN,GAAGD,IAAI;gBACPC;YACF;YACAC;QACF;QAEA,MAAMI,MAAcN,KAAKO,MAAM,CAACC,MAAM,GAAG,+BAA+B;QACxE,MAAMC,SAAiBT,KAAKO,MAAM,CAACC,MAAM,GAAG,qBAAqB;QAEjE,IAAIE,OACFV,KAAKO,MAAM,CAACI,QAAQ,KAAK,WAAWX,KAAKO,MAAM,CAACK,GAAG,GAAGZ,KAAKO,MAAM,CAACM,GAAG,EAAEC,OAAOC;QAEhF,IAAIb,gBAAgB;YAClBQ,OAAOf,oBAAoBe,MAAMR;QACnC;QAEA,OAAO,CAAC,SAAS,EAAEQ,KAAK,CAAC,EAAED,OAAO,EAAEH,IAAI,CAAC,EAAEH,aAAa,IAAI,CAAC;IAC/D;IACAa,WAAW;QAAC;KAAO;AACrB,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utilities/lexical/converters/list.ts"],"sourcesContent":["import type { HTMLConverter } from '../types.js'\n\nimport { convertLexicalNodesToHTML } from '../serializeLexical.js'\n\nexport const ListHTMLConverter: HTMLConverter<any> = {\n converter: async ({ converters, node, parent, submissionData }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n submissionData,\n })\n\n return `<${node?.tag} class=\"${node?.listType}\">${childrenText}</${node?.tag}>`\n },\n nodeTypes: ['list'],\n}\n\nexport const ListItemHTMLConverter: HTMLConverter<any> = {\n converter: async ({ converters, node, parent }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n })\n\n if ('listType' in parent && parent?.listType === 'check') {\n return `<li aria-checked=${node.checked ? 'true' : 'false'} class=\"${\n 'list-item-checkbox' + node.checked\n ? 'list-item-checkbox-checked'\n : 'list-item-checkbox-unchecked'\n }\"\n role=\"checkbox\"\n tabIndex=${-1}\n value=${node?.value}\n >\n ${childrenText}\n </li>`\n } else {\n return `<li value=${node?.value}>${childrenText}</li>`\n }\n },\n nodeTypes: ['listitem'],\n}\n"],"names":["convertLexicalNodesToHTML","ListHTMLConverter","converter","converters","node","parent","submissionData","childrenText","lexicalNodes","children","tag","listType","nodeTypes","ListItemHTMLConverter","checked","value"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/utilities/lexical/converters/list.ts"],"sourcesContent":["import type { HTMLConverter } from '../types.js'\n\nimport { convertLexicalNodesToHTML } from '../serializeLexical.js'\n\nexport const ListHTMLConverter: HTMLConverter<any> = {\n converter: async ({ converters, node, parent, submissionData }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n submissionData,\n })\n\n return `<${node?.tag} class=\"${node?.listType}\">${childrenText}</${node?.tag}>`\n },\n nodeTypes: ['list'],\n}\n\nexport const ListItemHTMLConverter: HTMLConverter<any> = {\n converter: async ({ converters, node, parent }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n })\n\n if ('listType' in parent && parent?.listType === 'check') {\n return `<li aria-checked=${node.checked ? 'true' : 'false'} class=\"${\n 'list-item-checkbox' + node.checked\n ? 'list-item-checkbox-checked'\n : 'list-item-checkbox-unchecked'\n }\"\n role=\"checkbox\"\n tabIndex=${-1}\n value=${node?.value}\n >\n ${childrenText}\n </li>`\n } else {\n return `<li value=${node?.value}>${childrenText}</li>`\n }\n },\n nodeTypes: ['listitem'],\n}\n"],"names":["convertLexicalNodesToHTML","ListHTMLConverter","converter","converters","node","parent","submissionData","childrenText","lexicalNodes","children","tag","listType","nodeTypes","ListItemHTMLConverter","checked","value"],"mappings":"AAEA,SAASA,yBAAyB,QAAQ,yBAAwB;AAElE,OAAO,MAAMC,oBAAwC;IACnDC,WAAW,OAAO,EAAEC,UAAU,EAAEC,IAAI,EAAEC,MAAM,EAAEC,cAAc,EAAE;QAC5D,MAAMC,eAAe,MAAMP,0BAA0B;YACnDG;YACAK,cAAcJ,KAAKK,QAAQ;YAC3BJ,QAAQ;gBACN,GAAGD,IAAI;gBACPC;YACF;YACAC;QACF;QAEA,OAAO,CAAC,CAAC,EAAEF,MAAMM,IAAI,QAAQ,EAAEN,MAAMO,SAAS,EAAE,EAAEJ,aAAa,EAAE,EAAEH,MAAMM,IAAI,CAAC,CAAC;IACjF;IACAE,WAAW;QAAC;KAAO;AACrB,EAAC;AAED,OAAO,MAAMC,wBAA4C;IACvDX,WAAW,OAAO,EAAEC,UAAU,EAAEC,IAAI,EAAEC,MAAM,EAAE;QAC5C,MAAME,eAAe,MAAMP,0BAA0B;YACnDG;YACAK,cAAcJ,KAAKK,QAAQ;YAC3BJ,QAAQ;gBACN,GAAGD,IAAI;gBACPC;YACF;QACF;QAEA,IAAI,cAAcA,UAAUA,QAAQM,aAAa,SAAS;YACxD,OAAO,CAAC,iBAAiB,EAAEP,KAAKU,OAAO,GAAG,SAAS,QAAQ,QAAQ,EACjE,uBAAuBV,KAAKU,OAAO,GAC/B,+BACA,+BACL;;mBAEY,EAAE,CAAC,EAAE;gBACR,EAAEV,MAAMW,MAAM;;UAEpB,EAAER,aAAa;eACV,CAAC;QACZ,OAAO;YACL,OAAO,CAAC,UAAU,EAAEH,MAAMW,MAAM,CAAC,EAAER,aAAa,KAAK,CAAC;QACxD;IACF;IACAK,WAAW;QAAC;KAAW;AACzB,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utilities/lexical/converters/paragraph.ts"],"sourcesContent":["import type { HTMLConverter } from '../types.js'\n\nimport { convertLexicalNodesToHTML } from '../serializeLexical.js'\n\nexport const ParagraphHTMLConverter: HTMLConverter<any> = {\n async converter({ converters, node, parent, submissionData }) {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n submissionData,\n })\n return `<p>${childrenText}</p>`\n },\n nodeTypes: ['paragraph'],\n}\n"],"names":["convertLexicalNodesToHTML","ParagraphHTMLConverter","converter","converters","node","parent","submissionData","childrenText","lexicalNodes","children","nodeTypes"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/utilities/lexical/converters/paragraph.ts"],"sourcesContent":["import type { HTMLConverter } from '../types.js'\n\nimport { convertLexicalNodesToHTML } from '../serializeLexical.js'\n\nexport const ParagraphHTMLConverter: HTMLConverter<any> = {\n async converter({ converters, node, parent, submissionData }) {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n submissionData,\n })\n return `<p>${childrenText}</p>`\n },\n nodeTypes: ['paragraph'],\n}\n"],"names":["convertLexicalNodesToHTML","ParagraphHTMLConverter","converter","converters","node","parent","submissionData","childrenText","lexicalNodes","children","nodeTypes"],"mappings":"AAEA,SAASA,yBAAyB,QAAQ,yBAAwB;AAElE,OAAO,MAAMC,yBAA6C;IACxD,MAAMC,WAAU,EAAEC,UAAU,EAAEC,IAAI,EAAEC,MAAM,EAAEC,cAAc,EAAE;QAC1D,MAAMC,eAAe,MAAMP,0BAA0B;YACnDG;YACAK,cAAcJ,KAAKK,QAAQ;YAC3BJ,QAAQ;gBACN,GAAGD,IAAI;gBACPC;YACF;YACAC;QACF;QACA,OAAO,CAAC,GAAG,EAAEC,aAAa,IAAI,CAAC;IACjC;IACAG,WAAW;QAAC;KAAY;AAC1B,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utilities/lexical/converters/quote.ts"],"sourcesContent":["import type { HTMLConverter } from '../types.js'\n\nimport { convertLexicalNodesToHTML } from '../serializeLexical.js'\n\nexport const QuoteHTMLConverter: HTMLConverter<any> = {\n async converter({ converters, node, parent, submissionData }) {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n submissionData,\n })\n\n return `<blockquote>${childrenText}</blockquote>`\n },\n nodeTypes: ['quote'],\n}\n"],"names":["convertLexicalNodesToHTML","QuoteHTMLConverter","converter","converters","node","parent","submissionData","childrenText","lexicalNodes","children","nodeTypes"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/utilities/lexical/converters/quote.ts"],"sourcesContent":["import type { HTMLConverter } from '../types.js'\n\nimport { convertLexicalNodesToHTML } from '../serializeLexical.js'\n\nexport const QuoteHTMLConverter: HTMLConverter<any> = {\n async converter({ converters, node, parent, submissionData }) {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n submissionData,\n })\n\n return `<blockquote>${childrenText}</blockquote>`\n },\n nodeTypes: ['quote'],\n}\n"],"names":["convertLexicalNodesToHTML","QuoteHTMLConverter","converter","converters","node","parent","submissionData","childrenText","lexicalNodes","children","nodeTypes"],"mappings":"AAEA,SAASA,yBAAyB,QAAQ,yBAAwB;AAElE,OAAO,MAAMC,qBAAyC;IACpD,MAAMC,WAAU,EAAEC,UAAU,EAAEC,IAAI,EAAEC,MAAM,EAAEC,cAAc,EAAE;QAC1D,MAAMC,eAAe,MAAMP,0BAA0B;YACnDG;YACAK,cAAcJ,KAAKK,QAAQ;YAC3BJ,QAAQ;gBACN,GAAGD,IAAI;gBACPC;YACF;YACAC;QACF;QAEA,OAAO,CAAC,YAAY,EAAEC,aAAa,aAAa,CAAC;IACnD;IACAG,WAAW;QAAC;KAAQ;AACtB,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/utilities/lexical/converters/text.ts"],"sourcesContent":["import type { HTMLConverter } from '../types.js'\n\nimport { replaceDoubleCurlys } from '../../replaceDoubleCurlys.js'\nimport { NodeFormat } from '../nodeFormat.js'\n\nexport const TextHTMLConverter: HTMLConverter<any> = {\n converter({ node, submissionData }) {\n let text = node.text\n\n if (submissionData) {\n text = replaceDoubleCurlys(text, submissionData)\n }\n\n if (node.format & NodeFormat.IS_BOLD) {\n text = `<strong>${text}</strong>`\n }\n if (node.format & NodeFormat.IS_ITALIC) {\n text = `<em>${text}</em>`\n }\n if (node.format & NodeFormat.IS_STRIKETHROUGH) {\n text = `<span style=\"text-decoration: line-through\">${text}</span>`\n }\n if (node.format & NodeFormat.IS_UNDERLINE) {\n text = `<span style=\"text-decoration: underline\">${text}</span>`\n }\n if (node.format & NodeFormat.IS_CODE) {\n text = `<code>${text}</code>`\n }\n if (node.format & NodeFormat.IS_SUBSCRIPT) {\n text = `<sub>${text}</sub>`\n }\n if (node.format & NodeFormat.IS_SUPERSCRIPT) {\n text = `<sup>${text}</sup>`\n }\n\n return text\n },\n nodeTypes: ['text'],\n}\n"],"names":["replaceDoubleCurlys","NodeFormat","TextHTMLConverter","converter","node","submissionData","text","format","IS_BOLD","IS_ITALIC","IS_STRIKETHROUGH","IS_UNDERLINE","IS_CODE","IS_SUBSCRIPT","IS_SUPERSCRIPT","nodeTypes"],"
|
|
1
|
+
{"version":3,"sources":["../../../../src/utilities/lexical/converters/text.ts"],"sourcesContent":["import type { HTMLConverter } from '../types.js'\n\nimport { replaceDoubleCurlys } from '../../replaceDoubleCurlys.js'\nimport { NodeFormat } from '../nodeFormat.js'\n\nexport const TextHTMLConverter: HTMLConverter<any> = {\n converter({ node, submissionData }) {\n let text = node.text\n\n if (submissionData) {\n text = replaceDoubleCurlys(text, submissionData)\n }\n\n if (node.format & NodeFormat.IS_BOLD) {\n text = `<strong>${text}</strong>`\n }\n if (node.format & NodeFormat.IS_ITALIC) {\n text = `<em>${text}</em>`\n }\n if (node.format & NodeFormat.IS_STRIKETHROUGH) {\n text = `<span style=\"text-decoration: line-through\">${text}</span>`\n }\n if (node.format & NodeFormat.IS_UNDERLINE) {\n text = `<span style=\"text-decoration: underline\">${text}</span>`\n }\n if (node.format & NodeFormat.IS_CODE) {\n text = `<code>${text}</code>`\n }\n if (node.format & NodeFormat.IS_SUBSCRIPT) {\n text = `<sub>${text}</sub>`\n }\n if (node.format & NodeFormat.IS_SUPERSCRIPT) {\n text = `<sup>${text}</sup>`\n }\n\n return text\n },\n nodeTypes: ['text'],\n}\n"],"names":["replaceDoubleCurlys","NodeFormat","TextHTMLConverter","converter","node","submissionData","text","format","IS_BOLD","IS_ITALIC","IS_STRIKETHROUGH","IS_UNDERLINE","IS_CODE","IS_SUBSCRIPT","IS_SUPERSCRIPT","nodeTypes"],"mappings":"AAEA,SAASA,mBAAmB,QAAQ,+BAA8B;AAClE,SAASC,UAAU,QAAQ,mBAAkB;AAE7C,OAAO,MAAMC,oBAAwC;IACnDC,WAAU,EAAEC,IAAI,EAAEC,cAAc,EAAE;QAChC,IAAIC,OAAOF,KAAKE,IAAI;QAEpB,IAAID,gBAAgB;YAClBC,OAAON,oBAAoBM,MAAMD;QACnC;QAEA,IAAID,KAAKG,MAAM,GAAGN,WAAWO,OAAO,EAAE;YACpCF,OAAO,CAAC,QAAQ,EAAEA,KAAK,SAAS,CAAC;QACnC;QACA,IAAIF,KAAKG,MAAM,GAAGN,WAAWQ,SAAS,EAAE;YACtCH,OAAO,CAAC,IAAI,EAAEA,KAAK,KAAK,CAAC;QAC3B;QACA,IAAIF,KAAKG,MAAM,GAAGN,WAAWS,gBAAgB,EAAE;YAC7CJ,OAAO,CAAC,4CAA4C,EAAEA,KAAK,OAAO,CAAC;QACrE;QACA,IAAIF,KAAKG,MAAM,GAAGN,WAAWU,YAAY,EAAE;YACzCL,OAAO,CAAC,yCAAyC,EAAEA,KAAK,OAAO,CAAC;QAClE;QACA,IAAIF,KAAKG,MAAM,GAAGN,WAAWW,OAAO,EAAE;YACpCN,OAAO,CAAC,MAAM,EAAEA,KAAK,OAAO,CAAC;QAC/B;QACA,IAAIF,KAAKG,MAAM,GAAGN,WAAWY,YAAY,EAAE;YACzCP,OAAO,CAAC,KAAK,EAAEA,KAAK,MAAM,CAAC;QAC7B;QACA,IAAIF,KAAKG,MAAM,GAAGN,WAAWa,cAAc,EAAE;YAC3CR,OAAO,CAAC,KAAK,EAAEA,KAAK,MAAM,CAAC;QAC7B;QAEA,OAAOA;IACT;IACAS,WAAW;QAAC;KAAO;AACrB,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utilities/lexical/defaultConverters.ts"],"sourcesContent":["import type { HTMLConverter } from './types.js'\n\nimport { HeadingHTMLConverter } from './converters/heading.js'\nimport { LinebreakHTMLConverter } from './converters/linebreak.js'\nimport { LinkHTMLConverter } from './converters/link.js'\nimport { ListHTMLConverter, ListItemHTMLConverter } from './converters/list.js'\nimport { ParagraphHTMLConverter } from './converters/paragraph.js'\nimport { QuoteHTMLConverter } from './converters/quote.js'\nimport { TextHTMLConverter } from './converters/text.js'\n\nexport const defaultHTMLConverters: HTMLConverter[] = [\n ParagraphHTMLConverter,\n TextHTMLConverter,\n LinebreakHTMLConverter,\n LinkHTMLConverter,\n HeadingHTMLConverter,\n QuoteHTMLConverter,\n ListHTMLConverter,\n ListItemHTMLConverter,\n]\n"],"names":["HeadingHTMLConverter","LinebreakHTMLConverter","LinkHTMLConverter","ListHTMLConverter","ListItemHTMLConverter","ParagraphHTMLConverter","QuoteHTMLConverter","TextHTMLConverter","defaultHTMLConverters"],"
|
|
1
|
+
{"version":3,"sources":["../../../src/utilities/lexical/defaultConverters.ts"],"sourcesContent":["import type { HTMLConverter } from './types.js'\n\nimport { HeadingHTMLConverter } from './converters/heading.js'\nimport { LinebreakHTMLConverter } from './converters/linebreak.js'\nimport { LinkHTMLConverter } from './converters/link.js'\nimport { ListHTMLConverter, ListItemHTMLConverter } from './converters/list.js'\nimport { ParagraphHTMLConverter } from './converters/paragraph.js'\nimport { QuoteHTMLConverter } from './converters/quote.js'\nimport { TextHTMLConverter } from './converters/text.js'\n\nexport const defaultHTMLConverters: HTMLConverter[] = [\n ParagraphHTMLConverter,\n TextHTMLConverter,\n LinebreakHTMLConverter,\n LinkHTMLConverter,\n HeadingHTMLConverter,\n QuoteHTMLConverter,\n ListHTMLConverter,\n ListItemHTMLConverter,\n]\n"],"names":["HeadingHTMLConverter","LinebreakHTMLConverter","LinkHTMLConverter","ListHTMLConverter","ListItemHTMLConverter","ParagraphHTMLConverter","QuoteHTMLConverter","TextHTMLConverter","defaultHTMLConverters"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ,0BAAyB;AAC9D,SAASC,sBAAsB,QAAQ,4BAA2B;AAClE,SAASC,iBAAiB,QAAQ,uBAAsB;AACxD,SAASC,iBAAiB,EAAEC,qBAAqB,QAAQ,uBAAsB;AAC/E,SAASC,sBAAsB,QAAQ,4BAA2B;AAClE,SAASC,kBAAkB,QAAQ,wBAAuB;AAC1D,SAASC,iBAAiB,QAAQ,uBAAsB;AAExD,OAAO,MAAMC,wBAAyC;IACpDH;IACAE;IACAN;IACAC;IACAF;IACAM;IACAH;IACAC;CACD,CAAA"}
|