@payloadcms/next 3.19.0 → 3.20.0-canary.0e01b65
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/prod/styles.css +1 -1
- package/dist/views/Account/index.d.ts.map +1 -1
- package/dist/views/Account/index.js +2 -1
- package/dist/views/Account/index.js.map +1 -1
- package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +4 -2
- package/dist/views/CreateFirstUser/index.client.js.map +1 -1
- package/dist/views/CreateFirstUser/index.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.js +2 -1
- package/dist/views/CreateFirstUser/index.js.map +1 -1
- package/dist/views/Document/getDocumentPermissions.js +2 -2
- package/dist/views/Document/getDocumentPermissions.js.map +1 -1
- package/dist/views/Document/index.d.ts.map +1 -1
- package/dist/views/Document/index.js +2 -1
- package/dist/views/Document/index.js.map +1 -1
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts.map +1 -1
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +2 -0
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
- package/dist/views/LivePreview/index.client.d.ts.map +1 -1
- package/dist/views/LivePreview/index.client.js +5 -2
- package/dist/views/LivePreview/index.client.js.map +1 -1
- package/dist/views/Version/Default/SelectedLocalesContext.d.ts +8 -0
- package/dist/views/Version/Default/SelectedLocalesContext.d.ts.map +1 -0
- package/dist/views/Version/Default/SelectedLocalesContext.js +10 -0
- package/dist/views/Version/Default/SelectedLocalesContext.js.map +1 -0
- package/dist/views/Version/Default/index.d.ts.map +1 -1
- package/dist/views/Version/Default/index.js +89 -159
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/Default/types.d.ts +4 -4
- package/dist/views/Version/Default/types.d.ts.map +1 -1
- package/dist/views/Version/Default/types.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.d.ts +27 -0
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.d.ts.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js +76 -0
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.scss +46 -0
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.d.ts +6 -0
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.d.ts.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.js +36 -0
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.d.ts +30 -0
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.d.ts.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js +300 -0
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.d.ts +4 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.d.ts.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js +64 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.d.ts +5 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.d.ts.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js +69 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.scss +14 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts +3 -4
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +100 -63
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.scss +3 -12
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts +2 -4
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +18 -17
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.d.ts +4 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.d.ts.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.js +17 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts +2 -4
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +56 -28
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts +3 -4
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +146 -42
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.scss +20 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts +2 -4
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +71 -37
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts +2 -22
- package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js +13 -9
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.d.ts +2 -5
- package/dist/views/Version/RenderFieldsToDiff/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.js +8 -113
- package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/types.d.ts +2 -20
- package/dist/views/Version/RenderFieldsToDiff/types.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/types.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.d.ts +21 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.d.ts.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js +194 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js +860 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.d.ts +2 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.d.ts.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.js +4 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.js +46 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldPathsModified.d.ts +27 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldPathsModified.d.ts.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldPathsModified.js +30 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldPathsModified.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.d.ts +18 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.d.ts.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js +44 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js +122 -0
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js.map +1 -0
- package/dist/views/Version/Restore/index.d.ts.map +1 -1
- package/dist/views/Version/Restore/index.js +2 -2
- package/dist/views/Version/Restore/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/index.d.ts.map +1 -1
- package/dist/views/Version/SelectComparison/index.js +7 -3
- package/dist/views/Version/SelectComparison/index.js.map +1 -1
- package/dist/views/Version/index.d.ts.map +1 -1
- package/dist/views/Version/index.js +117 -15
- package/dist/views/Version/index.js.map +1 -1
- package/dist/views/Versions/getLatestVersion.d.ts +4 -1
- package/dist/views/Versions/getLatestVersion.d.ts.map +1 -1
- package/dist/views/Versions/getLatestVersion.js +6 -0
- package/dist/views/Versions/getLatestVersion.js.map +1 -1
- package/package.json +8 -8
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts +0 -6
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js +0 -43
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.scss +0 -14
- package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts +0 -22
- package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/types.js +0 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/types.js.map +0 -1
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { Collapsible } from './Collapsible/index.js';
|
|
2
|
+
import { Group } from './Group/index.js';
|
|
3
|
+
import { Iterable } from './Iterable/index.js';
|
|
4
|
+
import { Relationship } from './Relationship/index.js';
|
|
5
|
+
import { Row } from './Row/index.js';
|
|
6
|
+
import { Select } from './Select/index.js';
|
|
7
|
+
import { Tabs } from './Tabs/index.js';
|
|
8
|
+
import { Text } from './Text/index.js';
|
|
7
9
|
export const diffComponents = {
|
|
8
10
|
array: Iterable,
|
|
9
11
|
blocks: Iterable,
|
|
10
12
|
checkbox: Text,
|
|
11
13
|
code: Text,
|
|
12
|
-
collapsible:
|
|
14
|
+
collapsible: Collapsible,
|
|
13
15
|
date: Text,
|
|
14
16
|
email: Text,
|
|
15
|
-
group:
|
|
17
|
+
group: Group,
|
|
18
|
+
join: null,
|
|
16
19
|
json: Text,
|
|
17
20
|
number: Text,
|
|
18
21
|
point: Text,
|
|
19
22
|
radio: Select,
|
|
20
23
|
relationship: Relationship,
|
|
21
24
|
richText: Text,
|
|
22
|
-
row:
|
|
25
|
+
row: Row,
|
|
23
26
|
select: Select,
|
|
24
27
|
tabs: Tabs,
|
|
25
28
|
text: Text,
|
|
26
29
|
textarea: Text,
|
|
30
|
+
ui: null,
|
|
27
31
|
upload: Relationship
|
|
28
32
|
};
|
|
29
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["Collapsible","Group","Iterable","Relationship","Row","Select","Tabs","Text","diffComponents","array","blocks","checkbox","code","collapsible","date","email","group","join","json","number","point","radio","relationship","richText","row","select","tabs","text","textarea","ui","upload"],"sources":["../../../../../src/views/Version/RenderFieldsToDiff/fields/index.tsx"],"sourcesContent":["import type { DiffComponentProps, FieldTypes } from 'payload'\n\nimport { Collapsible } from './Collapsible/index.js'\nimport { Group } from './Group/index.js'\nimport { Iterable } from './Iterable/index.js'\nimport { Relationship } from './Relationship/index.js'\nimport { Row } from './Row/index.js'\nimport { Select } from './Select/index.js'\nimport { Tabs } from './Tabs/index.js'\nimport { Text } from './Text/index.js'\n\nexport const diffComponents: Record<FieldTypes, React.FC<DiffComponentProps>> = {\n array: Iterable,\n blocks: Iterable,\n checkbox: Text,\n code: Text,\n collapsible: Collapsible,\n date: Text,\n email: Text,\n group: Group,\n join: null,\n json: Text,\n number: Text,\n point: Text,\n radio: Select,\n relationship: Relationship,\n richText: Text,\n row: Row,\n select: Select,\n tabs: Tabs,\n text: Text,\n textarea: Text,\n ui: null,\n upload: Relationship,\n}\n"],"mappings":"AAEA,SAASA,WAAW,QAAQ;AAC5B,SAASC,KAAK,QAAQ;AACtB,SAASC,QAAQ,QAAQ;AACzB,SAASC,YAAY,QAAQ;AAC7B,SAASC,GAAG,QAAQ;AACpB,SAASC,MAAM,QAAQ;AACvB,SAASC,IAAI,QAAQ;AACrB,SAASC,IAAI,QAAQ;AAErB,OAAO,MAAMC,cAAA,GAAmE;EAC9EC,KAAA,EAAOP,QAAA;EACPQ,MAAA,EAAQR,QAAA;EACRS,QAAA,EAAUJ,IAAA;EACVK,IAAA,EAAML,IAAA;EACNM,WAAA,EAAab,WAAA;EACbc,IAAA,EAAMP,IAAA;EACNQ,KAAA,EAAOR,IAAA;EACPS,KAAA,EAAOf,KAAA;EACPgB,IAAA,EAAM;EACNC,IAAA,EAAMX,IAAA;EACNY,MAAA,EAAQZ,IAAA;EACRa,KAAA,EAAOb,IAAA;EACPc,KAAA,EAAOhB,MAAA;EACPiB,YAAA,EAAcnB,YAAA;EACdoB,QAAA,EAAUhB,IAAA;EACViB,GAAA,EAAKpB,GAAA;EACLqB,MAAA,EAAQpB,MAAA;EACRqB,IAAA,EAAMpB,IAAA;EACNqB,IAAA,EAAMpB,IAAA;EACNqB,QAAA,EAAUrB,IAAA;EACVsB,EAAA,EAAI;EACJC,MAAA,EAAQ3B;AACV","ignoreList":[]}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import './index.scss';
|
|
4
|
-
declare const RenderFieldsToDiff: React.FC<Props>;
|
|
5
|
-
export default RenderFieldsToDiff;
|
|
1
|
+
import { type BuildVersionFieldsArgs } from './buildVersionFields.js';
|
|
2
|
+
export declare const RenderDiff: (args: BuildVersionFieldsArgs) => React.ReactNode;
|
|
6
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/Version/RenderFieldsToDiff/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/views/Version/RenderFieldsToDiff/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAGzF,eAAO,MAAM,UAAU,SAAU,sBAAsB,KAAG,KAAK,CAAC,SAI/D,CAAA"}
|
|
@@ -1,117 +1,12 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
fieldPermissions,
|
|
13
|
-
fields,
|
|
14
|
-
i18n,
|
|
15
|
-
locales,
|
|
16
|
-
version
|
|
17
|
-
}) => {
|
|
18
|
-
// typing it as `as typeof _diffComponents` here ensures the TField generics of DiffComponentProps are respected.
|
|
19
|
-
// Without it, you could pass a UI field to the Tabs component, without it erroring
|
|
20
|
-
const diffComponents = __diffComponents;
|
|
21
|
-
return /*#__PURE__*/_jsx("div", {
|
|
22
|
-
className: baseClass,
|
|
23
|
-
children: fields?.map((field, i) => {
|
|
24
|
-
if (fieldIsID(field)) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
const Component = diffComponents[field.type];
|
|
28
|
-
const isRichText = field.type === 'richText';
|
|
29
|
-
const diffMethod = diffMethods[field.type] || 'CHARS';
|
|
30
|
-
if (Component) {
|
|
31
|
-
if (fieldAffectsData(field)) {
|
|
32
|
-
const fieldName = field.name;
|
|
33
|
-
const valueIsObject = field.type === 'code' || field.type === 'json';
|
|
34
|
-
const versionValue = valueIsObject ? JSON.stringify(version?.[fieldName]) : version?.[fieldName];
|
|
35
|
-
const comparisonValue = valueIsObject ? JSON.stringify(comparison?.[fieldName]) : comparison?.[fieldName];
|
|
36
|
-
const hasPermission = fieldPermissions === true || fieldPermissions?.[fieldName] === true || fieldPermissions?.[fieldName]?.read;
|
|
37
|
-
const subFieldPermissions = fieldPermissions === true || fieldPermissions?.[fieldName] === true || fieldPermissions?.[fieldName]?.fields;
|
|
38
|
-
if (!hasPermission) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
const baseCellProps = {
|
|
42
|
-
comparison: comparisonValue,
|
|
43
|
-
diffComponents,
|
|
44
|
-
diffMethod,
|
|
45
|
-
field,
|
|
46
|
-
fieldPermissions: subFieldPermissions,
|
|
47
|
-
fields: 'fields' in field ? field?.fields : fields,
|
|
48
|
-
i18n,
|
|
49
|
-
isRichText,
|
|
50
|
-
locales,
|
|
51
|
-
version: versionValue
|
|
52
|
-
};
|
|
53
|
-
if (field.localized) {
|
|
54
|
-
return /*#__PURE__*/_jsx("div", {
|
|
55
|
-
className: `${baseClass}__field`,
|
|
56
|
-
children: locales.map((locale, index) => {
|
|
57
|
-
const versionLocaleValue = versionValue?.[locale];
|
|
58
|
-
const comparisonLocaleValue = comparisonValue?.[locale];
|
|
59
|
-
const cellProps = {
|
|
60
|
-
...baseCellProps,
|
|
61
|
-
comparison: comparisonLocaleValue,
|
|
62
|
-
version: versionLocaleValue
|
|
63
|
-
};
|
|
64
|
-
return /*#__PURE__*/_jsx("div", {
|
|
65
|
-
className: `${baseClass}__locale`,
|
|
66
|
-
children: /*#__PURE__*/_jsx("div", {
|
|
67
|
-
className: `${baseClass}__locale-value`,
|
|
68
|
-
children: /*#__PURE__*/_jsx(Component, {
|
|
69
|
-
...cellProps,
|
|
70
|
-
locale: locale
|
|
71
|
-
})
|
|
72
|
-
})
|
|
73
|
-
}, [locale, index].join('-'));
|
|
74
|
-
})
|
|
75
|
-
}, i);
|
|
76
|
-
}
|
|
77
|
-
return /*#__PURE__*/_jsx("div", {
|
|
78
|
-
className: `${baseClass}__field`,
|
|
79
|
-
children: /*#__PURE__*/_jsx(Component, {
|
|
80
|
-
...baseCellProps
|
|
81
|
-
})
|
|
82
|
-
}, i);
|
|
83
|
-
}
|
|
84
|
-
if (field.type === 'tabs' && 'tabs' in field) {
|
|
85
|
-
const Tabs = diffComponents.tabs;
|
|
86
|
-
return /*#__PURE__*/_jsx(Tabs, {
|
|
87
|
-
comparison: comparison,
|
|
88
|
-
diffComponents: diffComponents,
|
|
89
|
-
field: field,
|
|
90
|
-
fieldPermissions: fieldPermissions,
|
|
91
|
-
fields: [],
|
|
92
|
-
i18n: i18n,
|
|
93
|
-
locales: locales,
|
|
94
|
-
version: version
|
|
95
|
-
}, i);
|
|
96
|
-
}
|
|
97
|
-
// At this point, we are dealing with a `row`, etc
|
|
98
|
-
if ('fields' in field) {
|
|
99
|
-
return /*#__PURE__*/_jsx(Nested, {
|
|
100
|
-
comparison: comparison,
|
|
101
|
-
diffComponents: diffComponents,
|
|
102
|
-
disableGutter: true,
|
|
103
|
-
field: field,
|
|
104
|
-
fieldPermissions: fieldPermissions,
|
|
105
|
-
fields: field.fields,
|
|
106
|
-
i18n: i18n,
|
|
107
|
-
locales: locales,
|
|
108
|
-
version: version
|
|
109
|
-
}, i);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return null;
|
|
113
|
-
})
|
|
2
|
+
import { buildVersionFields } from './buildVersionFields.js';
|
|
3
|
+
import { RenderVersionFieldsToDiff } from './RenderVersionFieldsToDiff.js';
|
|
4
|
+
export const RenderDiff = args => {
|
|
5
|
+
const {
|
|
6
|
+
versionFields
|
|
7
|
+
} = buildVersionFields(args);
|
|
8
|
+
return /*#__PURE__*/_jsx(RenderVersionFieldsToDiff, {
|
|
9
|
+
versionFields: versionFields
|
|
114
10
|
});
|
|
115
11
|
};
|
|
116
|
-
export default RenderFieldsToDiff;
|
|
117
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["buildVersionFields","RenderVersionFieldsToDiff","RenderDiff","args","versionFields","_jsx"],"sources":["../../../../src/views/Version/RenderFieldsToDiff/index.tsx"],"sourcesContent":["import { buildVersionFields, type BuildVersionFieldsArgs } from './buildVersionFields.js'\nimport { RenderVersionFieldsToDiff } from './RenderVersionFieldsToDiff.js'\n\nexport const RenderDiff = (args: BuildVersionFieldsArgs): React.ReactNode => {\n const { versionFields } = buildVersionFields(args)\n\n return <RenderVersionFieldsToDiff versionFields={versionFields} />\n}\n"],"mappings":";AAAA,SAASA,kBAAkB,QAAqC;AAChE,SAASC,yBAAyB,QAAQ;AAE1C,OAAO,MAAMC,UAAA,GAAcC,IAAA;EACzB,MAAM;IAAEC;EAAa,CAAE,GAAGJ,kBAAA,CAAmBG,IAAA;EAE7C,oBAAOE,IAAA,CAACJ,yBAAA;IAA0BG,aAAA,EAAeA;;AACnD","ignoreList":[]}
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
import type { DiffMethod } from 'react-diff-viewer-continued';
|
|
4
|
-
import type { DiffComponents } from './fields/types.js';
|
|
5
|
-
export type Props = {
|
|
6
|
-
readonly comparison: Record<string, any>;
|
|
7
|
-
readonly diffComponents: DiffComponents;
|
|
8
|
-
readonly fieldPermissions: {
|
|
9
|
-
[key: string]: SanitizedFieldPermissions;
|
|
10
|
-
} | true;
|
|
11
|
-
readonly fields: ClientField[];
|
|
12
|
-
readonly i18n: I18nClient;
|
|
13
|
-
readonly locales: string[];
|
|
14
|
-
readonly version: Record<string, any>;
|
|
15
|
-
};
|
|
16
|
-
export type FieldDiffProps = {
|
|
17
|
-
diffMethod: DiffMethod;
|
|
18
|
-
field: ClientField;
|
|
19
|
-
isRichText: boolean;
|
|
20
|
-
} & Props;
|
|
1
|
+
import type { DiffComponentProps } from 'payload';
|
|
2
|
+
export type DiffComponents = Record<string, React.FC<DiffComponentProps>>;
|
|
21
3
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/views/Version/RenderFieldsToDiff/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/views/Version/RenderFieldsToDiff/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/views/Version/RenderFieldsToDiff/types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../src/views/Version/RenderFieldsToDiff/types.ts"],"sourcesContent":["import type { DiffComponentProps } from 'payload'\n\nexport type DiffComponents = Record<string, React.FC<DiffComponentProps>>\n"],"mappings":"AAEA","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ArrayFieldClient, BlocksFieldClient, ClientField } from 'payload';
|
|
2
|
+
type Args = {
|
|
3
|
+
comparison: unknown;
|
|
4
|
+
fields: ClientField[];
|
|
5
|
+
locales: string[] | undefined;
|
|
6
|
+
version: unknown;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Recursively counts the number of changed fields between comparison and
|
|
10
|
+
* version data for a given set of fields.
|
|
11
|
+
*/
|
|
12
|
+
export declare function countChangedFields({ comparison, fields, locales, version }: Args): number;
|
|
13
|
+
type countChangedFieldsInRowsArgs = {
|
|
14
|
+
comparisonRows: unknown[];
|
|
15
|
+
field: ArrayFieldClient | BlocksFieldClient;
|
|
16
|
+
locales: string[] | undefined;
|
|
17
|
+
versionRows: unknown[];
|
|
18
|
+
};
|
|
19
|
+
export declare function countChangedFieldsInRows({ comparisonRows, field, locales, versionRows, }: countChangedFieldsInRowsArgs): number;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=countChangedFields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countChangedFields.d.ts","sourceRoot":"","sources":["../../../../../src/views/Version/RenderFieldsToDiff/utilities/countChangedFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAK/E,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,OAAO,CAAA;IACnB,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC7B,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,UA8IhF;AAED,KAAK,4BAA4B,GAAG;IAClC,cAAc,EAAE,OAAO,EAAE,CAAA;IACzB,KAAK,EAAE,gBAAgB,GAAG,iBAAiB,CAAA;IAC3C,OAAO,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;IAC7B,WAAW,EAAE,OAAO,EAAE,CAAA;CACvB,CAAA;AAED,wBAAgB,wBAAwB,CAAC,EACvC,cAAmB,EACnB,KAAK,EACL,OAAO,EACP,WAAgB,GACjB,EAAE,4BAA4B,UA0B9B"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { fieldHasChanges } from './fieldHasChanges.js';
|
|
2
|
+
import { getFieldsForRowComparison } from './getFieldsForRowComparison.js';
|
|
3
|
+
/**
|
|
4
|
+
* Recursively counts the number of changed fields between comparison and
|
|
5
|
+
* version data for a given set of fields.
|
|
6
|
+
*/
|
|
7
|
+
export function countChangedFields({
|
|
8
|
+
comparison,
|
|
9
|
+
fields,
|
|
10
|
+
locales,
|
|
11
|
+
version
|
|
12
|
+
}) {
|
|
13
|
+
let count = 0;
|
|
14
|
+
fields.forEach(field => {
|
|
15
|
+
// Don't count the id field since it is not displayed in the UI
|
|
16
|
+
if ('name' in field && field.name === 'id') {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const fieldType = field.type;
|
|
20
|
+
switch (fieldType) {
|
|
21
|
+
// Iterable fields are arrays and blocks fields. We iterate over each row and
|
|
22
|
+
// count the number of changed fields in each.
|
|
23
|
+
case 'array':
|
|
24
|
+
case 'blocks':
|
|
25
|
+
{
|
|
26
|
+
if (locales && field.localized) {
|
|
27
|
+
locales.forEach(locale => {
|
|
28
|
+
const comparisonRows = comparison?.[field.name]?.[locale] ?? [];
|
|
29
|
+
const versionRows = version?.[field.name]?.[locale] ?? [];
|
|
30
|
+
count += countChangedFieldsInRows({
|
|
31
|
+
comparisonRows,
|
|
32
|
+
field,
|
|
33
|
+
locales,
|
|
34
|
+
versionRows
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
} else {
|
|
38
|
+
const comparisonRows = comparison?.[field.name] ?? [];
|
|
39
|
+
const versionRows = version?.[field.name] ?? [];
|
|
40
|
+
count += countChangedFieldsInRows({
|
|
41
|
+
comparisonRows,
|
|
42
|
+
field,
|
|
43
|
+
locales,
|
|
44
|
+
versionRows
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
// Regular fields without nested fields.
|
|
50
|
+
case 'checkbox':
|
|
51
|
+
case 'code':
|
|
52
|
+
case 'date':
|
|
53
|
+
case 'email':
|
|
54
|
+
case 'join':
|
|
55
|
+
case 'json':
|
|
56
|
+
case 'number':
|
|
57
|
+
case 'point':
|
|
58
|
+
case 'radio':
|
|
59
|
+
case 'relationship':
|
|
60
|
+
case 'richText':
|
|
61
|
+
case 'select':
|
|
62
|
+
case 'text':
|
|
63
|
+
case 'textarea':
|
|
64
|
+
case 'upload':
|
|
65
|
+
{
|
|
66
|
+
// Fields that have a name and contain data. We can just check if the data has changed.
|
|
67
|
+
if (locales && field.localized) {
|
|
68
|
+
locales.forEach(locale => {
|
|
69
|
+
if (fieldHasChanges(version?.[field.name]?.[locale], comparison?.[field.name]?.[locale])) {
|
|
70
|
+
count++;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
} else if (fieldHasChanges(version?.[field.name], comparison?.[field.name])) {
|
|
74
|
+
count++;
|
|
75
|
+
}
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
// Fields that have nested fields, but don't nest their fields' data.
|
|
79
|
+
case 'collapsible':
|
|
80
|
+
case 'row':
|
|
81
|
+
{
|
|
82
|
+
count += countChangedFields({
|
|
83
|
+
comparison,
|
|
84
|
+
fields: field.fields,
|
|
85
|
+
locales,
|
|
86
|
+
version
|
|
87
|
+
});
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
// Fields that have nested fields and nest their fields' data.
|
|
91
|
+
case 'group':
|
|
92
|
+
{
|
|
93
|
+
if (locales && field.localized) {
|
|
94
|
+
locales.forEach(locale => {
|
|
95
|
+
count += countChangedFields({
|
|
96
|
+
comparison: comparison?.[field.name]?.[locale],
|
|
97
|
+
fields: field.fields,
|
|
98
|
+
locales,
|
|
99
|
+
version: version?.[field.name]?.[locale]
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
} else {
|
|
103
|
+
count += countChangedFields({
|
|
104
|
+
comparison: comparison?.[field.name],
|
|
105
|
+
fields: field.fields,
|
|
106
|
+
locales,
|
|
107
|
+
version: version?.[field.name]
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
break;
|
|
111
|
+
}
|
|
112
|
+
// Each tab in a tabs field has nested fields. The fields data may be
|
|
113
|
+
// nested or not depending on the existence of a name property.
|
|
114
|
+
case 'tabs':
|
|
115
|
+
{
|
|
116
|
+
field.tabs.forEach(tab => {
|
|
117
|
+
if ('name' in tab && locales && tab.localized) {
|
|
118
|
+
// Named localized tab
|
|
119
|
+
locales.forEach(locale => {
|
|
120
|
+
count += countChangedFields({
|
|
121
|
+
comparison: comparison?.[tab.name]?.[locale],
|
|
122
|
+
fields: tab.fields,
|
|
123
|
+
locales,
|
|
124
|
+
version: version?.[tab.name]?.[locale]
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
} else if ('name' in tab) {
|
|
128
|
+
// Named tab
|
|
129
|
+
count += countChangedFields({
|
|
130
|
+
comparison: comparison?.[tab.name],
|
|
131
|
+
fields: tab.fields,
|
|
132
|
+
locales,
|
|
133
|
+
version: version?.[tab.name]
|
|
134
|
+
});
|
|
135
|
+
} else {
|
|
136
|
+
// Unnamed tab
|
|
137
|
+
count += countChangedFields({
|
|
138
|
+
comparison,
|
|
139
|
+
fields: tab.fields,
|
|
140
|
+
locales,
|
|
141
|
+
version
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
// UI fields don't have data and are not displayed in the version view
|
|
148
|
+
// so we can ignore them.
|
|
149
|
+
case 'ui':
|
|
150
|
+
{
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
default:
|
|
154
|
+
{
|
|
155
|
+
const _exhaustiveCheck = fieldType;
|
|
156
|
+
throw new Error(`Unexpected field.type in countChangedFields : ${String(fieldType)}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
return count;
|
|
161
|
+
}
|
|
162
|
+
export function countChangedFieldsInRows({
|
|
163
|
+
comparisonRows = [],
|
|
164
|
+
field,
|
|
165
|
+
locales,
|
|
166
|
+
versionRows = []
|
|
167
|
+
}) {
|
|
168
|
+
let count = 0;
|
|
169
|
+
let i = 0;
|
|
170
|
+
while (comparisonRows[i] || versionRows[i]) {
|
|
171
|
+
const comparisonRow = comparisonRows?.[i] || {};
|
|
172
|
+
const versionRow = versionRows?.[i] || {};
|
|
173
|
+
const {
|
|
174
|
+
fields: rowFields
|
|
175
|
+
} = getFieldsForRowComparison({
|
|
176
|
+
baseVersionField: {
|
|
177
|
+
fields: []
|
|
178
|
+
},
|
|
179
|
+
comparisonRow,
|
|
180
|
+
field,
|
|
181
|
+
row: i,
|
|
182
|
+
versionRow
|
|
183
|
+
});
|
|
184
|
+
count += countChangedFields({
|
|
185
|
+
comparison: comparisonRow,
|
|
186
|
+
fields: rowFields,
|
|
187
|
+
locales,
|
|
188
|
+
version: versionRow
|
|
189
|
+
});
|
|
190
|
+
i++;
|
|
191
|
+
}
|
|
192
|
+
return count;
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=countChangedFields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countChangedFields.js","names":["fieldHasChanges","getFieldsForRowComparison","countChangedFields","comparison","fields","locales","version","count","forEach","field","name","fieldType","type","localized","locale","comparisonRows","versionRows","countChangedFieldsInRows","tabs","tab","_exhaustiveCheck","Error","String","i","comparisonRow","versionRow","rowFields","baseVersionField","row"],"sources":["../../../../../src/views/Version/RenderFieldsToDiff/utilities/countChangedFields.ts"],"sourcesContent":["import type { ArrayFieldClient, BlocksFieldClient, ClientField } from 'payload'\n\nimport { fieldHasChanges } from './fieldHasChanges.js'\nimport { getFieldsForRowComparison } from './getFieldsForRowComparison.js'\n\ntype Args = {\n comparison: unknown\n fields: ClientField[]\n locales: string[] | undefined\n version: unknown\n}\n\n/**\n * Recursively counts the number of changed fields between comparison and\n * version data for a given set of fields.\n */\nexport function countChangedFields({ comparison, fields, locales, version }: Args) {\n let count = 0\n\n fields.forEach((field) => {\n // Don't count the id field since it is not displayed in the UI\n if ('name' in field && field.name === 'id') {\n return\n }\n const fieldType = field.type\n switch (fieldType) {\n // Iterable fields are arrays and blocks fields. We iterate over each row and\n // count the number of changed fields in each.\n case 'array':\n case 'blocks': {\n if (locales && field.localized) {\n locales.forEach((locale) => {\n const comparisonRows = comparison?.[field.name]?.[locale] ?? []\n const versionRows = version?.[field.name]?.[locale] ?? []\n count += countChangedFieldsInRows({ comparisonRows, field, locales, versionRows })\n })\n } else {\n const comparisonRows = comparison?.[field.name] ?? []\n const versionRows = version?.[field.name] ?? []\n count += countChangedFieldsInRows({ comparisonRows, field, locales, versionRows })\n }\n break\n }\n\n // Regular fields without nested fields.\n case 'checkbox':\n case 'code':\n case 'date':\n case 'email':\n case 'join':\n case 'json':\n case 'number':\n case 'point':\n case 'radio':\n case 'relationship':\n case 'richText':\n case 'select':\n case 'text':\n case 'textarea':\n case 'upload': {\n // Fields that have a name and contain data. We can just check if the data has changed.\n if (locales && field.localized) {\n locales.forEach((locale) => {\n if (\n fieldHasChanges(version?.[field.name]?.[locale], comparison?.[field.name]?.[locale])\n ) {\n count++\n }\n })\n } else if (fieldHasChanges(version?.[field.name], comparison?.[field.name])) {\n count++\n }\n break\n }\n // Fields that have nested fields, but don't nest their fields' data.\n case 'collapsible':\n case 'row': {\n count += countChangedFields({\n comparison,\n fields: field.fields,\n locales,\n version,\n })\n\n break\n }\n\n // Fields that have nested fields and nest their fields' data.\n case 'group': {\n if (locales && field.localized) {\n locales.forEach((locale) => {\n count += countChangedFields({\n comparison: comparison?.[field.name]?.[locale],\n fields: field.fields,\n locales,\n version: version?.[field.name]?.[locale],\n })\n })\n } else {\n count += countChangedFields({\n comparison: comparison?.[field.name],\n fields: field.fields,\n locales,\n version: version?.[field.name],\n })\n }\n break\n }\n\n // Each tab in a tabs field has nested fields. The fields data may be\n // nested or not depending on the existence of a name property.\n case 'tabs': {\n field.tabs.forEach((tab) => {\n if ('name' in tab && locales && tab.localized) {\n // Named localized tab\n locales.forEach((locale) => {\n count += countChangedFields({\n comparison: comparison?.[tab.name]?.[locale],\n fields: tab.fields,\n locales,\n version: version?.[tab.name]?.[locale],\n })\n })\n } else if ('name' in tab) {\n // Named tab\n count += countChangedFields({\n comparison: comparison?.[tab.name],\n fields: tab.fields,\n locales,\n version: version?.[tab.name],\n })\n } else {\n // Unnamed tab\n count += countChangedFields({\n comparison,\n fields: tab.fields,\n locales,\n version,\n })\n }\n })\n break\n }\n\n // UI fields don't have data and are not displayed in the version view\n // so we can ignore them.\n case 'ui': {\n break\n }\n\n default: {\n const _exhaustiveCheck: never = fieldType\n throw new Error(`Unexpected field.type in countChangedFields : ${String(fieldType)}`)\n }\n }\n })\n\n return count\n}\n\ntype countChangedFieldsInRowsArgs = {\n comparisonRows: unknown[]\n field: ArrayFieldClient | BlocksFieldClient\n locales: string[] | undefined\n versionRows: unknown[]\n}\n\nexport function countChangedFieldsInRows({\n comparisonRows = [],\n field,\n locales,\n versionRows = [],\n}: countChangedFieldsInRowsArgs) {\n let count = 0\n let i = 0\n\n while (comparisonRows[i] || versionRows[i]) {\n const comparisonRow = comparisonRows?.[i] || {}\n const versionRow = versionRows?.[i] || {}\n\n const { fields: rowFields } = getFieldsForRowComparison({\n baseVersionField: { fields: [] },\n comparisonRow,\n field,\n row: i,\n versionRow,\n })\n\n count += countChangedFields({\n comparison: comparisonRow,\n fields: rowFields,\n locales,\n version: versionRow,\n })\n\n i++\n }\n return count\n}\n"],"mappings":"AAEA,SAASA,eAAe,QAAQ;AAChC,SAASC,yBAAyB,QAAQ;AAS1C;;;;AAIA,OAAO,SAASC,mBAAmB;EAAEC,UAAU;EAAEC,MAAM;EAAEC,OAAO;EAAEC;AAAO,CAAQ;EAC/E,IAAIC,K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