@payloadcms/plugin-form-builder 4.0.0-internal.5f0cd13 → 4.0.0-internal.811e0a4
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/LICENSE.md +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2018-
|
|
3
|
+
Copyright (c) 2018-2026 Payload CMS, LLC <info@payloadcms.com>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Config } from 'payload';
|
|
2
1
|
import type { FormBuilderPluginConfig } from './types.js';
|
|
3
2
|
export { fields } from './collections/Forms/fields.js';
|
|
4
3
|
export { getPaymentTotal } from './utilities/getPaymentTotal.js';
|
|
5
|
-
export declare const formBuilderPlugin: (
|
|
4
|
+
export declare const formBuilderPlugin: (options: FormBuilderPluginConfig) => import("payload").Plugin;
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,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,gEAyC5B,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { definePlugin } from 'payload';
|
|
1
2
|
import { generateFormCollection } from './collections/Forms/index.js';
|
|
2
3
|
import { generateSubmissionCollection } from './collections/FormSubmissions/index.js';
|
|
3
4
|
export { fields } from './collections/Forms/fields.js';
|
|
4
5
|
export { getPaymentTotal } from './utilities/getPaymentTotal.js';
|
|
5
|
-
export const formBuilderPlugin = (
|
|
6
|
+
export const formBuilderPlugin = definePlugin({
|
|
7
|
+
slug: '@payloadcms/plugin-form-builder',
|
|
8
|
+
plugin: ({ config, options: incomingFormConfig })=>{
|
|
6
9
|
const formConfig = {
|
|
7
10
|
...incomingFormConfig,
|
|
8
11
|
fields: {
|
|
@@ -34,6 +37,7 @@ export const formBuilderPlugin = (incomingFormConfig)=>(config)=>{
|
|
|
34
37
|
generateSubmissionCollection(formConfig)
|
|
35
38
|
]
|
|
36
39
|
};
|
|
37
|
-
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
38
42
|
|
|
39
43
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { definePlugin } from 'payload'\n\nimport type { FormBuilderPluginConfig } from './types.js'\n\nimport { generateFormCollection } from './collections/Forms/index.js'\nimport { generateSubmissionCollection } from './collections/FormSubmissions/index.js'\n\nexport { fields } from './collections/Forms/fields.js'\nexport { getPaymentTotal } from './utilities/getPaymentTotal.js'\n\nexport const formBuilderPlugin = definePlugin<FormBuilderPluginConfig>({\n slug: '@payloadcms/plugin-form-builder',\n plugin: ({ config, options: incomingFormConfig }) => {\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 upload: false,\n ...incomingFormConfig.fields,\n },\n }\n\n const isUploadFieldEnabled = formConfig.fields?.upload !== false\n const hasUploadCollections =\n Array.isArray(formConfig.uploadCollections) && formConfig.uploadCollections.length > 0\n\n if (isUploadFieldEnabled && !hasUploadCollections) {\n // eslint-disable-next-line no-console\n console.warn(\n '[plugin-form-builder] fields.upload is enabled but uploadCollections is empty or missing. Upload fields will not be registered. Set uploadCollections to an array of upload-enabled collection slugs.',\n )\n }\n\n return {\n ...config,\n collections: [\n ...(config?.collections || []),\n generateFormCollection(formConfig, config?.collections),\n generateSubmissionCollection(formConfig),\n ],\n }\n },\n})\n"],"names":["definePlugin","generateFormCollection","generateSubmissionCollection","fields","getPaymentTotal","formBuilderPlugin","slug","plugin","config","options","incomingFormConfig","formConfig","checkbox","country","email","message","number","payment","select","state","text","textarea","upload","isUploadFieldEnabled","hasUploadCollections","Array","isArray","uploadCollections","length","console","warn","collections"],"mappings":"AAAA,SAASA,YAAY,QAAQ,UAAS;AAItC,SAASC,sBAAsB,QAAQ,+BAA8B;AACrE,SAASC,4BAA4B,QAAQ,yCAAwC;AAErF,SAASC,MAAM,QAAQ,gCAA+B;AACtD,SAASC,eAAe,QAAQ,iCAAgC;AAEhE,OAAO,MAAMC,oBAAoBL,aAAsC;IACrEM,MAAM;IACNC,QAAQ,CAAC,EAAEC,MAAM,EAAEC,SAASC,kBAAkB,EAAE;QAC9C,MAAMC,aAAsC;YAC1C,GAAGD,kBAAkB;YACrBP,QAAQ;gBACNS,UAAU;gBACVC,SAAS;gBACTC,OAAO;gBACPC,SAAS;gBACTC,QAAQ;gBACRC,SAAS;gBACTC,QAAQ;gBACRC,OAAO;gBACPC,MAAM;gBACNC,UAAU;gBACVC,QAAQ;gBACR,GAAGZ,mBAAmBP,MAAM;YAC9B;QACF;QAEA,MAAMoB,uBAAuBZ,WAAWR,MAAM,EAAEmB,WAAW;QAC3D,MAAME,uBACJC,MAAMC,OAAO,CAACf,WAAWgB,iBAAiB,KAAKhB,WAAWgB,iBAAiB,CAACC,MAAM,GAAG;QAEvF,IAAIL,wBAAwB,CAACC,sBAAsB;YACjD,sCAAsC;YACtCK,QAAQC,IAAI,CACV;QAEJ;QAEA,OAAO;YACL,GAAGtB,MAAM;YACTuB,aAAa;mBACPvB,QAAQuB,eAAe,EAAE;gBAC7B9B,uBAAuBU,YAAYH,QAAQuB;gBAC3C7B,6BAA6BS;aAC9B;QACH;IACF;AACF,GAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-form-builder",
|
|
3
|
-
"version": "4.0.0-internal.
|
|
3
|
+
"version": "4.0.0-internal.811e0a4",
|
|
4
4
|
"description": "Form builder plugin for Payload CMS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"payload",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"escape-html": "^1.0.3",
|
|
56
|
-
"@payloadcms/ui": "4.0.0-internal.
|
|
56
|
+
"@payloadcms/ui": "4.0.0-internal.811e0a4"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/escape-html": "^1.0.4",
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
"@types/react-dom": "19.2.3",
|
|
62
62
|
"copyfiles": "^2.4.1",
|
|
63
63
|
"cross-env": "10.1.0",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
64
|
+
"payload": "4.0.0-internal.811e0a4",
|
|
65
|
+
"@payloadcms/eslint-config": "3.28.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^19.0.1 || ^19.1.2 || ^19.2.1",
|
|
69
69
|
"react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
|
|
70
|
-
"payload": "4.0.0-internal.
|
|
70
|
+
"payload": "4.0.0-internal.811e0a4"
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"registry": "https://registry.npmjs.org/"
|