@payloadcms/ui 3.55.0-internal.b47bfce → 3.55.0-internal.f8c92b5

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.
Files changed (26) hide show
  1. package/dist/elements/DocumentFields/index.scss +1 -1
  2. package/dist/elements/PublishButton/index.d.ts.map +1 -1
  3. package/dist/elements/PublishButton/index.js +11 -22
  4. package/dist/elements/PublishButton/index.js.map +1 -1
  5. package/dist/exports/client/index.d.ts +0 -1
  6. package/dist/exports/client/index.d.ts.map +1 -1
  7. package/dist/exports/client/index.js +12 -12
  8. package/dist/exports/client/index.js.map +4 -4
  9. package/dist/exports/rsc/index.d.ts +0 -1
  10. package/dist/exports/rsc/index.d.ts.map +1 -1
  11. package/dist/exports/rsc/index.js +0 -1
  12. package/dist/exports/rsc/index.js.map +1 -1
  13. package/dist/providers/ServerFunctions/index.d.ts +0 -3
  14. package/dist/providers/ServerFunctions/index.d.ts.map +1 -1
  15. package/dist/providers/ServerFunctions/index.js +0 -13
  16. package/dist/providers/ServerFunctions/index.js.map +1 -1
  17. package/dist/styles.css +1 -1
  18. package/package.json +5 -5
  19. package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.d.ts +0 -30
  20. package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.d.ts.map +0 -1
  21. package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js +0 -82
  22. package/dist/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.js.map +0 -1
  23. package/dist/utilities/traverseForLocalizedFields.d.ts +0 -3
  24. package/dist/utilities/traverseForLocalizedFields.d.ts.map +0 -1
  25. package/dist/utilities/traverseForLocalizedFields.js +0 -40
  26. package/dist/utilities/traverseForLocalizedFields.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/ui",
3
- "version": "3.55.0-internal.b47bfce",
3
+ "version": "3.55.0-internal.f8c92b5",
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.55.0-internal.b47bfce"
139
+ "@payloadcms/translations": "3.55.0-internal.f8c92b5"
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
- "@payloadcms/eslint-config": "3.28.0",
155
- "payload": "3.55.0-internal.b47bfce"
154
+ "payload": "3.55.0-internal.f8c92b5",
155
+ "@payloadcms/eslint-config": "3.28.0"
156
156
  },
157
157
  "peerDependencies": {
158
158
  "next": "^15.2.3",
159
159
  "react": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
160
160
  "react-dom": "^19.0.0 || ^19.0.0-rc-65a56d0e-20241020",
161
- "payload": "3.55.0-internal.b47bfce"
161
+ "payload": "3.55.0-internal.f8c92b5"
162
162
  },
163
163
  "engines": {
164
164
  "node": "^18.20.2 || >=20.9.0"
@@ -1,30 +0,0 @@
1
- import { type Field, type FieldState, type ServerFunction } from 'payload';
2
- export type RenderFieldServerFnArgs = {
3
- /**
4
- * Override field config pulled from schemaPath lookup
5
- */
6
- field?: Partial<Field>;
7
- /**
8
- * Pass the value this field will receive when rendering it on the server.
9
- * For richText, this helps provide initial state for sub-fields that are immediately rendered (like blocks)
10
- * so that we can avoid multiple waterfall requests for each block that renders on the client.
11
- */
12
- initialValue?: unknown;
13
- /**
14
- * Path to the field to render
15
- * @default field name
16
- */
17
- path?: string;
18
- /**
19
- * chema path to the field to render. {global|collection}.entitySlug.fieldSchemaPath
20
- *
21
- * @example collection.posts.richText
22
- */
23
- schemaPath: string;
24
- };
25
- export type RenderFieldServerFnReturnType = {} & FieldState['customComponents'];
26
- /**
27
- * @experimental - may break in minor releases
28
- */
29
- export declare const _internal_renderFieldHandler: ServerFunction<RenderFieldServerFnArgs, Promise<RenderFieldServerFnReturnType>>;
30
- //# sourceMappingURL=renderFieldServerFn.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderFieldServerFn.d.ts","sourceRoot":"","sources":["../../../../src/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAA;AAO1E,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;IACtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AACD,MAAM,MAAM,6BAA6B,GAAG,EAAE,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAA;AAE/E;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,cAAc,CACvD,uBAAuB,EACvB,OAAO,CAAC,6BAA6B,CAAC,CA8EvC,CAAA"}
@@ -1,82 +0,0 @@
1
- import { getClientConfig } from '../../../utilities/getClientConfig.js';
2
- import { getClientSchemaMap } from '../../../utilities/getClientSchemaMap.js';
3
- import { getSchemaMap } from '../../../utilities/getSchemaMap.js';
4
- import { renderField } from '../renderField.js';
5
- /**
6
- * @experimental - may break in minor releases
7
- */
8
- export const _internal_renderFieldHandler = async ({
9
- field: fieldArg,
10
- initialValue,
11
- path,
12
- req,
13
- schemaPath
14
- }) => {
15
- if (!req.user) {
16
- throw new Error('Unauthorized');
17
- }
18
- const [entityType, entitySlug, ...fieldPath] = schemaPath.split('.');
19
- const schemaMap = getSchemaMap({
20
- collectionSlug: entityType === 'collection' ? entitySlug : undefined,
21
- config: req.payload.config,
22
- globalSlug: entityType === 'global' ? entitySlug : undefined,
23
- i18n: req.i18n
24
- });
25
- // Provide client schema map as it would have been provided if the target editor field would have been rendered.
26
- // For lexical, only then will it contain all the lexical-internal entries
27
- const clientSchemaMap = getClientSchemaMap({
28
- collectionSlug: entityType === 'collection' ? entitySlug : undefined,
29
- config: getClientConfig({
30
- config: req.payload.config,
31
- i18n: req.i18n,
32
- importMap: req.payload.importMap
33
- }),
34
- globalSlug: entityType === 'global' ? entitySlug : undefined,
35
- i18n: req.i18n,
36
- payload: req.payload,
37
- schemaMap
38
- });
39
- const targetField = schemaMap.get(`${entitySlug}.${fieldPath.join('.')}`);
40
- if (!targetField) {
41
- throw new Error(`Could not find target field at schemaPath: ${schemaPath}`);
42
- }
43
- const field = {
44
- ...(targetField || {}),
45
- ...(fieldArg || {})
46
- };
47
- let data = {};
48
- if (typeof initialValue !== 'undefined') {
49
- if ('name' in field) {
50
- data[field.name] = initialValue;
51
- } else {
52
- data = initialValue;
53
- }
54
- }
55
- const fieldState = {};
56
- renderField({
57
- clientFieldSchemaMap: clientSchemaMap,
58
- collectionSlug: entityType === 'collection' && entitySlug ? entitySlug : '-',
59
- data,
60
- fieldConfig: field,
61
- fieldSchemaMap: schemaMap,
62
- fieldState,
63
- formState: {},
64
- indexPath: '',
65
- lastRenderedPath: '',
66
- operation: 'create',
67
- parentPath: '',
68
- parentSchemaPath: '',
69
- path: path ?? ('name' in field ? field.name : ''),
70
- permissions: true,
71
- preferences: {
72
- fields: {}
73
- },
74
- previousFieldState: undefined,
75
- renderAllFields: true,
76
- req,
77
- schemaPath: `${entitySlug}.${fieldPath.join('.')}`,
78
- siblingData: data
79
- });
80
- return fieldState.customComponents ?? {};
81
- };
82
- //# sourceMappingURL=renderFieldServerFn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderFieldServerFn.js","names":["getClientConfig","getClientSchemaMap","getSchemaMap","renderField","_internal_renderFieldHandler","field","fieldArg","initialValue","path","req","schemaPath","user","Error","entityType","entitySlug","fieldPath","split","schemaMap","collectionSlug","undefined","config","payload","globalSlug","i18n","clientSchemaMap","importMap","targetField","get","join","data","name","fieldState","clientFieldSchemaMap","fieldConfig","fieldSchemaMap","formState","indexPath","lastRenderedPath","operation","parentPath","parentSchemaPath","permissions","preferences","fields","previousFieldState","renderAllFields","siblingData","customComponents"],"sources":["../../../../src/forms/fieldSchemasToFormState/serverFunctions/renderFieldServerFn.ts"],"sourcesContent":["import { type Field, type FieldState, type ServerFunction } from 'payload'\n\nimport { getClientConfig } from '../../../utilities/getClientConfig.js'\nimport { getClientSchemaMap } from '../../../utilities/getClientSchemaMap.js'\nimport { getSchemaMap } from '../../../utilities/getSchemaMap.js'\nimport { renderField } from '../renderField.js'\n\nexport type RenderFieldServerFnArgs = {\n /**\n * Override field config pulled from schemaPath lookup\n */\n field?: Partial<Field>\n /**\n * Pass the value this field will receive when rendering it on the server.\n * For richText, this helps provide initial state for sub-fields that are immediately rendered (like blocks)\n * so that we can avoid multiple waterfall requests for each block that renders on the client.\n */\n initialValue?: unknown\n /**\n * Path to the field to render\n * @default field name\n */\n path?: string\n /**\n * chema path to the field to render. {global|collection}.entitySlug.fieldSchemaPath\n *\n * @example collection.posts.richText\n */\n schemaPath: string\n}\nexport type RenderFieldServerFnReturnType = {} & FieldState['customComponents']\n\n/**\n * @experimental - may break in minor releases\n */\nexport const _internal_renderFieldHandler: ServerFunction<\n RenderFieldServerFnArgs,\n Promise<RenderFieldServerFnReturnType>\n // eslint-disable-next-line @typescript-eslint/require-await\n> = async ({ field: fieldArg, initialValue, path, req, schemaPath }) => {\n if (!req.user) {\n throw new Error('Unauthorized')\n }\n\n const [entityType, entitySlug, ...fieldPath] = schemaPath.split('.')\n\n const schemaMap = getSchemaMap({\n collectionSlug: entityType === 'collection' ? entitySlug : undefined,\n config: req.payload.config,\n globalSlug: entityType === 'global' ? entitySlug : undefined,\n i18n: req.i18n,\n })\n\n // Provide client schema map as it would have been provided if the target editor field would have been rendered.\n // For lexical, only then will it contain all the lexical-internal entries\n const clientSchemaMap = getClientSchemaMap({\n collectionSlug: entityType === 'collection' ? entitySlug : undefined,\n config: getClientConfig({\n config: req.payload.config,\n i18n: req.i18n,\n importMap: req.payload.importMap,\n }),\n globalSlug: entityType === 'global' ? entitySlug : undefined,\n i18n: req.i18n,\n payload: req.payload,\n schemaMap,\n })\n\n const targetField = schemaMap.get(`${entitySlug}.${fieldPath.join('.')}`) as Field | undefined\n\n if (!targetField) {\n throw new Error(`Could not find target field at schemaPath: ${schemaPath}`)\n }\n\n const field: Field = {\n ...(targetField || {}),\n ...(fieldArg || {}),\n } as Field\n\n let data = {}\n if (typeof initialValue !== 'undefined') {\n if ('name' in field) {\n data[field.name] = initialValue\n } else {\n data = initialValue\n }\n }\n\n const fieldState: FieldState = {}\n renderField({\n clientFieldSchemaMap: clientSchemaMap,\n collectionSlug: entityType === 'collection' && entitySlug ? entitySlug : '-',\n data,\n fieldConfig: field,\n fieldSchemaMap: schemaMap,\n fieldState, // TODO,\n formState: {}, // TODO,\n indexPath: '',\n lastRenderedPath: '',\n operation: 'create',\n parentPath: '',\n parentSchemaPath: '',\n path: path ?? ('name' in field ? field.name : ''),\n permissions: true,\n preferences: {\n fields: {},\n },\n previousFieldState: undefined,\n renderAllFields: true,\n req,\n schemaPath: `${entitySlug}.${fieldPath.join('.')}`,\n siblingData: data,\n })\n\n return fieldState.customComponents ?? {}\n}\n"],"mappings":"AAEA,SAASA,eAAe,QAAQ;AAChC,SAASC,kBAAkB,QAAQ;AACnC,SAASC,YAAY,QAAQ;AAC7B,SAASC,WAAW,QAAQ;AA2B5B;;;AAGA,OAAO,MAAMC,4BAAA,GAIT,MAAAA,CAAO;EAAEC,KAAA,EAAOC,QAAQ;EAAEC,YAAY;EAAEC,IAAI;EAAEC,GAAG;EAAEC;AAAU,CAAE;EACjE,IAAI,CAACD,GAAA,CAAIE,IAAI,EAAE;IACb,MAAM,IAAIC,KAAA,C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AAA,CAAMyB,IAAI,CAAC,GAAGvB,YAAA;IACrB,OAAO;MACLsB,IAAA,GAAOtB,YAAA;IACT;EACF;EAEA,MAAMwB,UAAA,GAAyB,CAAC;EAChC5B,WAAA,CAAY;IACV6B,oBAAA,EAAsBR,eAAA;IACtBN,cAAA,EAAgBL,UAAA,KAAe,gBAAgBC,UAAA,GAAaA,UAAA,GAAa;IACzEe,IAAA;IACAI,WAAA,EAAa5B,KAAA;IACb6B,cAAA,EAAgBjB,SAAA;IAChBc,UAAA;IACAI,SAAA,EAAW,CAAC;IACZC,SAAA,EAAW;IACXC,gBAAA,EAAkB;IAClBC,SAAA,EAAW;IACXC,UAAA,EAAY;IACZC,gBAAA,EAAkB;IAClBhC,IAAA,EAAMA,IAAA,KAAS,UAAUH,KAAA,GAAQA,KAAA,CAAMyB,IAAI,GAAG,EAAC;IAC/CW,WAAA,EAAa;IACbC,WAAA,EAAa;MACXC,MAAA,EAAQ,CAAC;IACX;IACAC,kBAAA,EAAoBzB,SAAA;IACpB0B,eAAA,EAAiB;IACjBpC,GAAA;IACAC,UAAA,EAAY,GAAGI,UAAA,IAAcC,SAAA,CAAUa,IAAI,CAAC,MAAM;IAClDkB,WAAA,EAAajB;EACf;EAEA,OAAOE,UAAA,CAAWgB,gBAAgB,IAAI,CAAC;AACzC","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import type { ClientField } from 'payload';
2
- export declare const traverseForLocalizedFields: (fields: ClientField[]) => boolean;
3
- //# sourceMappingURL=traverseForLocalizedFields.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"traverseForLocalizedFields.d.ts","sourceRoot":"","sources":["../../src/utilities/traverseForLocalizedFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,eAAO,MAAM,0BAA0B,WAAY,WAAW,EAAE,KAAG,OA0ClE,CAAA"}
@@ -1,40 +0,0 @@
1
- export const traverseForLocalizedFields = fields => {
2
- for (const field of fields) {
3
- if ('localized' in field && field.localized) {
4
- return true;
5
- }
6
- switch (field.type) {
7
- case 'array':
8
- case 'collapsible':
9
- case 'group':
10
- case 'row':
11
- if (field.fields && traverseForLocalizedFields(field.fields)) {
12
- return true;
13
- }
14
- break;
15
- case 'blocks':
16
- if (field.blocks) {
17
- for (const block of field.blocks) {
18
- if (block.fields && traverseForLocalizedFields(block.fields)) {
19
- return true;
20
- }
21
- }
22
- }
23
- break;
24
- case 'tabs':
25
- if (field.tabs) {
26
- for (const tab of field.tabs) {
27
- if ('localized' in tab && tab.localized) {
28
- return true;
29
- }
30
- if ('fields' in tab && tab.fields && traverseForLocalizedFields(tab.fields)) {
31
- return true;
32
- }
33
- }
34
- }
35
- break;
36
- }
37
- }
38
- return false;
39
- };
40
- //# sourceMappingURL=traverseForLocalizedFields.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"traverseForLocalizedFields.js","names":["traverseForLocalizedFields","fields","field","localized","type","blocks","block","tabs","tab"],"sources":["../../src/utilities/traverseForLocalizedFields.ts"],"sourcesContent":["import type { ClientField } from 'payload'\n\nexport const traverseForLocalizedFields = (fields: ClientField[]): boolean => {\n for (const field of fields) {\n if ('localized' in field && field.localized) {\n return true\n }\n\n switch (field.type) {\n case 'array':\n case 'collapsible':\n case 'group':\n case 'row':\n if (field.fields && traverseForLocalizedFields(field.fields)) {\n return true\n }\n break\n\n case 'blocks':\n if (field.blocks) {\n for (const block of field.blocks) {\n if (block.fields && traverseForLocalizedFields(block.fields)) {\n return true\n }\n }\n }\n break\n\n case 'tabs':\n if (field.tabs) {\n for (const tab of field.tabs) {\n if ('localized' in tab && tab.localized) {\n return true\n }\n if ('fields' in tab && tab.fields && traverseForLocalizedFields(tab.fields)) {\n return true\n }\n }\n }\n break\n }\n }\n\n return false\n}\n"],"mappings":"AAEA,OAAO,MAAMA,0BAAA,GAA8BC,MAAA;EACzC,KAAK,MAAMC,KAAA,IAASD,MAAA,EAAQ;IAC1B,IAAI,eAAeC,KAAA,IAASA,KAAA,CAAMC,SAAS,EAAE;MAC3C,OAAO;IACT;IAEA,QAAQD,KAAA,CAAME,IAAI;MAChB,KAAK;MACL,KAAK;MACL,KAAK;MACL,KAAK;QACH,IAAIF,KAAA,CAAMD,MAAM,IAAID,0BAAA,CAA2BE,KAAA,CAAMD,MAAM,GAAG;UAC5D,OAAO;QACT;QACA;MAEF,KAAK;QACH,IAAIC,KAAA,CAAMG,MAAM,EAAE;UAChB,KAAK,MAAMC,KAAA,IAASJ,KAAA,CAAMG,MAAM,EAAE;YAChC,IAAIC,KAAA,CAAML,MAAM,IAAID,0BAAA,CAA2BM,KAAA,CAAML,MAAM,GAAG;cAC5D,OAAO;YACT;UACF;QACF;QACA;MAEF,KAAK;QACH,IAAIC,KAAA,CAAMK,IAAI,EAAE;UACd,KAAK,MAAMC,GAAA,IAAON,KAAA,CAAMK,IAAI,EAAE;YAC5B,IAAI,eAAeC,GAAA,IAAOA,GAAA,CAAIL,SAAS,EAAE;cACvC,OAAO;YACT;YACA,IAAI,YAAYK,GAAA,IAAOA,GAAA,CAAIP,MAAM,IAAID,0BAAA,CAA2BQ,GAAA,CAAIP,MAAM,GAAG;cAC3E,OAAO;YACT;UACF;QACF;QACA;IACJ;EACF;EAEA,OAAO;AACT","ignoreList":[]}