@payloadcms/ui 3.1.1-canary.9da0158 → 3.1.1
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/elements/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/elements/DatePicker/DatePicker.js +44 -27
- package/dist/elements/DatePicker/DatePicker.js.map +1 -1
- package/dist/elements/DatePicker/index.scss +1 -1
- package/dist/elements/ReactSelect/index.d.ts.map +1 -1
- package/dist/elements/ReactSelect/index.js +11 -0
- package/dist/elements/ReactSelect/index.js.map +1 -1
- package/dist/elements/ReactSelect/index.scss +0 -3
- package/dist/exports/client/{DatePicker-23XPGPYP.js → DatePicker-QST7QHAX.js} +2 -2
- package/dist/exports/client/{chunk-PELL3UMP.js → chunk-5LUHGAPX.js} +3 -3
- package/dist/exports/client/{chunk-PELL3UMP.js.map → chunk-5LUHGAPX.js.map} +3 -3
- package/dist/exports/client/index.js +9 -9
- package/dist/exports/client/index.js.map +3 -3
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts +1 -2
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +0 -10
- package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/index.d.ts +1 -7
- package/dist/forms/fieldSchemasToFormState/index.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/index.js +0 -5
- package/dist/forms/fieldSchemasToFormState/index.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/iterateFields.d.ts +2 -3
- package/dist/forms/fieldSchemasToFormState/iterateFields.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/iterateFields.js +0 -2
- package/dist/forms/fieldSchemasToFormState/iterateFields.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/renderField.js +3 -4
- package/dist/forms/fieldSchemasToFormState/renderField.js.map +1 -1
- package/dist/forms/fieldSchemasToFormState/types.d.ts +1 -2
- package/dist/forms/fieldSchemasToFormState/types.d.ts.map +1 -1
- package/dist/forms/fieldSchemasToFormState/types.js.map +1 -1
- package/dist/providers/ListQuery/index.d.ts.map +1 -1
- package/dist/providers/ListQuery/index.js +1 -1
- package/dist/providers/ListQuery/index.js.map +1 -1
- package/dist/providers/Locale/index.js +29 -30
- package/dist/providers/Locale/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utilities/buildFieldSchemaMap/index.d.ts.map +1 -1
- package/dist/utilities/buildFieldSchemaMap/index.js +14 -13
- package/dist/utilities/buildFieldSchemaMap/index.js.map +1 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts.map +1 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js.map +1 -1
- package/dist/utilities/buildFormState.d.ts +8 -1
- package/dist/utilities/buildFormState.d.ts.map +1 -1
- package/dist/utilities/buildFormState.js +41 -19
- package/dist/utilities/buildFormState.js.map +1 -1
- package/dist/utilities/buildTableState.d.ts +7 -1
- package/dist/utilities/buildTableState.d.ts.map +1 -1
- package/dist/utilities/buildTableState.js +26 -8
- package/dist/utilities/buildTableState.js.map +1 -1
- package/dist/views/Edit/Auth/types.d.ts +2 -2
- package/dist/views/Edit/Auth/types.d.ts.map +1 -1
- package/dist/views/Edit/Auth/types.js.map +1 -1
- package/package.json +5 -5
- package/dist/utilities/buildClientFieldSchemaMap/index.d.ts +0 -16
- package/dist/utilities/buildClientFieldSchemaMap/index.d.ts.map +0 -1
- package/dist/utilities/buildClientFieldSchemaMap/index.js +0 -70
- package/dist/utilities/buildClientFieldSchemaMap/index.js.map +0 -1
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.d.ts +0 -15
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.d.ts.map +0 -1
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.js +0 -129
- package/dist/utilities/buildClientFieldSchemaMap/traverseFields.js.map +0 -1
- package/dist/utilities/getClientConfig.d.ts +0 -8
- package/dist/utilities/getClientConfig.d.ts.map +0 -1
- package/dist/utilities/getClientConfig.js +0 -25
- package/dist/utilities/getClientConfig.js.map +0 -1
- package/dist/utilities/getClientSchemaMap.d.ts +0 -11
- package/dist/utilities/getClientSchemaMap.d.ts.map +0 -1
- package/dist/utilities/getClientSchemaMap.js +0 -39
- package/dist/utilities/getClientSchemaMap.js.map +0 -1
- package/dist/utilities/getSchemaMap.d.ts +0 -9
- package/dist/utilities/getSchemaMap.d.ts.map +0 -1
- package/dist/utilities/getSchemaMap.js +0 -35
- package/dist/utilities/getSchemaMap.js.map +0 -1
- /package/dist/exports/client/{DatePicker-23XPGPYP.js.map → DatePicker-QST7QHAX.js.map} +0 -0
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { createClientFields } from 'payload';
|
|
2
|
-
import { getFieldPaths, tabHasName } from 'payload/shared';
|
|
3
|
-
export const traverseFields = ({
|
|
4
|
-
clientSchemaMap,
|
|
5
|
-
config,
|
|
6
|
-
fields,
|
|
7
|
-
i18n,
|
|
8
|
-
parentIndexPath,
|
|
9
|
-
parentSchemaPath,
|
|
10
|
-
payload,
|
|
11
|
-
schemaMap
|
|
12
|
-
}) => {
|
|
13
|
-
for (const [index, field] of fields.entries()) {
|
|
14
|
-
const {
|
|
15
|
-
indexPath,
|
|
16
|
-
schemaPath
|
|
17
|
-
} = getFieldPaths({
|
|
18
|
-
field,
|
|
19
|
-
index,
|
|
20
|
-
parentIndexPath: 'name' in field ? '' : parentIndexPath,
|
|
21
|
-
parentPath: '',
|
|
22
|
-
parentSchemaPath
|
|
23
|
-
});
|
|
24
|
-
clientSchemaMap.set(schemaPath, field);
|
|
25
|
-
switch (field.type) {
|
|
26
|
-
case 'array':
|
|
27
|
-
case 'group':
|
|
28
|
-
traverseFields({
|
|
29
|
-
clientSchemaMap,
|
|
30
|
-
config,
|
|
31
|
-
fields: field.fields,
|
|
32
|
-
i18n,
|
|
33
|
-
parentIndexPath: '',
|
|
34
|
-
parentSchemaPath: schemaPath,
|
|
35
|
-
payload,
|
|
36
|
-
schemaMap
|
|
37
|
-
});
|
|
38
|
-
break;
|
|
39
|
-
case 'blocks':
|
|
40
|
-
field.blocks.map(block => {
|
|
41
|
-
const blockSchemaPath = `${schemaPath}.${block.slug}`;
|
|
42
|
-
clientSchemaMap.set(blockSchemaPath, block);
|
|
43
|
-
traverseFields({
|
|
44
|
-
clientSchemaMap,
|
|
45
|
-
config,
|
|
46
|
-
fields: block.fields,
|
|
47
|
-
i18n,
|
|
48
|
-
parentIndexPath: '',
|
|
49
|
-
parentSchemaPath: blockSchemaPath,
|
|
50
|
-
payload,
|
|
51
|
-
schemaMap
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
break;
|
|
55
|
-
case 'collapsible':
|
|
56
|
-
case 'row':
|
|
57
|
-
traverseFields({
|
|
58
|
-
clientSchemaMap,
|
|
59
|
-
config,
|
|
60
|
-
fields: field.fields,
|
|
61
|
-
i18n,
|
|
62
|
-
parentIndexPath: indexPath,
|
|
63
|
-
parentSchemaPath,
|
|
64
|
-
payload,
|
|
65
|
-
schemaMap
|
|
66
|
-
});
|
|
67
|
-
break;
|
|
68
|
-
case 'richText':
|
|
69
|
-
{
|
|
70
|
-
// richText sub-fields are not part of the ClientConfig or the Config.
|
|
71
|
-
// They only exist in the field schema map.
|
|
72
|
-
// Thus, we need to
|
|
73
|
-
// 1. get them from the field schema map
|
|
74
|
-
// 2. convert them to client fields
|
|
75
|
-
// 3. add them to the client schema map
|
|
76
|
-
// So these would basically be all fields that are not part of the client config already
|
|
77
|
-
const richTextFieldSchemaMap = new Map();
|
|
78
|
-
for (const [path, subField] of schemaMap.entries()) {
|
|
79
|
-
if (path.startsWith(`${schemaPath}.`)) {
|
|
80
|
-
richTextFieldSchemaMap.set(path, subField);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
// Now loop through them, convert each entry to a client field and add it to the client schema map
|
|
84
|
-
for (const [path, subField] of richTextFieldSchemaMap.entries()) {
|
|
85
|
-
const clientFields = createClientFields({
|
|
86
|
-
defaultIDType: payload.config.db.defaultIDType,
|
|
87
|
-
disableAddingID: true,
|
|
88
|
-
fields: 'fields' in subField ? subField.fields : [subField],
|
|
89
|
-
i18n,
|
|
90
|
-
importMap: payload.importMap
|
|
91
|
-
});
|
|
92
|
-
clientSchemaMap.set(path, {
|
|
93
|
-
fields: clientFields
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
case 'tabs':
|
|
99
|
-
field.tabs.map((tab, tabIndex) => {
|
|
100
|
-
const {
|
|
101
|
-
indexPath: tabIndexPath,
|
|
102
|
-
schemaPath: tabSchemaPath
|
|
103
|
-
} = getFieldPaths({
|
|
104
|
-
field: {
|
|
105
|
-
...tab,
|
|
106
|
-
type: 'tab'
|
|
107
|
-
},
|
|
108
|
-
index: tabIndex,
|
|
109
|
-
parentIndexPath: indexPath,
|
|
110
|
-
parentPath: '',
|
|
111
|
-
parentSchemaPath
|
|
112
|
-
});
|
|
113
|
-
clientSchemaMap.set(tabSchemaPath, tab);
|
|
114
|
-
traverseFields({
|
|
115
|
-
clientSchemaMap,
|
|
116
|
-
config,
|
|
117
|
-
fields: tab.fields,
|
|
118
|
-
i18n,
|
|
119
|
-
parentIndexPath: tabHasName(tab) ? '' : tabIndexPath,
|
|
120
|
-
parentSchemaPath: tabHasName(tab) ? tabSchemaPath : parentSchemaPath,
|
|
121
|
-
payload,
|
|
122
|
-
schemaMap
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
//# sourceMappingURL=traverseFields.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"traverseFields.js","names":["createClientFields","getFieldPaths","tabHasName","traverseFields","clientSchemaMap","config","fields","i18n","parentIndexPath","parentSchemaPath","payload","schemaMap","index","field","entries","indexPath","schemaPath","parentPath","set","type","blocks","map","block","blockSchemaPath","slug","richTextFieldSchemaMap","Map","path","subField","startsWith","clientFields","defaultIDType","db","disableAddingID","importMap","tabs","tab","tabIndex","tabIndexPath","tabSchemaPath"],"sources":["../../../src/utilities/buildClientFieldSchemaMap/traverseFields.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\n\nimport {\n type ClientConfig,\n type ClientField,\n type ClientFieldSchemaMap,\n createClientFields,\n type FieldSchemaMap,\n type Payload,\n} from 'payload'\nimport { getFieldPaths, tabHasName } from 'payload/shared'\n\ntype Args = {\n clientSchemaMap: ClientFieldSchemaMap\n config: ClientConfig\n fields: ClientField[]\n i18n: I18n<any, any>\n parentIndexPath: string\n parentSchemaPath: string\n payload: Payload\n schemaMap: FieldSchemaMap\n}\n\nexport const traverseFields = ({\n clientSchemaMap,\n config,\n fields,\n i18n,\n parentIndexPath,\n parentSchemaPath,\n payload,\n schemaMap,\n}: Args) => {\n for (const [index, field] of fields.entries()) {\n const { indexPath, schemaPath } = getFieldPaths({\n field,\n index,\n parentIndexPath: 'name' in field ? '' : parentIndexPath,\n parentPath: '',\n parentSchemaPath,\n })\n\n clientSchemaMap.set(schemaPath, field)\n\n switch (field.type) {\n case 'array':\n case 'group':\n traverseFields({\n clientSchemaMap,\n config,\n fields: field.fields,\n i18n,\n parentIndexPath: '',\n parentSchemaPath: schemaPath,\n payload,\n schemaMap,\n })\n\n break\n\n case 'blocks':\n field.blocks.map((block) => {\n const blockSchemaPath = `${schemaPath}.${block.slug}`\n\n clientSchemaMap.set(blockSchemaPath, block)\n traverseFields({\n clientSchemaMap,\n config,\n fields: block.fields,\n i18n,\n parentIndexPath: '',\n parentSchemaPath: blockSchemaPath,\n payload,\n schemaMap,\n })\n })\n\n break\n case 'collapsible':\n case 'row':\n traverseFields({\n clientSchemaMap,\n config,\n fields: field.fields,\n i18n,\n parentIndexPath: indexPath,\n parentSchemaPath,\n payload,\n schemaMap,\n })\n break\n\n case 'richText': {\n // richText sub-fields are not part of the ClientConfig or the Config.\n // They only exist in the field schema map.\n // Thus, we need to\n // 1. get them from the field schema map\n // 2. convert them to client fields\n // 3. add them to the client schema map\n\n // So these would basically be all fields that are not part of the client config already\n const richTextFieldSchemaMap: FieldSchemaMap = new Map()\n for (const [path, subField] of schemaMap.entries()) {\n if (path.startsWith(`${schemaPath}.`)) {\n richTextFieldSchemaMap.set(path, subField)\n }\n }\n\n // Now loop through them, convert each entry to a client field and add it to the client schema map\n for (const [path, subField] of richTextFieldSchemaMap.entries()) {\n const clientFields = createClientFields({\n defaultIDType: payload.config.db.defaultIDType,\n disableAddingID: true,\n fields: 'fields' in subField ? subField.fields : [subField],\n i18n,\n importMap: payload.importMap,\n })\n clientSchemaMap.set(path, {\n fields: clientFields,\n })\n }\n break\n }\n case 'tabs':\n field.tabs.map((tab, tabIndex) => {\n const { indexPath: tabIndexPath, schemaPath: tabSchemaPath } = getFieldPaths({\n field: {\n ...tab,\n type: 'tab',\n },\n index: tabIndex,\n parentIndexPath: indexPath,\n parentPath: '',\n parentSchemaPath,\n })\n\n clientSchemaMap.set(tabSchemaPath, tab)\n\n traverseFields({\n clientSchemaMap,\n config,\n fields: tab.fields,\n i18n,\n parentIndexPath: tabHasName(tab) ? '' : tabIndexPath,\n parentSchemaPath: tabHasName(tab) ? tabSchemaPath : parentSchemaPath,\n payload,\n schemaMap,\n })\n })\n\n break\n }\n }\n}\n"],"mappings":"AAEA,SAIEA,kBAAkB,QAGb;AACP,SAASC,aAAa,EAAEC,UAAU,QAAQ;AAa1C,OAAO,MAAMC,cAAA,GAAiBA,CAAC;EAC7BC,eAAe;EACfC,MAAM;EACNC,MAAM;EACNC,IAAI;EACJC,eAAe;EACfC,gBAAgB;EAChBC,OAAO;EACPC;AAAS,CACJ;EACL,KAAK,MAAM,CAACC,KAAA,EAAOC,KAAA,CAAM,IAAIP,MAAA,CAAOQ,OAAO,IAAI;IAC7C,MAAM;M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|
|
1
|
-
import type { I18nClient } from '@payloadcms/translations';
|
|
2
|
-
import type { ClientConfig, ImportMap, SanitizedConfig } from 'payload';
|
|
3
|
-
export declare const getClientConfig: (args: {
|
|
4
|
-
config: SanitizedConfig;
|
|
5
|
-
i18n: I18nClient;
|
|
6
|
-
importMap: ImportMap;
|
|
7
|
-
}) => ClientConfig;
|
|
8
|
-
//# sourceMappingURL=getClientConfig.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getClientConfig.d.ts","sourceRoot":"","sources":["../../src/utilities/getClientConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAWvE,eAAO,MAAM,eAAe,SACnB;IAAE,MAAM,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,KAAG,YAiB9E,CAAA"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { createClientConfig } from 'payload';
|
|
2
|
-
import { cache } from 'react';
|
|
3
|
-
let cachedClientConfig = global._payload_clientConfig;
|
|
4
|
-
if (!cachedClientConfig) {
|
|
5
|
-
cachedClientConfig = global._payload_clientConfig = null;
|
|
6
|
-
}
|
|
7
|
-
export const getClientConfig = cache(args => {
|
|
8
|
-
if (cachedClientConfig && !global._payload_doNotCacheClientConfig) {
|
|
9
|
-
return cachedClientConfig;
|
|
10
|
-
}
|
|
11
|
-
const {
|
|
12
|
-
config,
|
|
13
|
-
i18n,
|
|
14
|
-
importMap
|
|
15
|
-
} = args;
|
|
16
|
-
cachedClientConfig = createClientConfig({
|
|
17
|
-
config,
|
|
18
|
-
i18n,
|
|
19
|
-
importMap
|
|
20
|
-
});
|
|
21
|
-
global._payload_clientConfig = cachedClientConfig;
|
|
22
|
-
global._payload_doNotCacheClientConfig = false;
|
|
23
|
-
return cachedClientConfig;
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=getClientConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getClientConfig.js","names":["createClientConfig","cache","cachedClientConfig","global","_payload_clientConfig","getClientConfig","args","_payload_doNotCacheClientConfig","config","i18n","importMap"],"sources":["../../src/utilities/getClientConfig.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { ClientConfig, ImportMap, SanitizedConfig } from 'payload'\n\nimport { createClientConfig } from 'payload'\nimport { cache } from 'react'\n\nlet cachedClientConfig = global._payload_clientConfig\n\nif (!cachedClientConfig) {\n cachedClientConfig = global._payload_clientConfig = null\n}\n\nexport const getClientConfig = cache(\n (args: { config: SanitizedConfig; i18n: I18nClient; importMap: ImportMap }): ClientConfig => {\n if (cachedClientConfig && !global._payload_doNotCacheClientConfig) {\n return cachedClientConfig\n }\n const { config, i18n, importMap } = args\n\n cachedClientConfig = createClientConfig({\n config,\n i18n,\n importMap,\n })\n global._payload_clientConfig = cachedClientConfig\n\n global._payload_doNotCacheClientConfig = false\n\n return cachedClientConfig\n },\n)\n"],"mappings":"AAGA,SAASA,kBAAkB,QAAQ;AACnC,SAASC,KAAK,QAAQ;AAEtB,IAAIC,kBAAA,GAAqBC,MAAA,CAAOC,qBAAqB;AAErD,IAAI,CAACF,kBAAA,EAAoB;EACvBA,kBAAA,GAAqBC,MAAA,CAAOC,qBAAqB,GAAG;AACtD;AAEA,OAAO,MAAMC,eAAA,GAAkBJ,KAAA,CAC5BK,IAAA;EACC,IAAIJ,kBAAA,IAAsB,CAACC,MAAA,CAAOI,+BAA+B,EAAE;IACjE,OAAOL,kBAAA;EACT;EACA,MAAM;IAAEM,MAAM;IAAEC,IAAI;IAAEC;EAAS,CAAE,GAAGJ,IAAA;EAEpCJ,kBAAA,GAAqBF,kBAAA,CAAmB;IACtCQ,MAAA;IACAC,IAAA;IACAC;EACF;EACAP,MAAA,CAAOC,qBAAqB,GAAGF,kBAAA;EAE/BC,MAAA,CAAOI,+BAA+B,GAAG;EAEzC,OAAOL,kBAAA;AACT","ignoreList":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { I18nClient } from '@payloadcms/translations';
|
|
2
|
-
import type { ClientConfig, ClientFieldSchemaMap, FieldSchemaMap, Payload } from 'payload';
|
|
3
|
-
export declare const getClientSchemaMap: (args: {
|
|
4
|
-
collectionSlug?: string;
|
|
5
|
-
config: ClientConfig;
|
|
6
|
-
globalSlug?: string;
|
|
7
|
-
i18n: I18nClient;
|
|
8
|
-
payload: Payload;
|
|
9
|
-
schemaMap: FieldSchemaMap;
|
|
10
|
-
}) => ClientFieldSchemaMap;
|
|
11
|
-
//# sourceMappingURL=getClientSchemaMap.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getClientSchemaMap.d.ts","sourceRoot":"","sources":["../../src/utilities/getClientSchemaMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAY1F,eAAO,MAAM,kBAAkB,SACtB;IACL,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,YAAY,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,UAAU,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,EAAE,cAAc,CAAA;CAC1B,KAAG,oBAgCL,CAAA"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { cache } from 'react';
|
|
2
|
-
import { buildClientFieldSchemaMap } from './buildClientFieldSchemaMap/index.js';
|
|
3
|
-
let cachedClientSchemaMap = global._payload_clientSchemaMap;
|
|
4
|
-
if (!cachedClientSchemaMap) {
|
|
5
|
-
cachedClientSchemaMap = global._payload_clientSchemaMap = null;
|
|
6
|
-
}
|
|
7
|
-
export const getClientSchemaMap = cache(args => {
|
|
8
|
-
const {
|
|
9
|
-
collectionSlug,
|
|
10
|
-
config,
|
|
11
|
-
globalSlug,
|
|
12
|
-
i18n,
|
|
13
|
-
payload,
|
|
14
|
-
schemaMap
|
|
15
|
-
} = args;
|
|
16
|
-
if (!cachedClientSchemaMap || global._payload_doNotCacheClientSchemaMap) {
|
|
17
|
-
cachedClientSchemaMap = new Map();
|
|
18
|
-
}
|
|
19
|
-
let cachedEntityClientFieldMap = cachedClientSchemaMap.get(collectionSlug || globalSlug);
|
|
20
|
-
if (cachedEntityClientFieldMap) {
|
|
21
|
-
return cachedEntityClientFieldMap;
|
|
22
|
-
}
|
|
23
|
-
cachedEntityClientFieldMap = new Map();
|
|
24
|
-
const {
|
|
25
|
-
clientFieldSchemaMap: entityClientFieldMap
|
|
26
|
-
} = buildClientFieldSchemaMap({
|
|
27
|
-
collectionSlug,
|
|
28
|
-
config,
|
|
29
|
-
globalSlug,
|
|
30
|
-
i18n: i18n,
|
|
31
|
-
payload,
|
|
32
|
-
schemaMap
|
|
33
|
-
});
|
|
34
|
-
cachedClientSchemaMap.set(collectionSlug || globalSlug, entityClientFieldMap);
|
|
35
|
-
global._payload_clientSchemaMap = cachedClientSchemaMap;
|
|
36
|
-
global._payload_doNotCacheClientSchemaMap = false;
|
|
37
|
-
return entityClientFieldMap;
|
|
38
|
-
});
|
|
39
|
-
//# sourceMappingURL=getClientSchemaMap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getClientSchemaMap.js","names":["cache","buildClientFieldSchemaMap","cachedClientSchemaMap","global","_payload_clientSchemaMap","getClientSchemaMap","args","collectionSlug","config","globalSlug","i18n","payload","schemaMap","_payload_doNotCacheClientSchemaMap","Map","cachedEntityClientFieldMap","get","clientFieldSchemaMap","entityClientFieldMap","set"],"sources":["../../src/utilities/getClientSchemaMap.ts"],"sourcesContent":["import type { I18n, I18nClient } from '@payloadcms/translations'\nimport type { ClientConfig, ClientFieldSchemaMap, FieldSchemaMap, Payload } from 'payload'\n\nimport { cache } from 'react'\n\nimport { buildClientFieldSchemaMap } from './buildClientFieldSchemaMap/index.js'\n\nlet cachedClientSchemaMap = global._payload_clientSchemaMap\n\nif (!cachedClientSchemaMap) {\n cachedClientSchemaMap = global._payload_clientSchemaMap = null\n}\n\nexport const getClientSchemaMap = cache(\n (args: {\n collectionSlug?: string\n config: ClientConfig\n globalSlug?: string\n i18n: I18nClient\n payload: Payload\n schemaMap: FieldSchemaMap\n }): ClientFieldSchemaMap => {\n const { collectionSlug, config, globalSlug, i18n, payload, schemaMap } = args\n\n if (!cachedClientSchemaMap || global._payload_doNotCacheClientSchemaMap) {\n cachedClientSchemaMap = new Map()\n }\n\n let cachedEntityClientFieldMap = cachedClientSchemaMap.get(collectionSlug || globalSlug)\n\n if (cachedEntityClientFieldMap) {\n return cachedEntityClientFieldMap\n }\n\n cachedEntityClientFieldMap = new Map()\n\n const { clientFieldSchemaMap: entityClientFieldMap } = buildClientFieldSchemaMap({\n collectionSlug,\n config,\n globalSlug,\n i18n: i18n as I18n,\n payload,\n schemaMap,\n })\n\n cachedClientSchemaMap.set(collectionSlug || globalSlug, entityClientFieldMap)\n\n global._payload_clientSchemaMap = cachedClientSchemaMap\n\n global._payload_doNotCacheClientSchemaMap = false\n\n return entityClientFieldMap\n },\n)\n"],"mappings":"AAGA,SAASA,KAAK,QAAQ;AAEtB,SAASC,yBAAyB,QAAQ;AAE1C,IAAIC,qBAAA,GAAwBC,MAAA,CAAOC,wBAAwB;AAE3D,IAAI,CAACF,qBAAA,EAAuB;EAC1BA,qBAAA,GAAwBC,MAAA,CAAOC,wBAAwB,GAAG;AAC5D;AAEA,OAAO,MAAMC,kBAAA,GAAqBL,KAAA,CAC/BM,IAAA;EAQC,MAAM;IAAEC,cAAc;IAAEC,MAAM;IAAEC,UAAU;IAAEC,IAAI;IAAEC,OAAO;IAAEC;EAAS,CAAE,GAAGN,IAAA;EAEzE,IAAI,CAACJ,qBAAA,IAAyBC,MAAA,CAAOU,kCAAkC,EAAE;IACvEX,qBAAA,GAAwB,IAAIY,GAAA;EAC9B;EAEA,IAAIC,0BAAA,GAA6Bb,qBAAA,CAAsBc,GAAG,CAACT,cAAA,IAAkBE,UAAA;EAE7E,IAAIM,0BAAA,EAA4B;IAC9B,OAAOA,0BAAA;EACT;EAEAA,0BAAA,GAA6B,IAAID,GAAA;EAEjC,MAAM;IAAEG,oBAAA,EAAsBC;EAAoB,CAAE,GAAGjB,yBAAA,CAA0B;IAC/EM,cAAA;IACAC,MAAA;IACAC,UAAA;IACAC,IAAA,EAAMA,IAAA;IACNC,OAAA;IACAC;EACF;EAEAV,qBAAA,CAAsBiB,GAAG,CAACZ,cAAA,IAAkBE,UAAA,EAAYS,oBAAA;EAExDf,MAAA,CAAOC,wBAAwB,GAAGF,qBAAA;EAElCC,MAAA,CAAOU,kCAAkC,GAAG;EAE5C,OAAOK,oBAAA;AACT","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { I18nClient } from '@payloadcms/translations';
|
|
2
|
-
import type { FieldSchemaMap, SanitizedConfig } from 'payload';
|
|
3
|
-
export declare const getSchemaMap: (args: {
|
|
4
|
-
collectionSlug?: string;
|
|
5
|
-
config: SanitizedConfig;
|
|
6
|
-
globalSlug?: string;
|
|
7
|
-
i18n: I18nClient;
|
|
8
|
-
}) => FieldSchemaMap;
|
|
9
|
-
//# sourceMappingURL=getSchemaMap.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSchemaMap.d.ts","sourceRoot":"","sources":["../../src/utilities/getSchemaMap.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAY9D,eAAO,MAAM,YAAY,SAChB;IACL,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,eAAe,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,UAAU,CAAA;CACjB,KAAG,cA8BL,CAAA"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { cache } from 'react';
|
|
2
|
-
import { buildFieldSchemaMap } from './buildFieldSchemaMap/index.js';
|
|
3
|
-
let cachedSchemaMap = global._payload_schemaMap;
|
|
4
|
-
if (!cachedSchemaMap) {
|
|
5
|
-
cachedSchemaMap = global._payload_schemaMap = null;
|
|
6
|
-
}
|
|
7
|
-
export const getSchemaMap = cache(args => {
|
|
8
|
-
const {
|
|
9
|
-
collectionSlug,
|
|
10
|
-
config,
|
|
11
|
-
globalSlug,
|
|
12
|
-
i18n
|
|
13
|
-
} = args;
|
|
14
|
-
if (!cachedSchemaMap || global._payload_doNotCacheSchemaMap) {
|
|
15
|
-
cachedSchemaMap = new Map();
|
|
16
|
-
}
|
|
17
|
-
let cachedEntityFieldMap = cachedSchemaMap.get(collectionSlug || globalSlug);
|
|
18
|
-
if (cachedEntityFieldMap) {
|
|
19
|
-
return cachedEntityFieldMap;
|
|
20
|
-
}
|
|
21
|
-
cachedEntityFieldMap = new Map();
|
|
22
|
-
const {
|
|
23
|
-
fieldSchemaMap: entityFieldMap
|
|
24
|
-
} = buildFieldSchemaMap({
|
|
25
|
-
collectionSlug,
|
|
26
|
-
config,
|
|
27
|
-
globalSlug,
|
|
28
|
-
i18n: i18n
|
|
29
|
-
});
|
|
30
|
-
cachedSchemaMap.set(collectionSlug || globalSlug, entityFieldMap);
|
|
31
|
-
global._payload_schemaMap = cachedSchemaMap;
|
|
32
|
-
global._payload_doNotCacheSchemaMap = false;
|
|
33
|
-
return entityFieldMap;
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=getSchemaMap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSchemaMap.js","names":["cache","buildFieldSchemaMap","cachedSchemaMap","global","_payload_schemaMap","getSchemaMap","args","collectionSlug","config","globalSlug","i18n","_payload_doNotCacheSchemaMap","Map","cachedEntityFieldMap","get","fieldSchemaMap","entityFieldMap","set"],"sources":["../../src/utilities/getSchemaMap.ts"],"sourcesContent":["import type { I18n, I18nClient } from '@payloadcms/translations'\nimport type { FieldSchemaMap, SanitizedConfig } from 'payload'\n\nimport { cache } from 'react'\n\nimport { buildFieldSchemaMap } from './buildFieldSchemaMap/index.js'\n\nlet cachedSchemaMap = global._payload_schemaMap\n\nif (!cachedSchemaMap) {\n cachedSchemaMap = global._payload_schemaMap = null\n}\n\nexport const getSchemaMap = cache(\n (args: {\n collectionSlug?: string\n config: SanitizedConfig\n globalSlug?: string\n i18n: I18nClient\n }): FieldSchemaMap => {\n const { collectionSlug, config, globalSlug, i18n } = args\n\n if (!cachedSchemaMap || global._payload_doNotCacheSchemaMap) {\n cachedSchemaMap = new Map()\n }\n\n let cachedEntityFieldMap = cachedSchemaMap.get(collectionSlug || globalSlug)\n\n if (cachedEntityFieldMap) {\n return cachedEntityFieldMap\n }\n\n cachedEntityFieldMap = new Map()\n\n const { fieldSchemaMap: entityFieldMap } = buildFieldSchemaMap({\n collectionSlug,\n config,\n globalSlug,\n i18n: i18n as I18n,\n })\n\n cachedSchemaMap.set(collectionSlug || globalSlug, entityFieldMap)\n\n global._payload_schemaMap = cachedSchemaMap\n\n global._payload_doNotCacheSchemaMap = false\n\n return entityFieldMap\n },\n)\n"],"mappings":"AAGA,SAASA,KAAK,QAAQ;AAEtB,SAASC,mBAAmB,QAAQ;AAEpC,IAAIC,eAAA,GAAkBC,MAAA,CAAOC,kBAAkB;AAE/C,IAAI,CAACF,eAAA,EAAiB;EACpBA,eAAA,GAAkBC,MAAA,CAAOC,kBAAkB,GAAG;AAChD;AAEA,OAAO,MAAMC,YAAA,GAAeL,KAAA,CACzBM,IAAA;EAMC,MAAM;IAAEC,cAAc;IAAEC,MAAM;IAAEC,UAAU;IAAEC;EAAI,CAAE,GAAGJ,IAAA;EAErD,IAAI,CAACJ,eAAA,IAAmBC,MAAA,CAAOQ,4BAA4B,EAAE;IAC3DT,eAAA,GAAkB,IAAIU,GAAA;EACxB;EAEA,IAAIC,oBAAA,GAAuBX,eAAA,CAAgBY,GAAG,CAACP,cAAA,IAAkBE,UAAA;EAEjE,IAAII,oBAAA,EAAsB;IACxB,OAAOA,oBAAA;EACT;EAEAA,oBAAA,GAAuB,IAAID,GAAA;EAE3B,MAAM;IAAEG,cAAA,EAAgBC;EAAc,CAAE,GAAGf,mBAAA,CAAoB;IAC7DM,cAAA;IACAC,MAAA;IACAC,UAAA;IACAC,IAAA,EAAMA;EACR;EAEAR,eAAA,CAAgBe,GAAG,CAACV,cAAA,IAAkBE,UAAA,EAAYO,cAAA;EAElDb,MAAA,CAAOC,kBAAkB,GAAGF,eAAA;EAE5BC,MAAA,CAAOQ,4BAA4B,GAAG;EAEtC,OAAOK,cAAA;AACT","ignoreList":[]}
|
|
File without changes
|