@payloadcms/next 3.23.0-canary.ec17695 → 3.23.0-canary.f63b80a
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.
|
@@ -20,16 +20,16 @@ export function getFieldsForRowComparison({
|
|
|
20
20
|
versionFields = baseVersionField.rows?.length ? baseVersionField.rows[row] : baseVersionField.fields;
|
|
21
21
|
} else if (field.type === 'blocks') {
|
|
22
22
|
if (versionRow?.blockType === comparisonRow?.blockType) {
|
|
23
|
-
const matchedBlock = config?.blocksMap?.[versionRow?.blockType] ?? ('blocks' in field && (field.blockReferences ?? field.blocks)?.find(block => typeof block !== 'string' && block.slug === versionRow?.blockType) || {
|
|
23
|
+
const matchedBlock = config?.blocksMap?.[versionRow?.blockType] ?? (('blocks' in field || 'blockReferences' in field) && (field.blockReferences ?? field.blocks)?.find(block => typeof block !== 'string' && block.slug === versionRow?.blockType) || {
|
|
24
24
|
fields: []
|
|
25
25
|
});
|
|
26
26
|
fields = matchedBlock.fields;
|
|
27
27
|
versionFields = baseVersionField.rows?.length ? baseVersionField.rows[row] : baseVersionField.fields;
|
|
28
28
|
} else {
|
|
29
|
-
const matchedVersionBlock = config?.blocksMap?.[versionRow?.blockType] ?? ('blocks' in field && (field.blockReferences ?? field.blocks)?.find(block => typeof block !== 'string' && block.slug === versionRow?.blockType) || {
|
|
29
|
+
const matchedVersionBlock = config?.blocksMap?.[versionRow?.blockType] ?? (('blocks' in field || 'blockReferences' in field) && (field.blockReferences ?? field.blocks)?.find(block => typeof block !== 'string' && block.slug === versionRow?.blockType) || {
|
|
30
30
|
fields: []
|
|
31
31
|
});
|
|
32
|
-
const matchedComparisonBlock = config?.blocksMap?.[comparisonRow?.blockType] ?? ('blocks' in field && (field.blockReferences ?? field.blocks)?.find(block => typeof block !== 'string' && block.slug === comparisonRow?.blockType) || {
|
|
32
|
+
const matchedComparisonBlock = config?.blocksMap?.[comparisonRow?.blockType] ?? (('blocks' in field || 'blockReferences' in field) && (field.blockReferences ?? field.blocks)?.find(block => typeof block !== 'string' && block.slug === comparisonRow?.blockType) || {
|
|
33
33
|
fields: []
|
|
34
34
|
});
|
|
35
35
|
fields = getUniqueListBy([...matchedVersionBlock.fields, ...matchedComparisonBlock.fields], 'name');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFieldsForRowComparison.js","names":["getUniqueListBy","getFieldsForRowComparison","baseVersionField","comparisonRow","config","field","row","versionRow","fields","versionFields","type","rows","length","blockType","matchedBlock","blocksMap","blockReferences","blocks","find","block","slug","matchedVersionBlock","matchedComparisonBlock"],"sources":["../../../../../src/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.ts"],"sourcesContent":["import type {\n ArrayFieldClient,\n BaseVersionField,\n BlocksFieldClient,\n ClientBlock,\n ClientConfig,\n ClientField,\n VersionField,\n} from 'payload'\n\nimport { getUniqueListBy } from 'payload/shared'\n\n/**\n * Get the fields for a row in an iterable field for comparison.\n * - Array fields: the fields of the array field, because the fields are the same for each row.\n * - Blocks fields: the union of fields from the comparison and version row,\n * because the fields from the version and comparison rows may differ.\n */\nexport function getFieldsForRowComparison({\n baseVersionField,\n comparisonRow,\n config,\n field,\n row,\n versionRow,\n}: {\n baseVersionField: BaseVersionField\n comparisonRow: any\n config: ClientConfig\n field: ArrayFieldClient | BlocksFieldClient\n row: number\n versionRow: any\n}): { fields: ClientField[]; versionFields: VersionField[] } {\n let fields: ClientField[] = []\n let versionFields: VersionField[] = []\n\n if (field.type === 'array' && 'fields' in field) {\n fields = field.fields\n versionFields = baseVersionField.rows?.length\n ? baseVersionField.rows[row]\n : baseVersionField.fields\n } else if (field.type === 'blocks') {\n if (versionRow?.blockType === comparisonRow?.blockType) {\n const matchedBlock: ClientBlock =\n config?.blocksMap?.[versionRow?.blockType] ??\n ((('blocks' in field &&\n (field.blockReferences ?? field.blocks)?.find(\n (block) => typeof block !== 'string' && block.slug === versionRow?.blockType,\n )) || {\n fields: [],\n }) as ClientBlock)\n\n fields = matchedBlock.fields\n versionFields = baseVersionField.rows?.length\n ? baseVersionField.rows[row]\n : baseVersionField.fields\n } else {\n const matchedVersionBlock =\n config?.blocksMap?.[versionRow?.blockType] ??\n ((('blocks' in field &&\n (field.blockReferences ?? field.blocks)?.find(\n (block) => typeof block !== 'string' && block.slug === versionRow?.blockType,\n )) || {\n fields: [],\n }) as ClientBlock)\n\n const matchedComparisonBlock =\n config?.blocksMap?.[comparisonRow?.blockType] ??\n ((('blocks' in field &&\n (field.blockReferences ?? field.blocks)?.find(\n (block) => typeof block !== 'string' && block.slug === comparisonRow?.blockType,\n )) || {\n fields: [],\n }) as ClientBlock)\n\n fields = getUniqueListBy<ClientField>(\n [...matchedVersionBlock.fields, ...matchedComparisonBlock.fields],\n 'name',\n )\n\n // buildVersionFields already merged the fields of the version and comparison rows together\n versionFields = baseVersionField.rows?.length\n ? baseVersionField.rows[row]\n : baseVersionField.fields\n }\n }\n\n return { fields, versionFields }\n}\n"],"mappings":"AAUA,SAASA,eAAe,QAAQ;AAEhC;;;;;;AAMA,OAAO,SAASC,0BAA0B;EACxCC,gBAAgB;EAChBC,aAAa;EACbC,MAAM;EACNC,KAAK;EACLC,GAAG;EACHC;AAAU,CAQX;EACC,IAAIC,MAAA,GAAwB,EAAE;EAC9B,IAAIC,aAAA,GAAgC,EAAE;EAEtC,IAAIJ,KAAA,CAAMK,IAAI,KAAK,WAAW,YAAYL,KAAA,EAAO;IAC/CG,MAAA,GAASH,KAAA,CAAMG,MAAM;IACrBC,aAAA,GAAgBP,gBAAA,CAAiBS,IAAI,EAAEC,MAAA,GACnCV,gBAAA,CAAiBS,IAAI,CAACL,GAAA,CAAI,GAC1BJ,gBAAA,CAAiBM,MAAM;EAC7B,OAAO,IAAIH,KAAA,CAAMK,IAAI,KAAK,UAAU;IAClC,IAAIH,UAAA,EAAYM,SAAA,KAAcV,aAAA,EAAeU,SAAA,EAAW;MACtD,MAAMC,YAAA,GACJV,MAAA,EAAQW,SAAA,GAAYR,UAAA,EAAYM,SAAA,CAAU,KACxC,
|
|
1
|
+
{"version":3,"file":"getFieldsForRowComparison.js","names":["getUniqueListBy","getFieldsForRowComparison","baseVersionField","comparisonRow","config","field","row","versionRow","fields","versionFields","type","rows","length","blockType","matchedBlock","blocksMap","blockReferences","blocks","find","block","slug","matchedVersionBlock","matchedComparisonBlock"],"sources":["../../../../../src/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.ts"],"sourcesContent":["import type {\n ArrayFieldClient,\n BaseVersionField,\n BlocksFieldClient,\n ClientBlock,\n ClientConfig,\n ClientField,\n VersionField,\n} from 'payload'\n\nimport { getUniqueListBy } from 'payload/shared'\n\n/**\n * Get the fields for a row in an iterable field for comparison.\n * - Array fields: the fields of the array field, because the fields are the same for each row.\n * - Blocks fields: the union of fields from the comparison and version row,\n * because the fields from the version and comparison rows may differ.\n */\nexport function getFieldsForRowComparison({\n baseVersionField,\n comparisonRow,\n config,\n field,\n row,\n versionRow,\n}: {\n baseVersionField: BaseVersionField\n comparisonRow: any\n config: ClientConfig\n field: ArrayFieldClient | BlocksFieldClient\n row: number\n versionRow: any\n}): { fields: ClientField[]; versionFields: VersionField[] } {\n let fields: ClientField[] = []\n let versionFields: VersionField[] = []\n\n if (field.type === 'array' && 'fields' in field) {\n fields = field.fields\n versionFields = baseVersionField.rows?.length\n ? baseVersionField.rows[row]\n : baseVersionField.fields\n } else if (field.type === 'blocks') {\n if (versionRow?.blockType === comparisonRow?.blockType) {\n const matchedBlock: ClientBlock =\n config?.blocksMap?.[versionRow?.blockType] ??\n (((('blocks' in field || 'blockReferences' in field) &&\n (field.blockReferences ?? field.blocks)?.find(\n (block) => typeof block !== 'string' && block.slug === versionRow?.blockType,\n )) || {\n fields: [],\n }) as ClientBlock)\n\n fields = matchedBlock.fields\n versionFields = baseVersionField.rows?.length\n ? baseVersionField.rows[row]\n : baseVersionField.fields\n } else {\n const matchedVersionBlock =\n config?.blocksMap?.[versionRow?.blockType] ??\n (((('blocks' in field || 'blockReferences' in field) &&\n (field.blockReferences ?? field.blocks)?.find(\n (block) => typeof block !== 'string' && block.slug === versionRow?.blockType,\n )) || {\n fields: [],\n }) as ClientBlock)\n\n const matchedComparisonBlock =\n config?.blocksMap?.[comparisonRow?.blockType] ??\n (((('blocks' in field || 'blockReferences' in field) &&\n (field.blockReferences ?? field.blocks)?.find(\n (block) => typeof block !== 'string' && block.slug === comparisonRow?.blockType,\n )) || {\n fields: [],\n }) as ClientBlock)\n\n fields = getUniqueListBy<ClientField>(\n [...matchedVersionBlock.fields, ...matchedComparisonBlock.fields],\n 'name',\n )\n\n // buildVersionFields already merged the fields of the version and comparison rows together\n versionFields = baseVersionField.rows?.length\n ? baseVersionField.rows[row]\n : baseVersionField.fields\n }\n }\n\n return { fields, versionFields }\n}\n"],"mappings":"AAUA,SAASA,eAAe,QAAQ;AAEhC;;;;;;AAMA,OAAO,SAASC,0BAA0B;EACxCC,gBAAgB;EAChBC,aAAa;EACbC,MAAM;EACNC,KAAK;EACLC,GAAG;EACHC;AAAU,CAQX;EACC,IAAIC,MAAA,GAAwB,EAAE;EAC9B,IAAIC,aAAA,GAAgC,EAAE;EAEtC,IAAIJ,KAAA,CAAMK,IAAI,KAAK,WAAW,YAAYL,KAAA,EAAO;IAC/CG,MAAA,GAASH,KAAA,CAAMG,MAAM;IACrBC,aAAA,GAAgBP,gBAAA,CAAiBS,IAAI,EAAEC,MAAA,GACnCV,gBAAA,CAAiBS,IAAI,CAACL,GAAA,CAAI,GAC1BJ,gBAAA,CAAiBM,MAAM;EAC7B,OAAO,IAAIH,KAAA,CAAMK,IAAI,KAAK,UAAU;IAClC,IAAIH,UAAA,EAAYM,SAAA,KAAcV,aAAA,EAAeU,SAAA,EAAW;MACtD,MAAMC,YAAA,GACJV,MAAA,EAAQW,SAAA,GAAYR,UAAA,EAAYM,SAAA,CAAU,KACxC,CAAE,YAAYR,KAAA,IAAS,qBAAqBA,KAAI,KAC/C,CAAAA,KAAA,CAAMW,eAAe,I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M,MAAM;IAC7B;EACF;EAEA,OAAO;IAAEA,MAAA;IAAQC;EAAc;AACjC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/next",
|
|
3
|
-
"version": "3.23.0-canary.
|
|
3
|
+
"version": "3.23.0-canary.f63b80a",
|
|
4
4
|
"homepage": "https://payloadcms.com",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
"sass": "1.77.4",
|
|
81
81
|
"sonner": "^1.7.0",
|
|
82
82
|
"uuid": "10.0.0",
|
|
83
|
-
"@payloadcms/graphql": "3.23.0-canary.
|
|
84
|
-
"@payloadcms/translations": "3.23.0-canary.
|
|
85
|
-
"@payloadcms/ui": "3.23.0-canary.
|
|
83
|
+
"@payloadcms/graphql": "3.23.0-canary.f63b80a",
|
|
84
|
+
"@payloadcms/translations": "3.23.0-canary.f63b80a",
|
|
85
|
+
"@payloadcms/ui": "3.23.0-canary.f63b80a"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@babel/cli": "7.26.4",
|
|
@@ -100,13 +100,13 @@
|
|
|
100
100
|
"esbuild-sass-plugin": "3.3.1",
|
|
101
101
|
"eslint-plugin-react-compiler": "19.0.0-beta-714736e-20250131",
|
|
102
102
|
"swc-plugin-transform-remove-imports": "3.1.0",
|
|
103
|
-
"
|
|
104
|
-
"
|
|
103
|
+
"payload": "3.23.0-canary.f63b80a",
|
|
104
|
+
"@payloadcms/eslint-config": "3.9.0"
|
|
105
105
|
},
|
|
106
106
|
"peerDependencies": {
|
|
107
107
|
"graphql": "^16.8.1",
|
|
108
108
|
"next": "^15.0.0",
|
|
109
|
-
"payload": "3.23.0-canary.
|
|
109
|
+
"payload": "3.23.0-canary.f63b80a"
|
|
110
110
|
},
|
|
111
111
|
"engines": {
|
|
112
112
|
"node": "^18.20.2 || >=20.9.0"
|