@payloadcms/plugin-form-builder 3.0.0-canary.ce278e4 → 3.0.0-canary.ee0375f
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/sendEmail.d.ts.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 +2 -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 +2 -4
- package/dist/collections/Forms/DynamicPriceSelector.js.map +1 -1
- package/dist/collections/Forms/fields.d.ts +1 -1
- package/dist/collections/Forms/fields.d.ts.map +1 -1
- package/dist/utilities/getPaymentTotal.d.ts.map +1 -1
- package/dist/utilities/replaceDoubleCurlys.d.ts.map +1 -1
- package/package.json +11 -11
|
@@ -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,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendEmail.d.ts","sourceRoot":"","sources":["../../../../src/collections/FormSubmissions/hooks/sendEmail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,uBAAuB,EAAkB,MAAM,mBAAmB,CAAA;AAMvF,eAAO,MAAM,SAAS,qBACF,GAAG,cACT,uBAAuB,KAClC,
|
|
1
|
+
{"version":3,"file":"sendEmail.d.ts","sourceRoot":"","sources":["../../../../src/collections/FormSubmissions/hooks/sendEmail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAS,uBAAuB,EAAkB,MAAM,mBAAmB,CAAA;AAMvF,eAAO,MAAM,SAAS,qBACF,GAAG,cACT,uBAAuB,KAClC,OAAO,CAAC,GAAG,CA6Fb,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TextFieldProps } from '@payloadcms/ui
|
|
1
|
+
import type { TextFieldProps } from '@payloadcms/ui';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const DynamicFieldSelector: React.FC<TextFieldProps>;
|
|
4
4
|
//# sourceMappingURL=DynamicFieldSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicFieldSelector.d.ts","sourceRoot":"","sources":["../../../src/collections/Forms/DynamicFieldSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"DynamicFieldSelector.d.ts","sourceRoot":"","sources":["../../../src/collections/Forms/DynamicFieldSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAGpD,OAAO,KAA8B,MAAM,OAAO,CAAA;AAIlD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA8BzD,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { useForm } from '@payloadcms/ui/forms/Form';
|
|
3
|
+
import { SelectField, useForm } from '@payloadcms/ui';
|
|
5
4
|
import React, { useEffect, useState } from 'react';
|
|
6
5
|
export const DynamicFieldSelector = (props)=>{
|
|
7
6
|
const { fields, getDataByPath } = useForm();
|
|
@@ -27,7 +26,7 @@ export const DynamicFieldSelector = (props)=>{
|
|
|
27
26
|
]);
|
|
28
27
|
// TODO: label from config is Record<string, string> | false | string
|
|
29
28
|
// but the FormFieldBase type has only label?: string, changing FormFieldBase breaks other ui components
|
|
30
|
-
return /*#__PURE__*/ _jsx(
|
|
29
|
+
return /*#__PURE__*/ _jsx(SelectField, {
|
|
31
30
|
...props,
|
|
32
31
|
options: options
|
|
33
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/collections/Forms/DynamicFieldSelector.tsx"],"sourcesContent":["'use client'\n\nimport type { TextFieldProps } from '@payloadcms/ui
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/Forms/DynamicFieldSelector.tsx"],"sourcesContent":["'use client'\n\nimport type { TextFieldProps } from '@payloadcms/ui'\n\nimport { SelectField, useForm } from '@payloadcms/ui'\nimport React, { useEffect, useState } from 'react'\n\nimport type { SelectFieldOption } from '../../types.js'\n\nexport const DynamicFieldSelector: React.FC<TextFieldProps> = (props) => {\n const { fields, getDataByPath } = useForm()\n\n const [options, setOptions] = useState<SelectFieldOption[]>([])\n\n useEffect(() => {\n const fields: any[] = getDataByPath('fields')\n\n if (fields) {\n const allNonPaymentFields = fields\n .map((block): SelectFieldOption | null => {\n const { name, blockType, label } = block\n\n if (blockType !== 'payment') {\n return {\n label,\n value: name,\n }\n }\n\n return null\n })\n .filter(Boolean)\n setOptions(allNonPaymentFields)\n }\n }, [fields, getDataByPath])\n\n // TODO: label from config is Record<string, string> | false | string\n // but the FormFieldBase type has only label?: string, changing FormFieldBase breaks other ui components\n return <SelectField {...props} options={options} />\n}\n"],"names":["SelectField","useForm","React","useEffect","useState","DynamicFieldSelector","props","fields","getDataByPath","options","setOptions","allNonPaymentFields","map","block","name","blockType","label","value","filter","Boolean"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAIA,SAASA,WAAW,EAAEC,OAAO,QAAQ,iBAAgB;AACrD,OAAOC,SAASC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAIlD,OAAO,MAAMC,uBAAiD,CAACC;IAC7D,MAAM,EAAEC,MAAM,EAAEC,aAAa,EAAE,GAAGP;IAElC,MAAM,CAACQ,SAASC,WAAW,GAAGN,SAA8B,EAAE;IAE9DD,UAAU;QACR,MAAMI,SAAgBC,cAAc;QAEpC,IAAID,QAAQ;YACV,MAAMI,sBAAsBJ,OACzBK,GAAG,CAAC,CAACC;gBACJ,MAAM,EAAEC,IAAI,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGH;gBAEnC,IAAIE,cAAc,WAAW;oBAC3B,OAAO;wBACLC;wBACAC,OAAOH;oBACT;gBACF;gBAEA,OAAO;YACT,GACCI,MAAM,CAACC;YACVT,WAAWC;QACb;IACF,GAAG;QAACJ;QAAQC;KAAc;IAE1B,qEAAqE;IACrE,yGAAyG;IACzG,qBAAO,KAACR;QAAa,GAAGM,KAAK;QAAEG,SAASA;;AAC1C,EAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TextFieldProps } from '@payloadcms/ui
|
|
1
|
+
import type { TextFieldProps } from '@payloadcms/ui';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export declare const DynamicPriceSelector: React.FC<TextFieldProps>;
|
|
4
4
|
//# sourceMappingURL=DynamicPriceSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DynamicPriceSelector.d.ts","sourceRoot":"","sources":["../../../src/collections/Forms/DynamicPriceSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"DynamicPriceSelector.d.ts","sourceRoot":"","sources":["../../../src/collections/Forms/DynamicPriceSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAIpD,OAAO,KAA8B,MAAM,OAAO,CAAA;AAOlD,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CA2DzD,CAAA"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import { useWatchForm } from '@payloadcms/ui/forms/Form';
|
|
5
|
-
import { useLocale } from '@payloadcms/ui/providers/Locale';
|
|
3
|
+
import { TextField, useLocale, useWatchForm } from '@payloadcms/ui';
|
|
6
4
|
import React, { useEffect, useState } from 'react';
|
|
7
5
|
export const DynamicPriceSelector = (props)=>{
|
|
8
6
|
const { label, path } = props;
|
|
@@ -34,7 +32,7 @@ export const DynamicPriceSelector = (props)=>{
|
|
|
34
32
|
]);
|
|
35
33
|
// TODO: make this a number field, block by Payload
|
|
36
34
|
if (valueType === 'static') {
|
|
37
|
-
return /*#__PURE__*/ _jsx(
|
|
35
|
+
return /*#__PURE__*/ _jsx(TextField, {
|
|
38
36
|
...props
|
|
39
37
|
});
|
|
40
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/collections/Forms/DynamicPriceSelector.tsx"],"sourcesContent":["'use client'\n\nimport type { TextFieldProps } from '@payloadcms/ui
|
|
1
|
+
{"version":3,"sources":["../../../src/collections/Forms/DynamicPriceSelector.tsx"],"sourcesContent":["'use client'\n\nimport type { TextFieldProps } from '@payloadcms/ui'\nimport type { Data } from 'payload'\n\nimport { TextField, useLocale, useWatchForm } from '@payloadcms/ui'\nimport React, { useEffect, useState } from 'react'\n\ntype FieldWithID = {\n id: string\n name: string\n}\n\nexport const DynamicPriceSelector: React.FC<TextFieldProps> = (props) => {\n const { label, path } = props\n\n const { fields, getData, getDataByPath } = useWatchForm()\n\n const locale = useLocale()\n\n const [isNumberField, setIsNumberField] = useState<boolean>()\n const [valueType, setValueType] = useState<'static' | 'valueOfField'>()\n\n // only number fields can use 'valueOfField`\n useEffect(() => {\n if (path) {\n const parentPath = path.split('.').slice(0, -1).join('.')\n const paymentFieldData: any = getDataByPath(parentPath)\n\n if (paymentFieldData) {\n const { fieldToUse, valueType } = paymentFieldData\n\n setValueType(valueType)\n\n const { fields: allFields }: Data = getData()\n const field = allFields.find((field: FieldWithID) => field.name === fieldToUse)\n\n if (field) {\n const { blockType } = field\n setIsNumberField(blockType === 'number')\n }\n }\n }\n }, [fields, path, getDataByPath, getData])\n\n // TODO: make this a number field, block by Payload\n if (valueType === 'static') {\n return <TextField {...props} />\n }\n\n const localeCode = typeof locale === 'object' && 'code' in locale ? locale.code : locale\n\n const localLabels = typeof label === 'object' ? label : { [localeCode]: label }\n\n const labelValue = localLabels[localeCode] || localLabels['en'] || ''\n\n if (valueType === 'valueOfField' && !isNumberField) {\n return (\n <div>\n <div>{String(labelValue)}</div>\n <div\n style={{\n color: '#9A9A9A',\n }}\n >\n The selected field must be a number field.\n </div>\n </div>\n )\n }\n\n return null\n}\n"],"names":["TextField","useLocale","useWatchForm","React","useEffect","useState","DynamicPriceSelector","props","label","path","fields","getData","getDataByPath","locale","isNumberField","setIsNumberField","valueType","setValueType","parentPath","split","slice","join","paymentFieldData","fieldToUse","allFields","field","find","name","blockType","localeCode","code","localLabels","labelValue","div","String","style","color"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAKA,SAASA,SAAS,EAAEC,SAAS,EAAEC,YAAY,QAAQ,iBAAgB;AACnE,OAAOC,SAASC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAOlD,OAAO,MAAMC,uBAAiD,CAAC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;AACT,EAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Block } from 'payload';
|
|
2
2
|
import type { FieldConfig } from '../../types.js';
|
|
3
3
|
export declare const fields: {
|
|
4
|
-
[key: string]:
|
|
4
|
+
[key: string]: ((fieldConfig?: FieldConfig | boolean) => Block) | Block;
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=fields.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../../src/collections/Forms/fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAS,MAAM,SAAS,CAAA;AAE3C,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,gBAAgB,CAAA;AA6jBrE,eAAO,MAAM,MAAM;
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../../src/collections/Forms/fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAS,MAAM,SAAS,CAAA;AAE3C,OAAO,KAAK,EAAE,WAAW,EAAsB,MAAM,gBAAgB,CAAA;AA6jBrE,eAAO,MAAM,MAAM,EAWd;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,KAAK,KAAK,CAAC,GAAG,KAAK,CAAA;CACxE,CAAA"}
|
|
@@ -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,"file":"replaceDoubleCurlys.d.ts","sourceRoot":"","sources":["../../src/utilities/replaceDoubleCurlys.ts"],"names":[],"mappings":"AAAA,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,
|
|
1
|
+
{"version":3,"file":"replaceDoubleCurlys.d.ts","sourceRoot":"","sources":["../../src/utilities/replaceDoubleCurlys.ts"],"names":[],"mappings":"AAAA,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,MAU7E,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/plugin-form-builder",
|
|
3
|
-
"version": "3.0.0-canary.
|
|
3
|
+
"version": "3.0.0-canary.ee0375f",
|
|
4
4
|
"description": "Form builder plugin for Payload CMS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"payload",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"exports": {
|
|
25
25
|
".": {
|
|
26
26
|
"import": "./dist/index.js",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"default": "./dist/index.js"
|
|
29
29
|
},
|
|
30
|
-
"
|
|
31
|
-
"import": "./dist/exports
|
|
32
|
-
"
|
|
33
|
-
"
|
|
30
|
+
"./types": {
|
|
31
|
+
"import": "./dist/exports/types.js",
|
|
32
|
+
"types": "./dist/exports/types.d.ts",
|
|
33
|
+
"default": "./dist/exports/types.js"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"main": "./dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"deepmerge": "^4.2.2",
|
|
43
43
|
"escape-html": "^1.0.3",
|
|
44
|
-
"@payloadcms/ui": "3.0.0-canary.
|
|
44
|
+
"@payloadcms/ui": "3.0.0-canary.ee0375f"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/escape-html": "^1.0.4",
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
"cross-env": "^7.0.3",
|
|
53
53
|
"nodemon": "3.0.3",
|
|
54
54
|
"ts-node": "10.9.1",
|
|
55
|
-
"
|
|
56
|
-
"
|
|
55
|
+
"payload": "3.0.0-canary.ee0375f",
|
|
56
|
+
"@payloadcms/eslint-config": "1.1.1"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"react": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522",
|
|
60
60
|
"react-dom": "^19.0.0 || ^19.0.0-rc-f994737d14-20240522",
|
|
61
|
-
"payload": "3.0.0-canary.
|
|
61
|
+
"payload": "3.0.0-canary.ee0375f"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"registry": "https://registry.npmjs.org/"
|