@payloadcms/next 3.20.0-canary.8eef7db → 3.20.0-canary.9f2bca1
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 +1 -2
- 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 +2 -4
- 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 +1 -2
- 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 +1 -2
- 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 +0 -2
- 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 +2 -5
- package/dist/views/LivePreview/index.client.js.map +1 -1
- package/dist/views/Version/Default/index.d.ts.map +1 -1
- package/dist/views/Version/Default/index.js +159 -89
- 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/fields/Iterable/index.d.ts +4 -3
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +63 -100
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.scss +12 -3
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts +6 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js +43 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.scss +14 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts +5 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +17 -18
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts +5 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +28 -56
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts +5 -3
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +42 -146
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts +5 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +37 -71
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts +22 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js +9 -13
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts +22 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/types.js +2 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/types.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/index.d.ts +5 -2
- package/dist/views/Version/RenderFieldsToDiff/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.js +113 -8
- package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/types.d.ts +21 -0
- package/dist/views/Version/RenderFieldsToDiff/types.d.ts.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/types.js +2 -0
- package/dist/views/Version/RenderFieldsToDiff/types.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 +3 -7
- 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 +15 -117
- package/dist/views/Version/index.js.map +1 -1
- package/dist/views/Versions/getLatestVersion.d.ts +1 -4
- package/dist/views/Versions/getLatestVersion.d.ts.map +1 -1
- package/dist/views/Versions/getLatestVersion.js +0 -6
- package/dist/views/Versions/getLatestVersion.js.map +1 -1
- package/package.json +7 -7
- package/dist/views/Version/Default/SelectedLocalesContext.d.ts +0 -8
- package/dist/views/Version/Default/SelectedLocalesContext.d.ts.map +0 -1
- package/dist/views/Version/Default/SelectedLocalesContext.js +0 -10
- package/dist/views/Version/Default/SelectedLocalesContext.js.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.d.ts +0 -27
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.d.ts.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js +0 -76
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.scss +0 -46
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.d.ts +0 -6
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.d.ts.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.js +0 -36
- package/dist/views/Version/RenderFieldsToDiff/RenderVersionFieldsToDiff.js.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.d.ts +0 -30
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.d.ts.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js +0 -300
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.d.ts +0 -3
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.d.ts.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js +0 -64
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.d.ts +0 -4
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.d.ts.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js +0 -69
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.scss +0 -14
- package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.d.ts +0 -3
- package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.d.ts.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.js +0 -17
- package/dist/views/Version/RenderFieldsToDiff/fields/Row/index.js.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.scss +0 -20
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.d.ts +0 -21
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.d.ts.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js +0 -194
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.js.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js +0 -860
- package/dist/views/Version/RenderFieldsToDiff/utilities/countChangedFields.spec.js.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.d.ts +0 -2
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.d.ts.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.js +0 -4
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.js.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.js +0 -46
- package/dist/views/Version/RenderFieldsToDiff/utilities/fieldHasChanges.spec.js.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldPathsModified.d.ts +0 -27
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldPathsModified.d.ts.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldPathsModified.js +0 -30
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldPathsModified.js.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.d.ts +0 -18
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.d.ts.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js +0 -44
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.js.map +0 -1
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js +0 -122
- package/dist/views/Version/RenderFieldsToDiff/utilities/getFieldsForRowComparison.spec.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["getTranslation","React","Label","diffStyles","DiffViewer","baseClass","getOptionsToRender","value","options","hasMany","Array","isArray","map","val","find","option","String","getTranslatedOptions","i18n","label","join","Select","comparison","diffMethod","field","locale","version","placeholder","t","comparisonToRender","versionToRender","_jsxs","className","_jsx"],"sources":["../../../../../../src/views/Version/RenderFieldsToDiff/fields/Select/index.tsx"],"sourcesContent":["'use client'\nimport type { I18nClient } from '@payloadcms/translations'\nimport type { OptionObject, SelectField, SelectFieldClient } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport type { DiffComponentProps } from '../types.js'\n\nimport Label from '../../Label/index.js'\nimport { diffStyles } from '../styles.js'\nimport { DiffViewer } from './DiffViewer/index.js'\nimport './index.scss'\n\nconst baseClass = 'select-diff'\n\nconst getOptionsToRender = (\n value: string,\n options: SelectField['options'],\n hasMany: boolean,\n): (OptionObject | string)[] | OptionObject | string => {\n if (hasMany && Array.isArray(value)) {\n return value.map(\n (val) =>\n options.find((option) => (typeof option === 'string' ? option : option.value) === val) ||\n String(val),\n )\n }\n return (\n options.find((option) => (typeof option === 'string' ? option : option.value) === value) ||\n String(value)\n )\n}\n\nconst getTranslatedOptions = (\n options: (OptionObject | string)[] | OptionObject | string,\n i18n: I18nClient,\n): string => {\n if (Array.isArray(options)) {\n return options\n .map((option) => (typeof option === 'string' ? option : getTranslation(option.label, i18n)))\n .join(', ')\n }\n\n return typeof options === 'string' ? options : getTranslation(options.label, i18n)\n}\n\nconst Select: React.FC<DiffComponentProps<SelectFieldClient>> = ({\n comparison,\n diffMethod,\n field,\n i18n,\n locale,\n version,\n}) => {\n let placeholder = ''\n\n if (version === comparison) {\n placeholder = `[${i18n.t('general:noValue')}]`\n }\n\n const options = 'options' in field && field.options\n\n const comparisonToRender =\n typeof comparison !== 'undefined'\n ? getTranslatedOptions(getOptionsToRender(comparison, options, field.hasMany), i18n)\n : placeholder\n\n const versionToRender =\n typeof version !== 'undefined'\n ? getTranslatedOptions(getOptionsToRender(version, options, field.hasMany), i18n)\n : placeholder\n\n return (\n <div className={baseClass}>\n <Label>\n {locale && <span className={`${baseClass}__locale-label`}>{locale}</span>}\n {'label' in field && getTranslation(field.label || '', i18n)}\n </Label>\n <DiffViewer\n comparisonToRender={comparisonToRender}\n diffMethod={diffMethod}\n diffStyles={diffStyles}\n placeholder={placeholder}\n versionToRender={versionToRender}\n />\n </div>\n )\n}\n\nexport default Select\n"],"mappings":"AAAA;;;AAIA,SAASA,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAIlB,OAAOC,KAAA,MAAW;AAClB,SAASC,UAAU,QAAQ;AAC3B,SAASC,UAAU,QAAQ;AAG3B,MAAMC,SAAA,GAAY;AAElB,MAAMC,kBAAA,GAAqBA,CACzBC,KAAA,EACAC,OAAA,EACAC,OAAA;EAEA,IAAIA,OAAA,IAAWC,KAAA,CAAMC,OAAO,CAACJ,KAAA,GAAQ;IACnC,OAAOA,KAAA,CAAMK,GAAG,CACbC,GAAA,IACCL,OAAA,CAAQM,IAAI,CAAEC,MAAA,IAAW,CAAC,OAAOA,MAAA,KAAW,WAAWA,MAAA,GAASA,MAAA,CAAOR,KAAK,MAAMM,GAAA,KAClFG,MAAA,CAAOH,GAAA;EAEb;EACA,OACEL,OAAA,CAAQM,IAAI,CAAEC,MAAA,IAAW,CAAC,OAAOA,MAAA,KAAW,WAAWA,MAAA,GAASA,MAAA,CAAOR,KAAK,MAAMA,KAAA,KAClFS,MAAA,CAAOT,KAAA;AAEX;AAEA,MAAMU,oBAAA,GAAuBA,CAC3BT,OAAA,EACAU,IAAA;EAEA,IAAIR,KAAA,CAAMC,OAAO,CAACH,OAAA,GAAU;IAC1B,OAAOA,OAAA,CACJI,GAAG,CAAEG,MAAA,IAAY,OAAOA,MAAA,KAAW,WAAWA,MAAA,GAASf,cAAA,CAAee,MAAA,CAAOI,KAAK,EAAED,IAAA,GACpFE,IAAI,CAAC;EACV;EAEA,OAAO,OAAOZ,OAAA,KAAY,WAAWA,OAAA,GAAUR,cAAA,CAAeQ,OAAA,CAAQW,KAAK,EAAED,IAAA;AAC/E;AAEA,MAAMG,MAAA,GAA0DA,CAAC;EAC/DC,UAAU;EACVC,UAAU;EACVC,KAAK;EACLN,IAAI;EACJO,MAAM;EACNC;AAAO,CACR;EACC,IAAIC,WAAA,GAAc;EAElB,IAAID,OAAA,KAAYJ,UAAA,EAAY;IAC1BK,WAAA,GAAc,IAAIT,IAAA,CAAKU,CAAC,CAAC,qBAAqB;EAChD;EAEA,MAAMpB,OAAA,GAAU,aAAagB,KAAA,IAASA,KAAA,CAAMhB,OAAO;EAEnD,MAAMqB,kBAAA,GACJ,OAAOP,UAAA,KAAe,cAClBL,oBAAA,CAAqBX,kBAAA,CAAmBgB,UAAA,EAAYd,OAAA,EAASgB,KAAA,CAAMf,OAAO,GAAGS,IAAA,IAC7ES,WAAA;EAEN,MAAMG,eAAA,GACJ,OAAOJ,OAAA,KAAY,cACfT,oBAAA,CAAqBX,kBAAA,CAAmBoB,OAAA,EAASlB,OAAA,EAASgB,KAAA,CAAMf,OAAO,GAAGS,IAAA,IAC1ES,WAAA;EAEN,oBACEI,KAAA,CAAC;IAAIC,SAAA,EAAW3B,SAAA;4BACd0B,KAAA,CAAC7B,KAAA;iBACEuB,MAAA,iBAAUQ,IAAA,CAAC;QAAKD,SAAA,EAAW,GAAG3B,SAAA,gBAAyB;kBAAGoB;UAC1D,WAAWD,KAAA,IAASxB,cAAA,CAAewB,KAAA,CAAML,KAAK,IAAI,IAAID,IAAA;qBAEzDe,IAAA,CAAC7B,UAAA;MACCyB,kBAAA,EAAoBA,kBAAA;MACpBN,UAAA,EAAYA,UAAA;MACZpB,UAAA,EAAYA,UAAA;MACZwB,WAAA,EAAaA,WAAA;MACbG,eAAA,EAAiBA;;;AAIzB;AAEA,eAAeT,MAAA","ignoreList":[]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import '
|
|
3
|
-
|
|
1
|
+
import type { TabsFieldClient } from 'payload';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { DiffComponentProps } from '../types.js';
|
|
4
|
+
declare const Tabs: React.FC<DiffComponentProps<TabsFieldClient>>;
|
|
5
|
+
export default Tabs;
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/views/Version/RenderFieldsToDiff/fields/Tabs/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/views/Version/RenderFieldsToDiff/fields/Tabs/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAOrD,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,eAAe,CAAC,CA+CvD,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -1,154 +1,50 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { getTranslation } from '@payloadcms/translations';
|
|
6
|
-
import { useTranslation } from '@payloadcms/ui';
|
|
3
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
4
|
import React from 'react';
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { RenderVersionFieldsToDiff } from '../../RenderVersionFieldsToDiff.js';
|
|
5
|
+
import RenderFieldsToDiff from '../../index.js';
|
|
6
|
+
import Nested from '../Nested/index.js';
|
|
11
7
|
const baseClass = 'tabs-diff';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, locale)
|
|
49
|
-
})
|
|
50
|
-
}, [locale, index].join("-"));
|
|
51
|
-
});
|
|
52
|
-
} else {
|
|
53
|
-
if ("name" in tab && tab.name) {
|
|
54
|
-
const namedTabProps = {
|
|
55
|
-
...props,
|
|
56
|
-
comparison: comparisonValue?.[tab.name],
|
|
57
|
-
version: versionValue?.[tab.name]
|
|
58
|
-
};
|
|
59
|
-
return _jsx(Tab, {
|
|
60
|
-
fieldTab,
|
|
61
|
-
...namedTabProps,
|
|
62
|
-
tab
|
|
63
|
-
}, i);
|
|
64
|
-
} else {
|
|
65
|
-
return _jsx(Tab, {
|
|
66
|
-
fieldTab,
|
|
67
|
-
...props,
|
|
68
|
-
tab
|
|
69
|
-
}, i);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
})()
|
|
8
|
+
const Tabs = ({
|
|
9
|
+
comparison,
|
|
10
|
+
diffComponents,
|
|
11
|
+
field,
|
|
12
|
+
fieldPermissions,
|
|
13
|
+
i18n,
|
|
14
|
+
locale,
|
|
15
|
+
locales,
|
|
16
|
+
version
|
|
17
|
+
}) => {
|
|
18
|
+
return /*#__PURE__*/_jsx("div", {
|
|
19
|
+
className: baseClass,
|
|
20
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
21
|
+
className: `${baseClass}__wrap`,
|
|
22
|
+
children: field.tabs.map((tab, i) => {
|
|
23
|
+
if ('name' in tab) {
|
|
24
|
+
return /*#__PURE__*/_jsx(Nested, {
|
|
25
|
+
comparison: comparison?.[tab.name],
|
|
26
|
+
diffComponents: diffComponents,
|
|
27
|
+
field: field,
|
|
28
|
+
fieldPermissions: fieldPermissions,
|
|
29
|
+
fields: tab.fields,
|
|
30
|
+
i18n: i18n,
|
|
31
|
+
locale: locale,
|
|
32
|
+
locales: locales,
|
|
33
|
+
version: version?.[tab.name]
|
|
34
|
+
}, i);
|
|
35
|
+
}
|
|
36
|
+
return /*#__PURE__*/_jsx(RenderFieldsToDiff, {
|
|
37
|
+
comparison: comparison,
|
|
38
|
+
diffComponents: diffComponents,
|
|
39
|
+
fieldPermissions: fieldPermissions,
|
|
40
|
+
fields: tab.fields,
|
|
41
|
+
i18n: i18n,
|
|
42
|
+
locales: locales,
|
|
43
|
+
version: version
|
|
73
44
|
}, i);
|
|
74
|
-
};
|
|
75
|
-
$[7] = comparisonValue;
|
|
76
|
-
$[8] = field.tabs;
|
|
77
|
-
$[9] = props;
|
|
78
|
-
$[10] = selectedLocales;
|
|
79
|
-
$[11] = versionValue;
|
|
80
|
-
$[12] = t1;
|
|
81
|
-
} else {
|
|
82
|
-
t1 = $[12];
|
|
83
|
-
}
|
|
84
|
-
t0 = _jsx("div", {
|
|
85
|
-
className: baseClass,
|
|
86
|
-
children: baseVersionField.tabs.map(t1)
|
|
87
|
-
});
|
|
88
|
-
$[0] = baseVersionField.tabs;
|
|
89
|
-
$[1] = comparisonValue;
|
|
90
|
-
$[2] = field.tabs;
|
|
91
|
-
$[3] = props;
|
|
92
|
-
$[4] = selectedLocales;
|
|
93
|
-
$[5] = versionValue;
|
|
94
|
-
$[6] = t0;
|
|
95
|
-
} else {
|
|
96
|
-
t0 = $[6];
|
|
97
|
-
}
|
|
98
|
-
return t0;
|
|
99
|
-
};
|
|
100
|
-
const Tab = t0 => {
|
|
101
|
-
const $ = _c(11);
|
|
102
|
-
const {
|
|
103
|
-
comparisonValue,
|
|
104
|
-
fieldTab,
|
|
105
|
-
locale,
|
|
106
|
-
tab,
|
|
107
|
-
versionValue
|
|
108
|
-
} = t0;
|
|
109
|
-
const {
|
|
110
|
-
i18n
|
|
111
|
-
} = useTranslation();
|
|
112
|
-
const {
|
|
113
|
-
selectedLocales
|
|
114
|
-
} = useSelectedLocales();
|
|
115
|
-
let t1;
|
|
116
|
-
if ($[0] !== i18n || $[1] !== locale || $[2] !== tab) {
|
|
117
|
-
t1 = "label" in tab && tab.label && typeof tab.label !== "function" && _jsxs("span", {
|
|
118
|
-
children: [locale && _jsx("span", {
|
|
119
|
-
className: `${baseClass}__locale-label`,
|
|
120
|
-
children: locale
|
|
121
|
-
}), getTranslation(tab.label, i18n)]
|
|
122
|
-
});
|
|
123
|
-
$[0] = i18n;
|
|
124
|
-
$[1] = locale;
|
|
125
|
-
$[2] = tab;
|
|
126
|
-
$[3] = t1;
|
|
127
|
-
} else {
|
|
128
|
-
t1 = $[3];
|
|
129
|
-
}
|
|
130
|
-
let t2;
|
|
131
|
-
if ($[4] !== comparisonValue || $[5] !== fieldTab.fields || $[6] !== selectedLocales || $[7] !== t1 || $[8] !== tab.fields || $[9] !== versionValue) {
|
|
132
|
-
t2 = _jsx(DiffCollapser, {
|
|
133
|
-
comparison: comparisonValue,
|
|
134
|
-
fields: fieldTab.fields,
|
|
135
|
-
label: t1,
|
|
136
|
-
locales: selectedLocales,
|
|
137
|
-
version: versionValue,
|
|
138
|
-
children: _jsx(RenderVersionFieldsToDiff, {
|
|
139
|
-
versionFields: tab.fields
|
|
140
45
|
})
|
|
141
|
-
})
|
|
142
|
-
|
|
143
|
-
$[5] = fieldTab.fields;
|
|
144
|
-
$[6] = selectedLocales;
|
|
145
|
-
$[7] = t1;
|
|
146
|
-
$[8] = tab.fields;
|
|
147
|
-
$[9] = versionValue;
|
|
148
|
-
$[10] = t2;
|
|
149
|
-
} else {
|
|
150
|
-
t2 = $[10];
|
|
151
|
-
}
|
|
152
|
-
return t2;
|
|
46
|
+
})
|
|
47
|
+
});
|
|
153
48
|
};
|
|
49
|
+
export default Tabs;
|
|
154
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["React","RenderFieldsToDiff","Nested","baseClass","Tabs","comparison","diffComponents","field","fieldPermissions","i18n","locale","locales","version","_jsx","className","tabs","map","tab","i","name","fields"],"sources":["../../../../../../src/views/Version/RenderFieldsToDiff/fields/Tabs/index.tsx"],"sourcesContent":["'use client'\nimport type { TabsFieldClient } from 'payload'\n\nimport React from 'react'\n\nimport type { DiffComponentProps } from '../types.js'\n\nimport RenderFieldsToDiff from '../../index.js'\nimport Nested from '../Nested/index.js'\n\nconst baseClass = 'tabs-diff'\n\nconst Tabs: React.FC<DiffComponentProps<TabsFieldClient>> = ({\n comparison,\n diffComponents,\n field,\n fieldPermissions,\n i18n,\n locale,\n locales,\n version,\n}) => {\n return (\n <div className={baseClass}>\n <div className={`${baseClass}__wrap`}>\n {field.tabs.map((tab, i) => {\n if ('name' in tab) {\n return (\n <Nested\n comparison={comparison?.[tab.name]}\n diffComponents={diffComponents}\n field={field}\n fieldPermissions={fieldPermissions}\n fields={tab.fields}\n i18n={i18n}\n key={i}\n locale={locale}\n locales={locales}\n version={version?.[tab.name]}\n />\n )\n }\n\n return (\n <RenderFieldsToDiff\n comparison={comparison}\n diffComponents={diffComponents}\n fieldPermissions={fieldPermissions}\n fields={tab.fields}\n i18n={i18n}\n key={i}\n locales={locales}\n version={version}\n />\n )\n })}\n </div>\n </div>\n )\n}\n\nexport default Tabs\n"],"mappings":"AAAA;;;AAGA,OAAOA,KAAA,MAAW;AAIlB,OAAOC,kBAAA,MAAwB;AAC/B,OAAOC,MAAA,MAAY;AAEnB,MAAMC,SAAA,GAAY;AAElB,MAAMC,IAAA,GAAsDA,CAAC;EAC3DC,UAAU;EACVC,cAAc;EACdC,KAAK;EACLC,gBAAgB;EAChBC,IAAI;EACJC,MAAM;EACNC,OAAO;EACPC;AAAO,CACR;EACC,oBACEC,IAAA,CAAC;IAAIC,SAAA,EAAWX,SAAA;cACd,aAAAU,IAAA,CAAC;MAAIC,SAAA,EAAW,GAAGX,SAAA,QAAiB;gBACjCI,KAAA,CAAMQ,IAAI,CAACC,GAAG,CAAC,CAACC,GAAA,EAAKC,CAAA;QACpB,IAAI,UAAUD,GAAA,EAAK;UACjB,oBACEJ,IAAA,CAACX,MAAA;YACCG,UAAA,EAAYA,UAAA,GAAaY,GAAA,CAAIE,IAAI,CAAC;YAClCb,cAAA,EAAgBA,cAAA;YAChBC,KAAA,EAAOA,KAAA;YACPC,gBAAA,EAAkBA,gBAAA;YAClBY,MAAA,EAAQH,GAAA,CAAIG,MAAM;YAClBX,IAAA,EAAMA,IAAA;YAENC,MAAA,EAAQA,MAAA;YACRC,OAAA,EAASA,OAAA;YACTC,OAAA,EAASA,OAAA,GAAUK,GAAA,CAAIE,IAAI;aAHtBD,CAAA;QAMX;QAEA,oBACEL,IAAA,CAACZ,kBAAA;UACCI,UAAA,EAAYA,UAAA;UACZC,cAAA,EAAgBA,cAAA;UAChBE,gBAAA,EAAkBA,gBAAA;UAClBY,MAAA,EAAQH,GAAA,CAAIG,MAAM;UAClBX,IAAA,EAAMA,IAAA;UAENE,OAAA,EAASA,OAAA;UACTC,OAAA,EAASA;WAFJM,CAAA;MAKX;;;AAIR;AAEA,eAAed,IAAA","ignoreList":[]}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TextFieldClient } from 'payload';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { DiffComponentProps } from '../types.js';
|
|
2
4
|
import './index.scss';
|
|
3
|
-
|
|
5
|
+
declare const Text: React.FC<DiffComponentProps<TextFieldClient>>;
|
|
6
|
+
export default Text;
|
|
4
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/views/Version/RenderFieldsToDiff/fields/Text/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/views/Version/RenderFieldsToDiff/fields/Text/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAG9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAKrD,OAAO,cAAc,CAAA;AAIrB,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,eAAe,CAAC,CA4CvD,CAAA;AAED,eAAe,IAAI,CAAA"}
|
|
@@ -1,84 +1,50 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { c as _c } from "react/compiler-runtime";
|
|
4
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
4
|
import { getTranslation } from '@payloadcms/translations';
|
|
6
|
-
import { useTranslation } from '@payloadcms/ui';
|
|
7
5
|
import React from 'react';
|
|
8
6
|
import Label from '../../Label/index.js';
|
|
9
7
|
import { diffStyles } from '../styles.js';
|
|
10
8
|
import { DiffViewer } from './DiffViewer/index.js';
|
|
11
9
|
const baseClass = 'text-diff';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
let placeholder = "";
|
|
25
|
-
if (versionValue == comparisonValue) {
|
|
26
|
-
placeholder = `[${i18n.t("general:noValue")}]`;
|
|
10
|
+
const Text = ({
|
|
11
|
+
comparison,
|
|
12
|
+
diffMethod,
|
|
13
|
+
field,
|
|
14
|
+
i18n,
|
|
15
|
+
isRichText = false,
|
|
16
|
+
locale,
|
|
17
|
+
version
|
|
18
|
+
}) => {
|
|
19
|
+
let placeholder = '';
|
|
20
|
+
if (version === comparison) {
|
|
21
|
+
placeholder = `[${i18n.t('general:noValue')}]`;
|
|
27
22
|
}
|
|
28
|
-
let
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
let versionToRender = version;
|
|
24
|
+
let comparisonToRender = comparison;
|
|
25
|
+
if (isRichText) {
|
|
26
|
+
if (typeof version === 'object') {
|
|
27
|
+
versionToRender = JSON.stringify(version, null, 2);
|
|
28
|
+
}
|
|
29
|
+
if (typeof comparison === 'object') {
|
|
30
|
+
comparisonToRender = JSON.stringify(comparison, null, 2);
|
|
31
|
+
}
|
|
35
32
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
});
|
|
52
|
-
$[4] = locale;
|
|
53
|
-
$[5] = t3;
|
|
54
|
-
} else {
|
|
55
|
-
t3 = $[5];
|
|
56
|
-
}
|
|
57
|
-
let t4;
|
|
58
|
-
if ($[6] !== comparisonToRender || $[7] !== diffMethod || $[8] !== field || $[9] !== i18n || $[10] !== placeholder || $[11] !== t3 || $[12] !== versionToRender) {
|
|
59
|
-
t4 = _jsxs("div", {
|
|
60
|
-
className: baseClass,
|
|
61
|
-
children: [_jsxs(Label, {
|
|
62
|
-
children: [t3, "label" in field && typeof field.label !== "function" && getTranslation(field.label || "", i18n)]
|
|
63
|
-
}), _jsx(DiffViewer, {
|
|
64
|
-
comparisonToRender,
|
|
65
|
-
diffMethod,
|
|
66
|
-
diffStyles,
|
|
67
|
-
placeholder,
|
|
68
|
-
versionToRender
|
|
69
|
-
})]
|
|
70
|
-
});
|
|
71
|
-
$[6] = comparisonToRender;
|
|
72
|
-
$[7] = diffMethod;
|
|
73
|
-
$[8] = field;
|
|
74
|
-
$[9] = i18n;
|
|
75
|
-
$[10] = placeholder;
|
|
76
|
-
$[11] = t3;
|
|
77
|
-
$[12] = versionToRender;
|
|
78
|
-
$[13] = t4;
|
|
79
|
-
} else {
|
|
80
|
-
t4 = $[13];
|
|
81
|
-
}
|
|
82
|
-
return t4;
|
|
33
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
34
|
+
className: baseClass,
|
|
35
|
+
children: [/*#__PURE__*/_jsxs(Label, {
|
|
36
|
+
children: [locale && /*#__PURE__*/_jsx("span", {
|
|
37
|
+
className: `${baseClass}__locale-label`,
|
|
38
|
+
children: locale
|
|
39
|
+
}), 'label' in field && typeof field.label !== 'function' && getTranslation(field.label || '', i18n)]
|
|
40
|
+
}), /*#__PURE__*/_jsx(DiffViewer, {
|
|
41
|
+
comparisonToRender: comparisonToRender,
|
|
42
|
+
diffMethod: diffMethod,
|
|
43
|
+
diffStyles: diffStyles,
|
|
44
|
+
placeholder: placeholder,
|
|
45
|
+
versionToRender: versionToRender
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
83
48
|
};
|
|
49
|
+
export default Text;
|
|
84
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["getTranslation","React","Label","diffStyles","DiffViewer","baseClass","Text","comparison","diffMethod","field","i18n","isRichText","locale","version","placeholder","t","versionToRender","comparisonToRender","JSON","stringify","_jsxs","className","_jsx","label"],"sources":["../../../../../../src/views/Version/RenderFieldsToDiff/fields/Text/index.tsx"],"sourcesContent":["'use client'\nimport type { TextFieldClient } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport React from 'react'\n\nimport type { DiffComponentProps } from '../types.js'\n\nimport Label from '../../Label/index.js'\nimport { diffStyles } from '../styles.js'\nimport { DiffViewer } from './DiffViewer/index.js'\nimport './index.scss'\n\nconst baseClass = 'text-diff'\n\nconst Text: React.FC<DiffComponentProps<TextFieldClient>> = ({\n comparison,\n diffMethod,\n field,\n i18n,\n isRichText = false,\n locale,\n version,\n}) => {\n let placeholder = ''\n\n if (version === comparison) {\n placeholder = `[${i18n.t('general:noValue')}]`\n }\n\n let versionToRender = version\n let comparisonToRender = comparison\n\n if (isRichText) {\n if (typeof version === 'object') {\n versionToRender = JSON.stringify(version, null, 2)\n }\n if (typeof comparison === 'object') {\n comparisonToRender = JSON.stringify(comparison, null, 2)\n }\n }\n\n return (\n <div className={baseClass}>\n <Label>\n {locale && <span className={`${baseClass}__locale-label`}>{locale}</span>}\n {'label' in field &&\n typeof field.label !== 'function' &&\n getTranslation(field.label || '', i18n)}\n </Label>\n <DiffViewer\n comparisonToRender={comparisonToRender}\n diffMethod={diffMethod}\n diffStyles={diffStyles}\n placeholder={placeholder}\n versionToRender={versionToRender}\n />\n </div>\n )\n}\n\nexport default Text\n"],"mappings":"AAAA;;;AAGA,SAASA,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAIlB,OAAOC,KAAA,MAAW;AAClB,SAASC,UAAU,QAAQ;AAC3B,SAASC,UAAU,QAAQ;AAG3B,MAAMC,SAAA,GAAY;AAElB,MAAMC,IAAA,GAAsDA,CAAC;EAC3DC,UAAU;EACVC,UAAU;EACVC,KAAK;EACLC,IAAI;EACJC,UAAA,GAAa,KAAK;EAClBC,MAAM;EACNC;AAAO,CACR;EACC,IAAIC,WAAA,GAAc;EAElB,IAAID,OAAA,KAAYN,UAAA,EAAY;IAC1BO,WAAA,GAAc,IAAIJ,IAAA,CAAKK,CAAC,CAAC,qBAAqB;EAChD;EAEA,IAAIC,eAAA,GAAkBH,OAAA;EACtB,IAAII,kBAAA,GAAqBV,UAAA;EAEzB,IAAII,UAAA,EAAY;IACd,IAAI,OAAOE,OAAA,KAAY,UAAU;MAC/BG,eAAA,GAAkBE,IAAA,CAAKC,SAAS,CAACN,OAAA,EAAS,MAAM;IAClD;IACA,IAAI,OAAON,UAAA,KAAe,UAAU;MAClCU,kBAAA,GAAqBC,IAAA,CAAKC,SAAS,CAACZ,UAAA,EAAY,MAAM;IACxD;EACF;EAEA,oBACEa,KAAA,CAAC;IAAIC,SAAA,EAAWhB,SAAA;4BACde,KAAA,CAAClB,KAAA;iBACEU,MAAA,iBAAUU,IAAA,CAAC;QAAKD,SAAA,EAAW,GAAGhB,SAAA,gBAAyB;kBAAGO;UAC1D,WAAWH,KAAA,IACV,OAAOA,KAAA,CAAMc,KAAK,KAAK,cACvBvB,cAAA,CAAeS,KAAA,CAAMc,KAAK,IAAI,IAAIb,IAAA;qBAEtCY,IAAA,CAAClB,UAAA;MACCa,kBAAA,EAAoBA,kBAAA;MACpBT,UAAA,EAAYA,UAAA;MACZL,UAAA,EAAYA,UAAA;MACZW,WAAA,EAAaA,WAAA;MACbE,eAAA,EAAiBA;;;AAIzB;AAEA,eAAeV,IAAA","ignoreList":[]}
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export declare const diffComponents: {
|
|
2
|
+
array: import("react").FC<import("./types.js").DiffComponentProps>;
|
|
3
|
+
blocks: import("react").FC<import("./types.js").DiffComponentProps>;
|
|
4
|
+
checkbox: import("react").FC<import("./types.js").DiffComponentProps<import("payload").TextFieldClient>>;
|
|
5
|
+
code: import("react").FC<import("./types.js").DiffComponentProps<import("payload").TextFieldClient>>;
|
|
6
|
+
collapsible: import("react").FC<import("./types.js").DiffComponentProps>;
|
|
7
|
+
date: import("react").FC<import("./types.js").DiffComponentProps<import("payload").TextFieldClient>>;
|
|
8
|
+
email: import("react").FC<import("./types.js").DiffComponentProps<import("payload").TextFieldClient>>;
|
|
9
|
+
group: import("react").FC<import("./types.js").DiffComponentProps>;
|
|
10
|
+
json: import("react").FC<import("./types.js").DiffComponentProps<import("payload").TextFieldClient>>;
|
|
11
|
+
number: import("react").FC<import("./types.js").DiffComponentProps<import("payload").TextFieldClient>>;
|
|
12
|
+
point: import("react").FC<import("./types.js").DiffComponentProps<import("payload").TextFieldClient>>;
|
|
13
|
+
radio: import("react").FC<import("./types.js").DiffComponentProps<import("payload").SelectFieldClient>>;
|
|
14
|
+
relationship: import("react").FC<import("./types.js").DiffComponentProps<import("payload").RelationshipFieldClient>>;
|
|
15
|
+
richText: import("react").FC<import("./types.js").DiffComponentProps<import("payload").TextFieldClient>>;
|
|
16
|
+
row: import("react").FC<import("./types.js").DiffComponentProps>;
|
|
17
|
+
select: import("react").FC<import("./types.js").DiffComponentProps<import("payload").SelectFieldClient>>;
|
|
18
|
+
tabs: import("react").FC<import("./types.js").DiffComponentProps<import("payload").TabsFieldClient>>;
|
|
19
|
+
text: import("react").FC<import("./types.js").DiffComponentProps<import("payload").TextFieldClient>>;
|
|
20
|
+
textarea: import("react").FC<import("./types.js").DiffComponentProps<import("payload").TextFieldClient>>;
|
|
21
|
+
upload: import("react").FC<import("./types.js").DiffComponentProps<import("payload").RelationshipFieldClient>>;
|
|
22
|
+
};
|
|
3
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/views/Version/RenderFieldsToDiff/fields/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/views/Version/RenderFieldsToDiff/fields/index.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;CAqB1B,CAAA"}
|
|
@@ -1,33 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { Tabs } from './Tabs/index.js';
|
|
8
|
-
import { Text } from './Text/index.js';
|
|
1
|
+
import Iterable from './Iterable/index.js';
|
|
2
|
+
import Nested from './Nested/index.js';
|
|
3
|
+
import Relationship from './Relationship/index.js';
|
|
4
|
+
import Select from './Select/index.js';
|
|
5
|
+
import Tabs from './Tabs/index.js';
|
|
6
|
+
import Text from './Text/index.js';
|
|
9
7
|
export const diffComponents = {
|
|
10
8
|
array: Iterable,
|
|
11
9
|
blocks: Iterable,
|
|
12
10
|
checkbox: Text,
|
|
13
11
|
code: Text,
|
|
14
|
-
collapsible:
|
|
12
|
+
collapsible: Nested,
|
|
15
13
|
date: Text,
|
|
16
14
|
email: Text,
|
|
17
|
-
group:
|
|
18
|
-
join: null,
|
|
15
|
+
group: Nested,
|
|
19
16
|
json: Text,
|
|
20
17
|
number: Text,
|
|
21
18
|
point: Text,
|
|
22
19
|
radio: Select,
|
|
23
20
|
relationship: Relationship,
|
|
24
21
|
richText: Text,
|
|
25
|
-
row:
|
|
22
|
+
row: Nested,
|
|
26
23
|
select: Select,
|
|
27
24
|
tabs: Tabs,
|
|
28
25
|
text: Text,
|
|
29
26
|
textarea: Text,
|
|
30
|
-
ui: null,
|
|
31
27
|
upload: Relationship
|
|
32
28
|
};
|
|
33
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["
|
|
1
|
+
{"version":3,"file":"index.js","names":["Iterable","Nested","Relationship","Select","Tabs","Text","diffComponents","array","blocks","checkbox","code","collapsible","date","email","group","json","number","point","radio","relationship","richText","row","select","tabs","text","textarea","upload"],"sources":["../../../../../src/views/Version/RenderFieldsToDiff/fields/index.tsx"],"sourcesContent":["import Iterable from './Iterable/index.js'\nimport Nested from './Nested/index.js'\nimport Relationship from './Relationship/index.js'\nimport Select from './Select/index.js'\nimport Tabs from './Tabs/index.js'\nimport Text from './Text/index.js'\n\nexport const diffComponents = {\n array: Iterable,\n blocks: Iterable,\n checkbox: Text,\n code: Text,\n collapsible: Nested,\n date: Text,\n email: Text,\n group: Nested,\n json: Text,\n number: Text,\n point: Text,\n radio: Select,\n relationship: Relationship,\n richText: Text,\n row: Nested,\n select: Select,\n tabs: Tabs,\n text: Text,\n textarea: Text,\n upload: Relationship,\n}\n"],"mappings":"AAAA,OAAOA,QAAA,MAAc;AACrB,OAAOC,MAAA,MAAY;AACnB,OAAOC,YAAA,MAAkB;AACzB,OAAOC,MAAA,MAAY;AACnB,OAAOC,IAAA,MAAU;AACjB,OAAOC,IAAA,MAAU;AAEjB,OAAO,MAAMC,cAAA,GAAiB;EAC5BC,KAAA,EAAOP,QAAA;EACPQ,MAAA,EAAQR,QAAA;EACRS,QAAA,EAAUJ,IAAA;EACVK,IAAA,EAAML,IAAA;EACNM,WAAA,EAAaV,MAAA;EACbW,IAAA,EAAMP,IAAA;EACNQ,KAAA,EAAOR,IAAA;EACPS,KAAA,EAAOb,MAAA;EACPc,IAAA,EAAMV,IAAA;EACNW,MAAA,EAAQX,IAAA;EACRY,KAAA,EAAOZ,IAAA;EACPa,KAAA,EAAOf,MAAA;EACPgB,YAAA,EAAcjB,YAAA;EACdkB,QAAA,EAAUf,IAAA;EACVgB,GAAA,EAAKpB,MAAA;EACLqB,MAAA,EAAQnB,MAAA;EACRoB,IAAA,EAAMnB,IAAA;EACNoB,IAAA,EAAMnB,IAAA;EACNoB,QAAA,EAAUpB,IAAA;EACVqB,MAAA,EAAQxB;AACV","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { I18nClient } from '@payloadcms/translations';
|
|
2
|
+
import type { ClientField, SanitizedFieldPermissions } from 'payload';
|
|
3
|
+
import type React from 'react';
|
|
4
|
+
import type { DiffMethod } from 'react-diff-viewer-continued';
|
|
5
|
+
export type DiffComponents = Record<string, React.FC<DiffComponentProps>>;
|
|
6
|
+
export type DiffComponentProps<TField extends ClientField = ClientField> = {
|
|
7
|
+
readonly comparison: any;
|
|
8
|
+
readonly diffComponents: DiffComponents;
|
|
9
|
+
readonly diffMethod?: DiffMethod;
|
|
10
|
+
readonly disableGutter?: boolean;
|
|
11
|
+
readonly field: TField;
|
|
12
|
+
readonly fieldPermissions?: {
|
|
13
|
+
[key: string]: SanitizedFieldPermissions;
|
|
14
|
+
} | true;
|
|
15
|
+
readonly fields: ClientField[];
|
|
16
|
+
readonly i18n: I18nClient;
|
|
17
|
+
readonly isRichText?: boolean;
|
|
18
|
+
readonly locale?: string;
|
|
19
|
+
readonly locales?: string[];
|
|
20
|
+
readonly version: any;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/views/Version/RenderFieldsToDiff/fields/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAA;AACrE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAE7D,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAA;AAEzE,MAAM,MAAM,kBAAkB,CAAC,MAAM,SAAS,WAAW,GAAG,WAAW,IAAI;IACzE,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAA;IACxB,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAA;IACvC,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAA;IAChC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,gBAAgB,CAAC,EACtB;QACE,CAAC,GAAG,EAAE,MAAM,GAAG,yBAAyB,CAAA;KACzC,GACD,IAAI,CAAA;IACR,QAAQ,CAAC,MAAM,EAAE,WAAW,EAAE,CAAA;IAC9B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAA;CACtB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../../../../src/views/Version/RenderFieldsToDiff/fields/types.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { ClientField, SanitizedFieldPermissions } from 'payload'\nimport type React from 'react'\nimport type { DiffMethod } from 'react-diff-viewer-continued'\n\nexport type DiffComponents = Record<string, React.FC<DiffComponentProps>>\n\nexport type DiffComponentProps<TField extends ClientField = ClientField> = {\n readonly comparison: any\n readonly diffComponents: DiffComponents\n readonly diffMethod?: DiffMethod\n readonly disableGutter?: boolean\n readonly field: TField\n readonly fieldPermissions?:\n | {\n [key: string]: SanitizedFieldPermissions\n }\n | true\n readonly fields: ClientField[]\n readonly i18n: I18nClient\n readonly isRichText?: boolean\n readonly locale?: string\n readonly locales?: string[]\n readonly version: any\n}\n"],"mappings":"AAOA","ignoreList":[]}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Props } from './types.js';
|
|
3
|
+
import './index.scss';
|
|
4
|
+
declare const RenderFieldsToDiff: React.FC<Props>;
|
|
5
|
+
export default RenderFieldsToDiff;
|
|
3
6
|
//# 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":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAkB,KAAK,EAAE,MAAM,YAAY,CAAA;AAIvD,OAAO,cAAc,CAAA;AAIrB,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA0IvC,CAAA;AAED,eAAe,kBAAkB,CAAA"}
|