@payloadcms/ui 3.71.0-internal-debug.80dab4c → 3.71.0-internal-debug.dea9d74
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/fields/Tabs/index.d.ts.map +1 -1
- package/dist/fields/Tabs/index.js +34 -66
- package/dist/fields/Tabs/index.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts +2 -2
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +125 -99
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/iterateFields.d.ts +2 -2
- package/dist/forms/fieldSchemasToFormState/iterateFields.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/iterateFields.js +1 -1
- package/dist/forms/fieldSchemasToFormState/iterateFields.js.map +1 -1
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.d.ts +2 -2
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.d.ts.map +1 -1
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.js +40 -33
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.js.map +1 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts +2 -2
- package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts.map +1 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js +40 -35
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js.map +1 -1
- package/package.json +4 -4
|
@@ -5,8 +5,7 @@ export const traverseFields = ({ config, fields, i18n, parentIndexPath, parentSc
|
|
|
5
5
|
const { indexPath, schemaPath } = getFieldPaths({
|
|
6
6
|
field,
|
|
7
7
|
index,
|
|
8
|
-
parentIndexPath
|
|
9
|
-
parentPath: '',
|
|
8
|
+
parentIndexPath,
|
|
10
9
|
parentSchemaPath
|
|
11
10
|
});
|
|
12
11
|
schemaMap.set(schemaPath, field);
|
|
@@ -33,7 +32,7 @@ export const traverseFields = ({ config, fields, i18n, parentIndexPath, parentSc
|
|
|
33
32
|
fields: block.fields,
|
|
34
33
|
i18n,
|
|
35
34
|
parentIndexPath: '',
|
|
36
|
-
parentSchemaPath:
|
|
35
|
+
parentSchemaPath: schemaPath + '.' + block.slug,
|
|
37
36
|
schemaMap
|
|
38
37
|
});
|
|
39
38
|
});
|
|
@@ -45,7 +44,7 @@ export const traverseFields = ({ config, fields, i18n, parentIndexPath, parentSc
|
|
|
45
44
|
fields: field.fields,
|
|
46
45
|
i18n,
|
|
47
46
|
parentIndexPath: indexPath,
|
|
48
|
-
parentSchemaPath,
|
|
47
|
+
parentSchemaPath: schemaPath,
|
|
49
48
|
schemaMap
|
|
50
49
|
});
|
|
51
50
|
break;
|
|
@@ -65,53 +64,59 @@ export const traverseFields = ({ config, fields, i18n, parentIndexPath, parentSc
|
|
|
65
64
|
fields: field.fields,
|
|
66
65
|
i18n,
|
|
67
66
|
parentIndexPath: indexPath,
|
|
68
|
-
parentSchemaPath,
|
|
67
|
+
parentSchemaPath: schemaPath,
|
|
69
68
|
schemaMap
|
|
70
69
|
});
|
|
71
70
|
}
|
|
72
71
|
break;
|
|
73
72
|
case 'richText':
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
{
|
|
74
|
+
if (!field?.editor) {
|
|
75
|
+
throw new MissingEditorProp(field);
|
|
76
|
+
}
|
|
77
|
+
// while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor
|
|
78
|
+
if (typeof field.editor === 'function') {
|
|
79
|
+
throw new Error('Attempted to access unsanitized rich text editor.');
|
|
80
|
+
}
|
|
81
|
+
if (typeof field.editor.generateSchemaMap === 'function') {
|
|
82
|
+
field.editor.generateSchemaMap({
|
|
83
|
+
config,
|
|
84
|
+
field,
|
|
85
|
+
i18n,
|
|
86
|
+
schemaMap,
|
|
87
|
+
schemaPath
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
76
91
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (typeof field.editor.generateSchemaMap === 'function') {
|
|
82
|
-
field.editor.generateSchemaMap({
|
|
92
|
+
case 'tab':
|
|
93
|
+
{
|
|
94
|
+
const isNamedTab = tabHasName(field);
|
|
95
|
+
traverseFields({
|
|
83
96
|
config,
|
|
84
|
-
field,
|
|
97
|
+
fields: field.fields,
|
|
85
98
|
i18n,
|
|
86
|
-
|
|
87
|
-
schemaPath
|
|
99
|
+
parentIndexPath: isNamedTab ? '' : indexPath,
|
|
100
|
+
parentSchemaPath: schemaPath,
|
|
101
|
+
schemaMap
|
|
88
102
|
});
|
|
103
|
+
break;
|
|
89
104
|
}
|
|
90
|
-
break;
|
|
91
105
|
case 'tabs':
|
|
92
|
-
|
|
93
|
-
const isNamedTab = tabHasName(tab);
|
|
94
|
-
const { indexPath: tabIndexPath, schemaPath: tabSchemaPath } = getFieldPaths({
|
|
95
|
-
field: {
|
|
96
|
-
...tab,
|
|
97
|
-
type: 'tab'
|
|
98
|
-
},
|
|
99
|
-
index: tabIndex,
|
|
100
|
-
parentIndexPath: indexPath,
|
|
101
|
-
parentPath: '',
|
|
102
|
-
parentSchemaPath
|
|
103
|
-
});
|
|
104
|
-
schemaMap.set(tabSchemaPath, tab);
|
|
106
|
+
{
|
|
105
107
|
traverseFields({
|
|
106
108
|
config,
|
|
107
|
-
fields: tab
|
|
109
|
+
fields: field.tabs.map((tab)=>({
|
|
110
|
+
...tab,
|
|
111
|
+
type: 'tab'
|
|
112
|
+
})),
|
|
108
113
|
i18n,
|
|
109
|
-
parentIndexPath:
|
|
110
|
-
parentSchemaPath:
|
|
114
|
+
parentIndexPath: indexPath,
|
|
115
|
+
parentSchemaPath: schemaPath,
|
|
111
116
|
schemaMap
|
|
112
117
|
});
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
115
120
|
}
|
|
116
121
|
}
|
|
117
122
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utilities/buildFieldSchemaMap/traverseFields.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { Field, FieldSchemaMap, SanitizedConfig } from 'payload'\n\nimport { MissingEditorProp } from 'payload'\nimport { fieldAffectsData, getFieldPaths, tabHasName } from 'payload/shared'\n\ntype Args = {\n config: SanitizedConfig\n fields: Field[]\n i18n: I18n<any, any>\n parentIndexPath: string\n parentSchemaPath: string\n schemaMap: FieldSchemaMap\n}\n\nexport const traverseFields = ({\n config,\n fields,\n i18n,\n parentIndexPath,\n parentSchemaPath,\n schemaMap,\n}: Args) => {\n for (const [index, field] of fields.entries()) {\n const { indexPath, schemaPath } = getFieldPaths({\n field,\n index,\n parentIndexPath
|
|
1
|
+
{"version":3,"sources":["../../../src/utilities/buildFieldSchemaMap/traverseFields.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { Field, FieldSchemaMap, SanitizedConfig, TabAsField } from 'payload'\n\nimport { MissingEditorProp } from 'payload'\nimport { fieldAffectsData, getFieldPaths, tabHasName } from 'payload/shared'\n\ntype Args = {\n config: SanitizedConfig\n fields: (Field | TabAsField)[]\n i18n: I18n<any, any>\n parentIndexPath: string\n parentSchemaPath: string\n schemaMap: FieldSchemaMap\n}\n\nexport const traverseFields = ({\n config,\n fields,\n i18n,\n parentIndexPath,\n parentSchemaPath,\n schemaMap,\n}: Args) => {\n for (const [index, field] of fields.entries()) {\n const { indexPath, schemaPath } = getFieldPaths({\n field,\n index,\n parentIndexPath,\n parentSchemaPath,\n })\n\n schemaMap.set(schemaPath, field)\n\n switch (field.type) {\n case 'array':\n traverseFields({\n config,\n fields: field.fields,\n i18n,\n parentIndexPath: '',\n parentSchemaPath: schemaPath,\n schemaMap,\n })\n\n break\n\n case 'blocks':\n ;(field.blockReferences ?? field.blocks).map((_block) => {\n // TODO: iterate over blocks mapped to block slug in v4, or pass through payload.blocks\n const block =\n typeof _block === 'string' ? config.blocks.find((b) => b.slug === _block) : _block\n\n const blockSchemaPath = `${schemaPath}.${block.slug}`\n\n schemaMap.set(blockSchemaPath, block)\n traverseFields({\n config,\n fields: block.fields,\n i18n,\n parentIndexPath: '',\n parentSchemaPath: schemaPath + '.' + block.slug,\n schemaMap,\n })\n })\n\n break\n\n case 'collapsible':\n case 'row':\n traverseFields({\n config,\n fields: field.fields,\n i18n,\n parentIndexPath: indexPath,\n parentSchemaPath: schemaPath,\n schemaMap,\n })\n\n break\n\n case 'group':\n if (fieldAffectsData(field)) {\n traverseFields({\n config,\n fields: field.fields,\n i18n,\n parentIndexPath: '',\n parentSchemaPath: schemaPath,\n schemaMap,\n })\n } else {\n traverseFields({\n config,\n fields: field.fields,\n i18n,\n parentIndexPath: indexPath,\n parentSchemaPath: schemaPath,\n schemaMap,\n })\n }\n\n break\n\n case 'richText': {\n if (!field?.editor) {\n throw new MissingEditorProp(field) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor\n }\n\n if (typeof field.editor === 'function') {\n throw new Error('Attempted to access unsanitized rich text editor.')\n }\n\n if (typeof field.editor.generateSchemaMap === 'function') {\n field.editor.generateSchemaMap({\n config,\n field,\n i18n,\n schemaMap,\n schemaPath,\n })\n }\n\n break\n }\n\n case 'tab': {\n const isNamedTab = tabHasName(field)\n\n traverseFields({\n config,\n fields: field.fields,\n i18n,\n parentIndexPath: isNamedTab ? '' : indexPath,\n parentSchemaPath: schemaPath,\n schemaMap,\n })\n\n break\n }\n\n case 'tabs': {\n traverseFields({\n config,\n fields: field.tabs.map((tab) => ({ ...tab, type: 'tab' })),\n i18n,\n parentIndexPath: indexPath,\n parentSchemaPath: schemaPath,\n schemaMap,\n })\n\n break\n }\n }\n }\n}\n"],"names":["MissingEditorProp","fieldAffectsData","getFieldPaths","tabHasName","traverseFields","config","fields","i18n","parentIndexPath","parentSchemaPath","schemaMap","index","field","entries","indexPath","schemaPath","set","type","blockReferences","blocks","map","_block","block","find","b","slug","blockSchemaPath","editor","Error","generateSchemaMap","isNamedTab","tabs","tab"],"mappings":"AAGA,SAASA,iBAAiB,QAAQ,UAAS;AAC3C,SAASC,gBAAgB,EAAEC,aAAa,EAAEC,UAAU,QAAQ,iBAAgB;AAW5E,OAAO,MAAMC,iBAAiB,CAAC,EAC7BC,MAAM,EACNC,MAAM,EACNC,IAAI,EACJC,eAAe,EACfC,gBAAgB,EAChBC,SAAS,EACJ;IACL,KAAK,MAAM,CAACC,OAAOC,MAAM,IAAIN,OAAOO,OAAO,GAAI;QAC7C,MAAM,EAAEC,SAAS,EAAEC,UAAU,EAAE,GAAGb,cAAc;YAC9CU;YACAD;YACAH;YACAC;QACF;QAEAC,UAAUM,GAAG,CAACD,YAAYH;QAE1B,OAAQA,MAAMK,IAAI;YAChB,KAAK;gBACHb,eAAe;oBACbC;oBACAC,QAAQM,MAAMN,MAAM;oBACpBC;oBACAC,iBAAiB;oBACjBC,kBAAkBM;oBAClBL;gBACF;gBAEA;YAEF,KAAK;;gBACDE,CAAAA,MAAMM,eAAe,IAAIN,MAAMO,MAAM,AAAD,EAAGC,GAAG,CAAC,CAACC;oBAC5C,uFAAuF;oBACvF,MAAMC,QACJ,OAAOD,WAAW,WAAWhB,OAAOc,MAAM,CAACI,IAAI,CAAC,CAACC,IAAMA,EAAEC,IAAI,KAAKJ,UAAUA;oBAE9E,MAAMK,kBAAkB,GAAGX,WAAW,CAAC,EAAEO,MAAMG,IAAI,EAAE;oBAErDf,UAAUM,GAAG,CAACU,iBAAiBJ;oBAC/BlB,eAAe;wBACbC;wBACAC,QAAQgB,MAAMhB,MAAM;wBACpBC;wBACAC,iBAAiB;wBACjBC,kBAAkBM,aAAa,MAAMO,MAAMG,IAAI;wBAC/Cf;oBACF;gBACF;gBAEA;YAEF,KAAK;YACL,KAAK;gBACHN,eAAe;oBACbC;oBACAC,QAAQM,MAAMN,MAAM;oBACpBC;oBACAC,iBAAiBM;oBACjBL,kBAAkBM;oBAClBL;gBACF;gBAEA;YAEF,KAAK;gBACH,IAAIT,iBAAiBW,QAAQ;oBAC3BR,eAAe;wBACbC;wBACAC,QAAQM,MAAMN,MAAM;wBACpBC;wBACAC,iBAAiB;wBACjBC,kBAAkBM;wBAClBL;oBACF;gBACF,OAAO;oBACLN,eAAe;wBACbC;wBACAC,QAAQM,MAAMN,MAAM;wBACpBC;wBACAC,iBAAiBM;wBACjBL,kBAAkBM;wBAClBL;oBACF;gBACF;gBAEA;YAEF,KAAK;gBAAY;oBACf,IAAI,CAACE,OAAOe,QAAQ;wBAClB,MAAM,IAAI3B,kBAAkBY;oBAC9B;oBADqC,8HAA8H;oBAGnK,IAAI,OAAOA,MAAMe,MAAM,KAAK,YAAY;wBACtC,MAAM,IAAIC,MAAM;oBAClB;oBAEA,IAAI,OAAOhB,MAAMe,MAAM,CAACE,iBAAiB,KAAK,YAAY;wBACxDjB,MAAMe,MAAM,CAACE,iBAAiB,CAAC;4BAC7BxB;4BACAO;4BACAL;4BACAG;4BACAK;wBACF;oBACF;oBAEA;gBACF;YAEA,KAAK;gBAAO;oBACV,MAAMe,aAAa3B,WAAWS;oBAE9BR,eAAe;wBACbC;wBACAC,QAAQM,MAAMN,MAAM;wBACpBC;wBACAC,iBAAiBsB,aAAa,KAAKhB;wBACnCL,kBAAkBM;wBAClBL;oBACF;oBAEA;gBACF;YAEA,KAAK;gBAAQ;oBACXN,eAAe;wBACbC;wBACAC,QAAQM,MAAMmB,IAAI,CAACX,GAAG,CAAC,CAACY,MAAS,CAAA;gCAAE,GAAGA,GAAG;gCAAEf,MAAM;4BAAM,CAAA;wBACvDV;wBACAC,iBAAiBM;wBACjBL,kBAAkBM;wBAClBL;oBACF;oBAEA;gBACF;QACF;IACF;AACF,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/ui",
|
|
3
|
-
"version": "3.71.0-internal-debug.
|
|
3
|
+
"version": "3.71.0-internal-debug.dea9d74",
|
|
4
4
|
"homepage": "https://payloadcms.com",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"ts-essentials": "10.0.3",
|
|
137
137
|
"use-context-selector": "2.0.0",
|
|
138
138
|
"uuid": "10.0.0",
|
|
139
|
-
"@payloadcms/translations": "3.71.0-internal-debug.
|
|
139
|
+
"@payloadcms/translations": "3.71.0-internal-debug.dea9d74"
|
|
140
140
|
},
|
|
141
141
|
"devDependencies": {
|
|
142
142
|
"@babel/cli": "7.27.2",
|
|
@@ -151,14 +151,14 @@
|
|
|
151
151
|
"babel-plugin-react-compiler": "19.1.0-rc.3",
|
|
152
152
|
"esbuild": "0.25.5",
|
|
153
153
|
"esbuild-sass-plugin": "3.3.1",
|
|
154
|
-
"payload": "3.71.0-internal-debug.
|
|
154
|
+
"payload": "3.71.0-internal-debug.dea9d74",
|
|
155
155
|
"@payloadcms/eslint-config": "3.28.0"
|
|
156
156
|
},
|
|
157
157
|
"peerDependencies": {
|
|
158
158
|
"next": "^15.2.8 || ^15.3.8 || ^15.4.10 || ^15.5.9",
|
|
159
159
|
"react": "^19.0.1 || ^19.1.2 || ^19.2.1",
|
|
160
160
|
"react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
|
|
161
|
-
"payload": "3.71.0-internal-debug.
|
|
161
|
+
"payload": "3.71.0-internal-debug.dea9d74"
|
|
162
162
|
},
|
|
163
163
|
"engines": {
|
|
164
164
|
"node": "^18.20.2 || >=20.9.0"
|