@payloadcms/plugin-form-builder 4.0.0-internal.d28e9fb → 4.0.0-internal.fa345ef

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2018-2025 Payload CMS, Inc. <info@payloadcms.com>
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
@@ -1 +1 @@
1
- {"version":3,"file":"createCharge.d.ts","sourceRoot":"","sources":["../../../../src/collections/FormSubmissions/hooks/createCharge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEhE,eAAO,MAAM,YAAY,qBACL,GAAG,cACT,uBAAuB,KAClC,OAAO,CAAC,GAAG,CAeb,CAAA"}
1
+ {"version":3,"file":"createCharge.d.ts","sourceRoot":"","sources":["../../../../src/collections/FormSubmissions/hooks/createCharge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAEhE,eAAO,MAAM,YAAY,GACvB,kBAAkB,GAAG,EACrB,YAAY,uBAAuB,KAClC,OAAO,CAAC,GAAG,CAeb,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"handleUploads.d.ts","sourceRoot":"","sources":["../../../../src/collections/FormSubmissions/hooks/handleUploads.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAK3B,MAAM,SAAS,CAAA;AAKhB,OAAO,KAAK,EACV,uBAAuB,EAIxB,MAAM,mBAAmB,CAAA;AAE1B,KAAK,kBAAkB,GAAG,UAAU,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAA;AAOnE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,uBACJ,kBAAkB,cAC1B,uBAAuB,0BAiSpC,CAAA"}
1
+ {"version":3,"file":"handleUploads.d.ts","sourceRoot":"","sources":["../../../../src/collections/FormSubmissions/hooks/handleUploads.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAK3B,MAAM,SAAS,CAAA;AAKhB,OAAO,KAAK,EACV,uBAAuB,EAIxB,MAAM,mBAAmB,CAAA;AAE1B,KAAK,kBAAkB,GAAG,UAAU,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAA;AAOnE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,GACxB,oBAAoB,kBAAkB,EACtC,YAAY,uBAAuB,0BAiSpC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"sendEmail.d.ts","sourceRoot":"","sources":["../../../../src/collections/FormSubmissions/hooks/sendEmail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAExD,OAAO,KAAK,EAAyB,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAKvF,KAAK,iBAAiB,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAA;AAEjE,eAAO,MAAM,SAAS,0BACG,iBAAiB,cAC5B,uBAAuB,kBA8FpC,CAAA"}
1
+ {"version":3,"file":"sendEmail.d.ts","sourceRoot":"","sources":["../../../../src/collections/FormSubmissions/hooks/sendEmail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AAExD,OAAO,KAAK,EAAyB,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAKvF,KAAK,iBAAiB,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,CAAA;AAEjE,eAAO,MAAM,SAAS,GACpB,uBAAuB,iBAAiB,EACxC,YAAY,uBAAuB,kBA8FpC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/collections/FormSubmissions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA8B,gBAAgB,EAAS,MAAM,SAAS,CAAA;AAElF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAQ7D,eAAO,MAAM,4BAA4B,eAC3B,uBAAuB,KAClC,gBAiIF,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/collections/FormSubmissions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA8B,gBAAgB,EAAS,MAAM,SAAS,CAAA;AAElF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAQ7D,eAAO,MAAM,4BAA4B,GACvC,YAAY,uBAAuB,KAClC,gBAiIF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/collections/Forms/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,gBAAgB,EAAE,MAAM,EAAS,MAAM,SAAS,CAAA;AAIrE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AA+B7D,eAAO,MAAM,sBAAsB,eACrB,uBAAuB,gBACrB,MAAM,CAAC,aAAa,CAAC,KAClC,gBAqPF,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/collections/Forms/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,gBAAgB,EAAE,MAAM,EAAS,MAAM,SAAS,CAAA;AAIrE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AA+B7D,eAAO,MAAM,sBAAsB,GACjC,YAAY,uBAAuB,EACnC,cAAc,MAAM,CAAC,aAAa,CAAC,KAClC,gBAqPF,CAAA"}
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: (incomingFormConfig: FormBuilderPluginConfig) => (config: Config) => Config;
4
+ export declare const formBuilderPlugin: (options: FormBuilderPluginConfig) => import("payload").Plugin;
6
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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,MAsCjB,CAAA"}
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 = (incomingFormConfig)=>(config)=>{
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 type { Config } 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 =\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 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"],"names":["generateFormCollection","generateSubmissionCollection","fields","getPaymentTotal","formBuilderPlugin","incomingFormConfig","config","formConfig","checkbox","country","email","message","number","payment","select","state","text","textarea","upload","isUploadFieldEnabled","hasUploadCollections","Array","isArray","uploadCollections","length","console","warn","collections"],"mappings":"AAIA,SAASA,sBAAsB,QAAQ,+BAA8B;AACrE,SAASC,4BAA4B,QAAQ,yCAAwC;AAErF,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;gBACVC,QAAQ;gBACR,GAAGb,mBAAmBH,MAAM;YAC9B;QACF;QAEA,MAAMiB,uBAAuBZ,WAAWL,MAAM,EAAEgB,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,GAAGpB,MAAM;YACTqB,aAAa;mBACPrB,QAAQqB,eAAe,EAAE;gBAC7B3B,uBAAuBO,YAAYD,QAAQqB;gBAC3C1B,6BAA6BM;aAC9B;QACH;IACF,EAAC"}
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"}
@@ -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;IACJ,WAAW,EAAE,WAAW,CAAA;CACzB,GAAG,OAAO,CAAC,YAAY,CAAC,KACxB,MA8CF,CAAA"}
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,GAC1B,MAAM;IACJ,WAAW,EAAE,WAAW,CAAA;CACzB,GAAG,OAAO,CAAC,YAAY,CAAC,KACxB,MA8CF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"replaceDoubleCurlys.d.ts","sourceRoot":"","sources":["../../src/utilities/replaceDoubleCurlys.ts"],"names":[],"mappings":"AAIA,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED,KAAK,cAAc,GAAG,aAAa,EAAE,CAAA;AAErC,eAAO,MAAM,mBAAmB,QAAS,MAAM,cAAc,cAAc,KAAG,MA8B7E,CAAA"}
1
+ {"version":3,"file":"replaceDoubleCurlys.d.ts","sourceRoot":"","sources":["../../src/utilities/replaceDoubleCurlys.ts"],"names":[],"mappings":"AAIA,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED,KAAK,cAAc,GAAG,aAAa,EAAE,CAAA;AAErC,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,EAAE,YAAY,cAAc,KAAG,MA8B7E,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/plugin-form-builder",
3
- "version": "4.0.0-internal.d28e9fb",
3
+ "version": "4.0.0-internal.fa345ef",
4
4
  "description": "Form builder plugin for Payload CMS",
5
5
  "keywords": [
6
6
  "payload",
@@ -53,21 +53,21 @@
53
53
  ],
54
54
  "dependencies": {
55
55
  "escape-html": "^1.0.3",
56
- "@payloadcms/ui": "4.0.0-internal.d28e9fb"
56
+ "@payloadcms/ui": "4.0.0-internal.fa345ef"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/escape-html": "^1.0.4",
60
60
  "@types/react": "19.2.14",
61
61
  "@types/react-dom": "19.2.3",
62
62
  "copyfiles": "^2.4.1",
63
- "cross-env": "^7.0.3",
64
- "payload": "4.0.0-internal.d28e9fb",
65
- "@payloadcms/eslint-config": "3.28.0"
63
+ "cross-env": "10.1.0",
64
+ "@payloadcms/eslint-config": "3.28.0",
65
+ "payload": "4.0.0-internal.fa345ef"
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.d28e9fb"
70
+ "payload": "4.0.0-internal.fa345ef"
71
71
  },
72
72
  "publishConfig": {
73
73
  "registry": "https://registry.npmjs.org/"