@payloadcms/plugin-form-builder 3.93.0 → 3.94.0
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/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -3,5 +3,7 @@ import type { FormBuilderPluginConfig } from './types.js';
|
|
|
3
3
|
export { fields } from './collections/Forms/fields.js';
|
|
4
4
|
export { translations as formBuilderTranslations } from './translations/index.js';
|
|
5
5
|
export { getPaymentTotal } from './utilities/getPaymentTotal.js';
|
|
6
|
-
export declare const formBuilderPlugin: (incomingFormConfig: FormBuilderPluginConfig) => (config: Config) => Config
|
|
6
|
+
export declare const formBuilderPlugin: (incomingFormConfig: FormBuilderPluginConfig) => ((config: Config) => Config) & {
|
|
7
|
+
slug: string;
|
|
8
|
+
};
|
|
7
9
|
//# 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":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAKrC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAMzD,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AACtD,OAAO,EAAE,YAAY,IAAI,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAEhE,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAKrC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAMzD,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AACtD,OAAO,EAAE,YAAY,IAAI,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAEhE,eAAO,MAAM,iBAAiB,uBAAwB,uBAAuB,eACnD,MAAM,KAAG,MAAM;;CAgExC,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,8 @@ import { translations } from './translations/index.js';
|
|
|
5
5
|
export { fields } from './collections/Forms/fields.js';
|
|
6
6
|
export { translations as formBuilderTranslations } from './translations/index.js';
|
|
7
7
|
export { getPaymentTotal } from './utilities/getPaymentTotal.js';
|
|
8
|
-
export const formBuilderPlugin = (incomingFormConfig)=>
|
|
8
|
+
export const formBuilderPlugin = (incomingFormConfig)=>{
|
|
9
|
+
const plugin = (config)=>{
|
|
9
10
|
if (!config.i18n) {
|
|
10
11
|
config.i18n = {};
|
|
11
12
|
}
|
|
@@ -57,5 +58,9 @@ export const formBuilderPlugin = (incomingFormConfig)=>(config)=>{
|
|
|
57
58
|
}
|
|
58
59
|
};
|
|
59
60
|
};
|
|
61
|
+
return Object.assign(plugin, {
|
|
62
|
+
slug: '@payloadcms/plugin-form-builder'
|
|
63
|
+
});
|
|
64
|
+
};
|
|
60
65
|
|
|
61
66
|
//# 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 { deepMergeSimple } from 'payload'\n\nimport type { PluginDefaultTranslationsObject } from './translations/types.js'\nimport type { FormBuilderPluginConfig } from './types.js'\n\nimport { generateFormCollection } from './collections/Forms/index.js'\nimport { generateSubmissionCollection } from './collections/FormSubmissions/index.js'\nimport { translations } from './translations/index.js'\n\nexport { fields } from './collections/Forms/fields.js'\nexport { translations as formBuilderTranslations } from './translations/index.js'\nexport { getPaymentTotal } from './utilities/getPaymentTotal.js'\n\nexport const formBuilderPlugin
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from 'payload'\n\nimport { deepMergeSimple } from 'payload'\n\nimport type { PluginDefaultTranslationsObject } from './translations/types.js'\nimport type { FormBuilderPluginConfig } from './types.js'\n\nimport { generateFormCollection } from './collections/Forms/index.js'\nimport { generateSubmissionCollection } from './collections/FormSubmissions/index.js'\nimport { translations } from './translations/index.js'\n\nexport { fields } from './collections/Forms/fields.js'\nexport { translations as formBuilderTranslations } from './translations/index.js'\nexport { getPaymentTotal } from './utilities/getPaymentTotal.js'\n\nexport const formBuilderPlugin = (incomingFormConfig: FormBuilderPluginConfig) => {\n const plugin = (config: Config): Config => {\n if (!config.i18n) {\n config.i18n = {}\n }\n\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 /**\n * Merge plugin translations — only for languages the user has enabled.\n * Plugins run before sanitize, so `supportedLanguages` may be undefined; sanitize will\n * default it to `{ en }`, so we mirror that here to avoid merging 40+ unused tables.\n */\n const supportedLanguageKeys = config.i18n?.supportedLanguages\n ? Object.keys(config.i18n.supportedLanguages)\n : ['en']\n\n const flattenedTranslations: Record<string, PluginDefaultTranslationsObject> = {}\n for (const lang of supportedLanguageKeys) {\n const entry = translations[lang as keyof typeof translations] ?? translations.en!\n flattenedTranslations[lang] = entry.translations\n }\n\n return {\n ...config,\n collections: [\n ...(config?.collections || []),\n generateFormCollection(formConfig, config?.collections),\n generateSubmissionCollection(formConfig),\n ],\n i18n: {\n ...config.i18n,\n translations: deepMergeSimple(flattenedTranslations, config.i18n?.translations ?? {}),\n },\n }\n }\n\n return Object.assign(plugin, { slug: '@payloadcms/plugin-form-builder' })\n}\n"],"names":["deepMergeSimple","generateFormCollection","generateSubmissionCollection","translations","fields","formBuilderTranslations","getPaymentTotal","formBuilderPlugin","incomingFormConfig","plugin","config","i18n","formConfig","checkbox","country","email","message","number","payment","select","state","text","textarea","upload","isUploadFieldEnabled","hasUploadCollections","Array","isArray","uploadCollections","length","console","warn","supportedLanguageKeys","supportedLanguages","Object","keys","flattenedTranslations","lang","entry","en","collections","assign","slug"],"mappings":"AAEA,SAASA,eAAe,QAAQ,UAAS;AAKzC,SAASC,sBAAsB,QAAQ,+BAA8B;AACrE,SAASC,4BAA4B,QAAQ,yCAAwC;AACrF,SAASC,YAAY,QAAQ,0BAAyB;AAEtD,SAASC,MAAM,QAAQ,gCAA+B;AACtD,SAASD,gBAAgBE,uBAAuB,QAAQ,0BAAyB;AACjF,SAASC,eAAe,QAAQ,iCAAgC;AAEhE,OAAO,MAAMC,oBAAoB,CAACC;IAChC,MAAMC,SAAS,CAACC;QACd,IAAI,CAACA,OAAOC,IAAI,EAAE;YAChBD,OAAOC,IAAI,GAAG,CAAC;QACjB;QAEA,MAAMC,aAAsC;YAC1C,GAAGJ,kBAAkB;YACrBJ,QAAQ;gBACNS,UAAU;gBACVC,SAAS;gBACTC,OAAO;gBACPC,SAAS;gBACTC,QAAQ;gBACRC,SAAS;gBACTC,QAAQ;gBACRC,OAAO;gBACPC,MAAM;gBACNC,UAAU;gBACVC,QAAQ;gBACR,GAAGf,mBAAmBJ,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;;;;KAIC,GACD,MAAMC,wBAAwBtB,OAAOC,IAAI,EAAEsB,qBACvCC,OAAOC,IAAI,CAACzB,OAAOC,IAAI,CAACsB,kBAAkB,IAC1C;YAAC;SAAK;QAEV,MAAMG,wBAAyE,CAAC;QAChF,KAAK,MAAMC,QAAQL,sBAAuB;YACxC,MAAMM,QAAQnC,YAAY,CAACkC,KAAkC,IAAIlC,aAAaoC,EAAE;YAChFH,qBAAqB,CAACC,KAAK,GAAGC,MAAMnC,YAAY;QAClD;QAEA,OAAO;YACL,GAAGO,MAAM;YACT8B,aAAa;mBACP9B,QAAQ8B,eAAe,EAAE;gBAC7BvC,uBAAuBW,YAAYF,QAAQ8B;gBAC3CtC,6BAA6BU;aAC9B;YACDD,MAAM;gBACJ,GAAGD,OAAOC,IAAI;gBACdR,cAAcH,gBAAgBoC,uBAAuB1B,OAAOC,IAAI,EAAER,gBAAgB,CAAC;YACrF;QACF;IACF;IAEA,OAAO+B,OAAOO,MAAM,CAAChC,QAAQ;QAAEiC,MAAM;IAAkC;AACzE,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-form-builder",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.94.0",
|
|
4
4
|
"description": "Form builder plugin for Payload CMS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"payload",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"dist"
|
|
63
63
|
],
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@payloadcms/translations": "3.
|
|
66
|
-
"@payloadcms/ui": "3.
|
|
65
|
+
"@payloadcms/translations": "3.94.0",
|
|
66
|
+
"@payloadcms/ui": "3.94.0",
|
|
67
67
|
"escape-html": "^1.0.3"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
@@ -73,12 +73,12 @@
|
|
|
73
73
|
"@types/react-dom": "19.2.3",
|
|
74
74
|
"copyfiles": "^2.4.1",
|
|
75
75
|
"cross-env": "^7.0.3",
|
|
76
|
-
"payload": "3.
|
|
76
|
+
"payload": "3.94.0"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"payload": "3.
|
|
80
|
-
"react": "
|
|
81
|
-
"react-dom": "
|
|
79
|
+
"payload": "3.94.0",
|
|
80
|
+
"react": "~19.0.9 || ~19.1.10 || ~19.2.9 || ^19.3.1",
|
|
81
|
+
"react-dom": "~19.0.9 || ~19.1.10 || ~19.2.9 || ^19.3.1"
|
|
82
82
|
},
|
|
83
83
|
"publishConfig": {
|
|
84
84
|
"registry": "https://registry.npmjs.org/"
|