@payloadcms/plugin-form-builder 3.0.0-beta.2 → 3.0.0-beta.20
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/package.json +33 -34
- package/src/index.ts +0 -55
package/package.json
CHANGED
|
@@ -1,26 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-form-builder",
|
|
3
|
+
"version": "3.0.0-beta.20",
|
|
3
4
|
"description": "Form builder plugin for Payload CMS",
|
|
4
|
-
"
|
|
5
|
-
|
|
5
|
+
"keywords": [
|
|
6
|
+
"payload",
|
|
7
|
+
"cms",
|
|
8
|
+
"plugin",
|
|
9
|
+
"typescript",
|
|
10
|
+
"react",
|
|
11
|
+
"forms",
|
|
12
|
+
"fields",
|
|
13
|
+
"form builder",
|
|
14
|
+
"payments"
|
|
15
|
+
],
|
|
6
16
|
"repository": {
|
|
7
17
|
"type": "git",
|
|
8
18
|
"url": "https://github.com/payloadcms/payload.git",
|
|
9
19
|
"directory": "packages/plugin-form-builder"
|
|
10
20
|
},
|
|
11
|
-
"main": "./dist/index.js",
|
|
12
|
-
"types": "./dist/index.d.ts",
|
|
13
21
|
"license": "MIT",
|
|
14
22
|
"author": "dev@payloadcms.com",
|
|
15
23
|
"type": "module",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"import": "./dist/index.js",
|
|
27
|
+
"require": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts"
|
|
29
|
+
}
|
|
19
30
|
},
|
|
31
|
+
"main": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"files": [
|
|
34
|
+
"dist",
|
|
35
|
+
"types.js",
|
|
36
|
+
"types.d.ts"
|
|
37
|
+
],
|
|
20
38
|
"dependencies": {
|
|
21
39
|
"deepmerge": "^4.2.2",
|
|
22
40
|
"escape-html": "^1.0.3",
|
|
23
|
-
"@payloadcms/ui": "3.0.0-beta.
|
|
41
|
+
"@payloadcms/ui": "3.0.0-beta.20"
|
|
24
42
|
},
|
|
25
43
|
"devDependencies": {
|
|
26
44
|
"@types/escape-html": "^1.0.4",
|
|
@@ -29,38 +47,19 @@
|
|
|
29
47
|
"copyfiles": "^2.4.1",
|
|
30
48
|
"cross-env": "^7.0.3",
|
|
31
49
|
"nodemon": "3.0.3",
|
|
32
|
-
"react": "^18.0.0",
|
|
33
50
|
"ts-node": "10.9.1",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
51
|
+
"@payloadcms/eslint-config": "1.1.1",
|
|
52
|
+
"payload": "3.0.0-beta.20"
|
|
36
53
|
},
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
"require": "./dist/index.js",
|
|
41
|
-
"types": "./dist/index.d.ts"
|
|
42
|
-
}
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
56
|
+
"payload": "3.0.0-beta.20"
|
|
43
57
|
},
|
|
44
|
-
"
|
|
45
|
-
"dist",
|
|
46
|
-
"types.js",
|
|
47
|
-
"types.d.ts"
|
|
48
|
-
],
|
|
49
|
-
"keywords": [
|
|
50
|
-
"payload",
|
|
51
|
-
"cms",
|
|
52
|
-
"plugin",
|
|
53
|
-
"typescript",
|
|
54
|
-
"react",
|
|
55
|
-
"forms",
|
|
56
|
-
"fields",
|
|
57
|
-
"form builder",
|
|
58
|
-
"payments"
|
|
59
|
-
],
|
|
58
|
+
"homepage:": "https://payloadcms.com",
|
|
60
59
|
"scripts": {
|
|
60
|
+
"build": "swc ./src -d ./dist --config-file .swcrc",
|
|
61
61
|
"build:swc": "swc ./src -d ./dist --config-file .swcrc",
|
|
62
62
|
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
63
|
-
"build": "swc ./src -d ./dist --config-file .swcrc",
|
|
64
63
|
"clean": "rimraf {dist,*.tsbuildinfo}",
|
|
65
64
|
"test": "echo \"No tests available.\""
|
|
66
65
|
}
|
package/src/index.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { Config } from 'payload/config'
|
|
2
|
-
|
|
3
|
-
import type { PluginConfig } from './types.js'
|
|
4
|
-
|
|
5
|
-
import { generateSubmissionCollection } from './collections/FormSubmissions/index.js'
|
|
6
|
-
import { generateFormCollection } from './collections/Forms/index.js'
|
|
7
|
-
|
|
8
|
-
export { fields } from './collections/Forms/fields.js'
|
|
9
|
-
export { getPaymentTotal } from './utilities/getPaymentTotal.js'
|
|
10
|
-
|
|
11
|
-
const FormBuilder =
|
|
12
|
-
(incomingFormConfig: PluginConfig) =>
|
|
13
|
-
(config: Config): Config => {
|
|
14
|
-
const formConfig: PluginConfig = {
|
|
15
|
-
...incomingFormConfig,
|
|
16
|
-
fields: {
|
|
17
|
-
checkbox: true,
|
|
18
|
-
country: true,
|
|
19
|
-
email: true,
|
|
20
|
-
message: true,
|
|
21
|
-
number: true,
|
|
22
|
-
payment: false,
|
|
23
|
-
select: true,
|
|
24
|
-
state: true,
|
|
25
|
-
text: true,
|
|
26
|
-
textarea: true,
|
|
27
|
-
...incomingFormConfig.fields,
|
|
28
|
-
},
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
...config,
|
|
33
|
-
// admin: {
|
|
34
|
-
// ...config.admin,
|
|
35
|
-
// webpack: (webpackConfig) => ({
|
|
36
|
-
// ...webpackConfig,
|
|
37
|
-
// resolve: {
|
|
38
|
-
// ...webpackConfig.resolve,
|
|
39
|
-
// alias: {
|
|
40
|
-
// ...webpackConfig.resolve.alias,
|
|
41
|
-
// [path.resolve(__dirname, 'collections/FormSubmissions/hooks/sendEmail.ts')]: path.resolve(__dirname, 'mocks/serverModule.js'),
|
|
42
|
-
// [path.resolve(__dirname, 'collections/FormSubmissions/hooks/createCharge.ts')]: path.resolve(__dirname, 'mocks/serverModule.js'),
|
|
43
|
-
// },
|
|
44
|
-
// },
|
|
45
|
-
// })
|
|
46
|
-
// },
|
|
47
|
-
collections: [
|
|
48
|
-
...(config?.collections || []),
|
|
49
|
-
generateFormCollection(formConfig),
|
|
50
|
-
generateSubmissionCollection(formConfig),
|
|
51
|
-
],
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export default FormBuilder
|