@payloadcms/next 3.55.0-internal.f8c92b5 → 3.56.0-internal.299316b
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/auth/refresh.js +8 -8
- package/dist/auth/refresh.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js +41 -19
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -1
- package/dist/elements/Nav/index.client.js +48 -28
- package/dist/elements/Nav/index.client.js.map +1 -1
- package/dist/layouts/Root/index.d.ts.map +1 -1
- package/dist/layouts/Root/index.js +2 -1
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/prod/styles.css +1 -1
- package/dist/utilities/getRouteWithoutAdmin.d.ts +5 -0
- package/dist/utilities/getRouteWithoutAdmin.d.ts.map +1 -0
- package/dist/utilities/getRouteWithoutAdmin.js +7 -0
- package/dist/utilities/getRouteWithoutAdmin.js.map +1 -0
- package/dist/utilities/getVisibleEntities.d.ts +5 -0
- package/dist/utilities/getVisibleEntities.d.ts.map +1 -0
- package/dist/utilities/getVisibleEntities.js +26 -0
- package/dist/utilities/getVisibleEntities.js.map +1 -0
- package/dist/utilities/handleAuthRedirect.d.ts.map +1 -0
- package/dist/utilities/handleAuthRedirect.js.map +1 -0
- package/dist/utilities/handleServerFunctions.d.ts.map +1 -1
- package/dist/utilities/handleServerFunctions.js +2 -7
- package/dist/utilities/handleServerFunctions.js.map +1 -1
- package/dist/utilities/isCustomAdminView.d.ts.map +1 -0
- package/dist/utilities/{initPage/isCustomAdminView.js → isCustomAdminView.js} +1 -1
- package/dist/utilities/isCustomAdminView.js.map +1 -0
- package/dist/utilities/isPublicAdminRoute.d.ts +7 -0
- package/dist/utilities/isPublicAdminRoute.d.ts.map +1 -0
- package/dist/utilities/{initPage/shared.js → isPublicAdminRoute.js} +2 -13
- package/dist/utilities/isPublicAdminRoute.js.map +1 -0
- package/dist/views/CollectionFolders/buildView.d.ts.map +1 -1
- package/dist/views/CollectionFolders/buildView.js +1 -1
- package/dist/views/CollectionFolders/buildView.js.map +1 -1
- package/dist/views/CreateFirstUser/index.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.js +16 -11
- package/dist/views/CreateFirstUser/index.js.map +1 -1
- package/dist/views/Document/handleServerFunction.d.ts.map +1 -1
- package/dist/views/Document/handleServerFunction.js +2 -1
- package/dist/views/Document/handleServerFunction.js.map +1 -1
- package/dist/views/List/handleGroupBy.d.ts +4 -2
- package/dist/views/List/handleGroupBy.d.ts.map +1 -1
- package/dist/views/List/handleGroupBy.js +3 -1
- package/dist/views/List/handleGroupBy.js.map +1 -1
- package/dist/views/List/handleServerFunction.d.ts.map +1 -1
- package/dist/views/List/handleServerFunction.js +2 -1
- package/dist/views/List/handleServerFunction.js.map +1 -1
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/index.js +17 -4
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/List/transformColumnsToSelect.d.ts +3 -0
- package/dist/views/List/transformColumnsToSelect.d.ts.map +1 -0
- package/dist/views/List/transformColumnsToSelect.js +7 -0
- package/dist/views/List/transformColumnsToSelect.js.map +1 -0
- package/dist/views/Logout/LogoutClient.js +31 -29
- package/dist/views/Logout/LogoutClient.js.map +1 -1
- package/dist/views/NotFound/index.d.ts +0 -8
- package/dist/views/NotFound/index.d.ts.map +1 -1
- package/dist/views/NotFound/index.js +40 -18
- package/dist/views/NotFound/index.js.map +1 -1
- package/dist/views/Root/SyncClientConfig.d.ts +11 -0
- package/dist/views/Root/SyncClientConfig.d.ts.map +1 -0
- package/dist/views/Root/SyncClientConfig.js +38 -0
- package/dist/views/Root/SyncClientConfig.js.map +1 -0
- package/dist/views/Root/attachViewActions.d.ts +4 -5
- package/dist/views/Root/attachViewActions.d.ts.map +1 -1
- package/dist/views/Root/attachViewActions.js +5 -7
- package/dist/views/Root/attachViewActions.js.map +1 -1
- package/dist/views/Root/getRouteData.d.ts +33 -16
- package/dist/views/Root/getRouteData.d.ts.map +1 -1
- package/dist/views/Root/getRouteData.js +122 -103
- package/dist/views/Root/getRouteData.js.map +1 -1
- package/dist/views/Root/index.d.ts +1 -1
- package/dist/views/Root/index.d.ts.map +1 -1
- package/dist/views/Root/index.js +173 -78
- package/dist/views/Root/index.js.map +1 -1
- package/dist/views/Version/Default/SetStepNav.d.ts +0 -1
- package/dist/views/Version/Default/SetStepNav.d.ts.map +1 -1
- package/dist/views/Version/Default/SetStepNav.js +28 -38
- package/dist/views/Version/Default/SetStepNav.js.map +1 -1
- package/dist/views/Version/Default/index.d.ts.map +1 -1
- package/dist/views/Version/Default/index.js +2 -4
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/Default/types.d.ts +0 -1
- 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.js +28 -12
- package/dist/views/Version/RenderFieldsToDiff/DiffCollapser/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.d.ts +3 -5
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js +59 -37
- package/dist/views/Version/RenderFieldsToDiff/buildVersionFields.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js +27 -17
- package/dist/views/Version/RenderFieldsToDiff/fields/Collapsible/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js +31 -21
- package/dist/views/Version/RenderFieldsToDiff/fields/Group/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +33 -23
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.d.ts +2 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.js +7 -4
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/generateLabelFromValue.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts +5 -5
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +30 -21
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.d.ts +6 -4
- package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.js +15 -6
- package/dist/views/Version/RenderFieldsToDiff/fields/Upload/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/VersionDrawer/CreatedAtCell.js +50 -16
- package/dist/views/Version/SelectComparison/VersionDrawer/CreatedAtCell.js.map +1 -1
- package/dist/views/Version/SelectComparison/VersionDrawer/index.js +12 -8
- package/dist/views/Version/SelectComparison/VersionDrawer/index.js.map +1 -1
- package/dist/views/Version/index.d.ts.map +1 -1
- package/dist/views/Version/index.js +4 -6
- package/dist/views/Version/index.js.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.d.ts +1 -0
- package/dist/views/Versions/cells/AutosaveCell/index.d.ts.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.js +23 -14
- package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.js +53 -27
- package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
- package/package.json +9 -9
- package/dist/utilities/initPage/handleAdminPage.d.ts +0 -18
- package/dist/utilities/initPage/handleAdminPage.d.ts.map +0 -1
- package/dist/utilities/initPage/handleAdminPage.js +0 -57
- package/dist/utilities/initPage/handleAdminPage.js.map +0 -1
- package/dist/utilities/initPage/handleAuthRedirect.d.ts.map +0 -1
- package/dist/utilities/initPage/handleAuthRedirect.js.map +0 -1
- package/dist/utilities/initPage/index.d.ts +0 -4
- package/dist/utilities/initPage/index.d.ts.map +0 -1
- package/dist/utilities/initPage/index.js +0 -127
- package/dist/utilities/initPage/index.js.map +0 -1
- package/dist/utilities/initPage/isCustomAdminView.d.ts.map +0 -1
- package/dist/utilities/initPage/isCustomAdminView.js.map +0 -1
- package/dist/utilities/initPage/shared.d.ts +0 -16
- package/dist/utilities/initPage/shared.d.ts.map +0 -1
- package/dist/utilities/initPage/shared.js.map +0 -1
- package/dist/utilities/initPage/types.d.ts +0 -44
- package/dist/utilities/initPage/types.d.ts.map +0 -1
- package/dist/utilities/initPage/types.js +0 -2
- package/dist/utilities/initPage/types.js.map +0 -1
- /package/dist/utilities/{initPage/handleAuthRedirect.d.ts → handleAuthRedirect.d.ts} +0 -0
- /package/dist/utilities/{initPage/handleAuthRedirect.js → handleAuthRedirect.js} +0 -0
- /package/dist/utilities/{initPage/isCustomAdminView.d.ts → isCustomAdminView.d.ts} +0 -0
|
@@ -7,7 +7,7 @@ import React from 'react';
|
|
|
7
7
|
import { VersionPillLabel } from '../../../Version/VersionPillLabel/VersionPillLabel.js';
|
|
8
8
|
const baseClass = 'autosave-cell';
|
|
9
9
|
export const AutosaveCell = t0 => {
|
|
10
|
-
const $ = _c(
|
|
10
|
+
const $ = _c(8);
|
|
11
11
|
const {
|
|
12
12
|
currentlyPublishedVersion,
|
|
13
13
|
latestDraftVersion,
|
|
@@ -17,13 +17,22 @@ export const AutosaveCell = t0 => {
|
|
|
17
17
|
t
|
|
18
18
|
} = useTranslation();
|
|
19
19
|
let t1;
|
|
20
|
-
if ($[0] !==
|
|
21
|
-
t1 =
|
|
20
|
+
if ($[0] !== rowData?.autosave || $[1] !== t) {
|
|
21
|
+
t1 = rowData?.autosave && _jsx(Pill, {
|
|
22
|
+
size: "small",
|
|
23
|
+
children: t("version:autosave")
|
|
24
|
+
});
|
|
25
|
+
$[0] = rowData?.autosave;
|
|
26
|
+
$[1] = t;
|
|
27
|
+
$[2] = t1;
|
|
28
|
+
} else {
|
|
29
|
+
t1 = $[2];
|
|
30
|
+
}
|
|
31
|
+
let t2;
|
|
32
|
+
if ($[3] !== currentlyPublishedVersion || $[4] !== latestDraftVersion || $[5] !== rowData || $[6] !== t1) {
|
|
33
|
+
t2 = _jsxs("div", {
|
|
22
34
|
className: `${baseClass}__items`,
|
|
23
|
-
children: [
|
|
24
|
-
size: "small",
|
|
25
|
-
children: t("version:autosave")
|
|
26
|
-
}), _jsx(VersionPillLabel, {
|
|
35
|
+
children: [t1, _jsx(VersionPillLabel, {
|
|
27
36
|
currentlyPublishedVersion,
|
|
28
37
|
disableDate: true,
|
|
29
38
|
doc: rowData,
|
|
@@ -32,14 +41,14 @@ export const AutosaveCell = t0 => {
|
|
|
32
41
|
latestDraftVersion
|
|
33
42
|
})]
|
|
34
43
|
});
|
|
35
|
-
$[
|
|
36
|
-
$[
|
|
37
|
-
$[
|
|
38
|
-
$[
|
|
39
|
-
$[
|
|
44
|
+
$[3] = currentlyPublishedVersion;
|
|
45
|
+
$[4] = latestDraftVersion;
|
|
46
|
+
$[5] = rowData;
|
|
47
|
+
$[6] = t1;
|
|
48
|
+
$[7] = t2;
|
|
40
49
|
} else {
|
|
41
|
-
|
|
50
|
+
t2 = $[7];
|
|
42
51
|
}
|
|
43
|
-
return
|
|
52
|
+
return t2;
|
|
44
53
|
};
|
|
45
54
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","Pill","useTranslation","React","VersionPillLabel","baseClass","AutosaveCell","t0","$","currentlyPublishedVersion","latestDraftVersion","rowData","t","t1","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","Pill","useTranslation","React","VersionPillLabel","baseClass","AutosaveCell","t0","$","currentlyPublishedVersion","latestDraftVersion","rowData","t","t1","autosave","_jsx","size","children","t2","_jsxs","className","disableDate","doc","labelFirst","labelStyle"],"sources":["../../../../../src/views/Versions/cells/AutosaveCell/index.tsx"],"sourcesContent":["'use client'\nimport { Pill, useTranslation } from '@payloadcms/ui'\nimport React from 'react'\n\nimport './index.scss'\nimport { VersionPillLabel } from '../../../Version/VersionPillLabel/VersionPillLabel.js'\n\nconst baseClass = 'autosave-cell'\n\ntype AutosaveCellProps = {\n currentlyPublishedVersion?: {\n id: number | string\n updatedAt: string\n }\n latestDraftVersion?: {\n id: number | string\n updatedAt: string\n }\n rowData: {\n autosave?: boolean\n id: number | string\n localeStatus?: Record<string, 'draft' | 'published'>\n publishedLocale?: string\n version: {\n _status: string\n }\n }\n}\n\nexport const AutosaveCell: React.FC<AutosaveCellProps> = ({\n currentlyPublishedVersion,\n latestDraftVersion,\n rowData,\n}) => {\n const { t } = useTranslation()\n\n return (\n <div className={`${baseClass}__items`}>\n {rowData?.autosave && <Pill size=\"small\">{t('version:autosave')}</Pill>}\n <VersionPillLabel\n currentlyPublishedVersion={currentlyPublishedVersion}\n disableDate={true}\n doc={rowData}\n labelFirst={false}\n labelStyle=\"pill\"\n latestDraftVersion={latestDraftVersion}\n />\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,IAAI,EAAEC,cAAc,QAAQ;AACrC,OAAOC,KAAA,MAAW;AAGlB,SAASC,gBAAgB,QAAQ;AAEjC,MAAMC,SAAA,GAAY;AAsBlB,OAAO,MAAMC,YAAA,GAA4CC,EAAA;EAAA,MAAAC,CAAA,GAAAR,EAAA;EAAC;IAAAS,yBAAA;IAAAC,kBAAA;IAAAC;EAAA,IAAAJ,EAIzD;EACC;IAAAK;EAAA,IAAcV,cAAA;EAAA,IAAAW,EAAA;EAAA,IAAAL,CAAA,QAAAG,OAAA,EAAAG,QAAA,IAAAN,CAAA,QAAAI,CAAA;IAITC,EAAA,GAAAF,OAAA,EAAAG,QAAA,IAAqBC,IAAA,CAAAd,IAAA;MAAAe,IAAA,EAAW;MAAAC,QAAA,EAASL,CAAA,CAAE;IAAA,C;;;;;;;;;IAD9CM,EAAA,GAAAC,KAAA,CAAC;MAAAC,SAAA,EAAe,GAAAf,SAAA,SAAqB;MAAAY,QAAA,GAClCJ,E,EACDE,IAAA,CAAAX,gBAAA;QAAAK,yBAAA;QAAAY,WAAA;QAAAC,GAAA,EAGOX,OAAA;QAAAY,UAAA;QAAAC,UAAA,EAEM;QAAAd;MAAA,C;;;;;;;;;;SAPfQ,E;CAYJ","ignoreList":[]}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
5
|
import { Link, useConfig, useTranslation } from '@payloadcms/ui';
|
|
5
6
|
import { formatDate } from '@payloadcms/ui/shared';
|
|
6
7
|
import { formatAdminURL } from 'payload/shared';
|
|
7
8
|
import React from 'react';
|
|
8
9
|
export const CreatedAtCell = t0 => {
|
|
10
|
+
const $ = _c(12);
|
|
9
11
|
const {
|
|
10
12
|
collectionSlug,
|
|
11
13
|
docID,
|
|
@@ -13,48 +15,72 @@ export const CreatedAtCell = t0 => {
|
|
|
13
15
|
isTrashed,
|
|
14
16
|
rowData: t1
|
|
15
17
|
} = t0;
|
|
18
|
+
let t2;
|
|
19
|
+
if ($[0] !== t1) {
|
|
20
|
+
t2 = t1 === undefined ? {} : t1;
|
|
21
|
+
$[0] = t1;
|
|
22
|
+
$[1] = t2;
|
|
23
|
+
} else {
|
|
24
|
+
t2 = $[1];
|
|
25
|
+
}
|
|
16
26
|
const {
|
|
17
27
|
id,
|
|
18
28
|
updatedAt
|
|
19
|
-
} =
|
|
29
|
+
} = t2;
|
|
20
30
|
const {
|
|
21
|
-
config:
|
|
31
|
+
config: t3
|
|
22
32
|
} = useConfig();
|
|
23
33
|
const {
|
|
24
|
-
admin:
|
|
25
|
-
routes:
|
|
26
|
-
} =
|
|
34
|
+
admin: t4,
|
|
35
|
+
routes: t5
|
|
36
|
+
} = t3;
|
|
27
37
|
const {
|
|
28
38
|
dateFormat
|
|
29
|
-
} =
|
|
39
|
+
} = t4;
|
|
30
40
|
const {
|
|
31
41
|
admin: adminRoute
|
|
32
|
-
} =
|
|
42
|
+
} = t5;
|
|
33
43
|
const {
|
|
34
44
|
i18n
|
|
35
45
|
} = useTranslation();
|
|
36
46
|
const trashedDocPrefix = isTrashed ? "trash/" : "";
|
|
37
|
-
let
|
|
38
|
-
if (collectionSlug) {
|
|
39
|
-
to
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
let t6;
|
|
48
|
+
if ($[2] !== adminRoute || $[3] !== collectionSlug || $[4] !== dateFormat || $[5] !== docID || $[6] !== globalSlug || $[7] !== i18n || $[8] !== id || $[9] !== trashedDocPrefix || $[10] !== updatedAt) {
|
|
49
|
+
let to;
|
|
50
|
+
if (collectionSlug) {
|
|
51
|
+
to = formatAdminURL({
|
|
52
|
+
adminRoute,
|
|
53
|
+
path: `/collections/${collectionSlug}/${trashedDocPrefix}${docID}/versions/${id}`
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (globalSlug) {
|
|
57
|
+
to = formatAdminURL({
|
|
58
|
+
adminRoute,
|
|
59
|
+
path: `/globals/${globalSlug}/versions/${id}`
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
t6 = _jsx(Link, {
|
|
63
|
+
href: to,
|
|
64
|
+
prefetch: false,
|
|
65
|
+
children: formatDate({
|
|
66
|
+
date: updatedAt,
|
|
67
|
+
i18n,
|
|
68
|
+
pattern: dateFormat
|
|
69
|
+
})
|
|
48
70
|
});
|
|
71
|
+
$[2] = adminRoute;
|
|
72
|
+
$[3] = collectionSlug;
|
|
73
|
+
$[4] = dateFormat;
|
|
74
|
+
$[5] = docID;
|
|
75
|
+
$[6] = globalSlug;
|
|
76
|
+
$[7] = i18n;
|
|
77
|
+
$[8] = id;
|
|
78
|
+
$[9] = trashedDocPrefix;
|
|
79
|
+
$[10] = updatedAt;
|
|
80
|
+
$[11] = t6;
|
|
81
|
+
} else {
|
|
82
|
+
t6 = $[11];
|
|
49
83
|
}
|
|
50
|
-
return
|
|
51
|
-
href: to,
|
|
52
|
-
prefetch: false,
|
|
53
|
-
children: formatDate({
|
|
54
|
-
date: updatedAt,
|
|
55
|
-
i18n,
|
|
56
|
-
pattern: dateFormat
|
|
57
|
-
})
|
|
58
|
-
});
|
|
84
|
+
return t6;
|
|
59
85
|
};
|
|
60
86
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Link","useConfig","useTranslation","formatDate","formatAdminURL","React","CreatedAtCell","t0","collectionSlug","docID","globalSlug","isTrashed","rowData","t1","
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","Link","useConfig","useTranslation","formatDate","formatAdminURL","React","CreatedAtCell","t0","$","collectionSlug","docID","globalSlug","isTrashed","rowData","t1","t2","undefined","id","updatedAt","config","t3","admin","t4","routes","t5","dateFormat","adminRoute","i18n","trashedDocPrefix","t6","to","_jsx","href","prefetch","children","date","pattern"],"sources":["../../../../../src/views/Versions/cells/CreatedAt/index.tsx"],"sourcesContent":["'use client'\nimport { Link, useConfig, useTranslation } from '@payloadcms/ui'\nimport { formatDate } from '@payloadcms/ui/shared'\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\nexport type CreatedAtCellProps = {\n collectionSlug?: string\n docID?: number | string\n globalSlug?: string\n isTrashed?: boolean\n rowData?: {\n id: number | string\n updatedAt: Date | number | string\n }\n}\n\nexport const CreatedAtCell: React.FC<CreatedAtCellProps> = ({\n collectionSlug,\n docID,\n globalSlug,\n isTrashed,\n rowData: { id, updatedAt } = {},\n}) => {\n const {\n config: {\n admin: { dateFormat },\n routes: { admin: adminRoute },\n },\n } = useConfig()\n\n const { i18n } = useTranslation()\n\n const trashedDocPrefix = isTrashed ? 'trash/' : ''\n\n let to: string\n\n if (collectionSlug) {\n to = formatAdminURL({\n adminRoute,\n path: `/collections/${collectionSlug}/${trashedDocPrefix}${docID}/versions/${id}`,\n })\n }\n\n if (globalSlug) {\n to = formatAdminURL({\n adminRoute,\n path: `/globals/${globalSlug}/versions/${id}`,\n })\n }\n\n return (\n <Link href={to} prefetch={false}>\n {formatDate({ date: updatedAt, i18n, pattern: dateFormat })}\n </Link>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,IAAI,EAAEC,SAAS,EAAEC,cAAc,QAAQ;AAChD,SAASC,UAAU,QAAQ;AAC3B,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAalB,OAAO,MAAMC,aAAA,GAA8CC,EAAA;EAAA,MAAAC,CAAA,GAAAT,EAAA;EAAC;IAAAU,cAAA;IAAAC,KAAA;IAAAC,UAAA;IAAAC,SAAA;IAAAC,OAAA,EAAAC;EAAA,IAAAP,EAM3D;EAAA,IAAAQ,EAAA;EAAA,IAAAP,CAAA,QAAAM,EAAA;IADUC,EAAA,GAAAD,EAAsB,KAAAE,SAAA,QAAtBF,EAAsB;IAAAN,CAAA,MAAAM,EAAA;IAAAN,CAAA,MAAAO,EAAA;EAAA;IAAAA,EAAA,GAAAP,CAAA;EAAA;EAAtB;IAAAS,EAAA;IAAAC;EAAA,IAAAH,EAAsB;EAE/B;IAAAI,MAAA,EAAAC;EAAA,IAKInB,SAAA;EAJM;IAAAoB,KAAA,EAAAC,EAAA;IAAAC,MAAA,EAAAC;EAAA,IAAAJ,EAGP;EAFQ;IAAAK;EAAA,IAAAH,EAAc;EACb;IAAAD,KAAA,EAAAK;EAAA,IAAAF,EAAqB;EAIjC;IAAAG;EAAA,IAAiBzB,cAAA;EAEjB,MAAA0B,gBAAA,GAAyBhB,SAAA,GAAY,WAAW;EAAA,IAAAiB,EAAA;EAAA,IAAArB,CAAA,QAAAkB,UAAA,IAAAlB,CAAA,QAAAC,cAAA,IAAAD,CAAA,QAAAiB,UAAA,IAAAjB,CAAA,QAAAE,KAAA,IAAAF,CAAA,QAAAG,UAAA,IAAAH,CAAA,QAAAmB,IAAA,IAAAnB,CAAA,QAAAS,EAAA,IAAAT,CAAA,QAAAoB,gBAAA,IAAApB,CAAA,SAAAU,SAAA;IAE5CY,GAAA,CAAAA,EAAA;IAAA,IAEArB,cAAA;MACFqB,EAAA,CAAAA,CAAA,CAAKA;QAAAA;QAAAA,KAAA,CAEGA,gBAAgBrB,cAAA,IAAkBmB,gBAAA,GAAmBlB,KAAA,aAAkBO,EAAA;MAAI,CACnF;IAHA;IAAA,IAMEN,UAAA;MACFmB,EAAA,CAAAA,CAAA,CAAKA;QAAAA;QAAAA,KAAA,CAEGA,YAAYnB,UAAA,aAAuBM,EAAA;MAAI,CAC/C;IAHA;IAOAY,EAAA,GAAAE,IAAA,CAAA/B,IAAA;MAAAgC,IAAA,EAAYF,EAAA;MAAAG,QAAA;MAAAC,QAAA,EACT/B,UAAA;QAAAgC,IAAA,EAAmBjB,SAAA;QAAAS,IAAA;QAAAS,OAAA,EAA0BX;MAAA,CAAW;IAAA,C;;;;;;;;;;;;;;SAD3DI,E;CAIJ","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/next",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.56.0-internal.299316b",
|
|
4
4
|
"homepage": "https://payloadcms.com",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -87,9 +87,9 @@
|
|
|
87
87
|
"qs-esm": "7.0.2",
|
|
88
88
|
"sass": "1.77.4",
|
|
89
89
|
"uuid": "10.0.0",
|
|
90
|
-
"@payloadcms/graphql": "3.
|
|
91
|
-
"@payloadcms/translations": "3.
|
|
92
|
-
"@payloadcms/ui": "3.
|
|
90
|
+
"@payloadcms/graphql": "3.56.0-internal.299316b",
|
|
91
|
+
"@payloadcms/translations": "3.56.0-internal.299316b",
|
|
92
|
+
"@payloadcms/ui": "3.56.0-internal.299316b"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@babel/cli": "7.27.2",
|
|
@@ -99,20 +99,20 @@
|
|
|
99
99
|
"@babel/preset-typescript": "7.27.1",
|
|
100
100
|
"@next/eslint-plugin-next": "15.4.4",
|
|
101
101
|
"@types/busboy": "1.5.4",
|
|
102
|
-
"@types/react": "19.1.
|
|
103
|
-
"@types/react-dom": "19.1.
|
|
102
|
+
"@types/react": "19.1.8",
|
|
103
|
+
"@types/react-dom": "19.1.6",
|
|
104
104
|
"@types/uuid": "10.0.0",
|
|
105
|
-
"babel-plugin-react-compiler": "19.1.0-rc.
|
|
105
|
+
"babel-plugin-react-compiler": "19.1.0-rc.2",
|
|
106
106
|
"esbuild": "0.25.5",
|
|
107
107
|
"esbuild-sass-plugin": "3.3.1",
|
|
108
108
|
"swc-plugin-transform-remove-imports": "4.0.4",
|
|
109
109
|
"@payloadcms/eslint-config": "3.28.0",
|
|
110
|
-
"payload": "3.
|
|
110
|
+
"payload": "3.56.0-internal.299316b"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
113
|
"graphql": "^16.8.1",
|
|
114
114
|
"next": "^15.2.3",
|
|
115
|
-
"payload": "3.
|
|
115
|
+
"payload": "3.56.0-internal.299316b"
|
|
116
116
|
},
|
|
117
117
|
"engines": {
|
|
118
118
|
"node": "^18.20.2 || >=20.9.0"
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Payload, SanitizedCollectionConfig, SanitizedConfig, SanitizedGlobalConfig } from 'payload';
|
|
2
|
-
type Args = {
|
|
3
|
-
adminRoute: string;
|
|
4
|
-
config: SanitizedConfig;
|
|
5
|
-
defaultIDType: Payload['db']['defaultIDType'];
|
|
6
|
-
payload?: Payload;
|
|
7
|
-
route: string;
|
|
8
|
-
};
|
|
9
|
-
type RouteInfo = {
|
|
10
|
-
collectionConfig?: SanitizedCollectionConfig;
|
|
11
|
-
collectionSlug?: string;
|
|
12
|
-
docID?: number | string;
|
|
13
|
-
globalConfig?: SanitizedGlobalConfig;
|
|
14
|
-
globalSlug?: string;
|
|
15
|
-
};
|
|
16
|
-
export declare function getRouteInfo({ adminRoute, config, defaultIDType, payload, route, }: Args): RouteInfo;
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=handleAdminPage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleAdminPage.d.ts","sourceRoot":"","sources":["../../../src/utilities/initPage/handleAdminPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,yBAAyB,EACzB,eAAe,EACf,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAIhB,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,eAAe,CAAA;IACvB,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,CAAA;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,KAAK,SAAS,GAAG;IACf,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,wBAAgB,YAAY,CAAC,EAC3B,UAAU,EACV,MAAM,EACN,aAAa,EACb,OAAO,EACP,KAAK,GACN,EAAE,IAAI,GAAG,SAAS,CAiDlB"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { getRouteWithoutAdmin, isAdminRoute } from './shared.js';
|
|
2
|
-
export function getRouteInfo({
|
|
3
|
-
adminRoute,
|
|
4
|
-
config,
|
|
5
|
-
defaultIDType,
|
|
6
|
-
payload,
|
|
7
|
-
route
|
|
8
|
-
}) {
|
|
9
|
-
if (isAdminRoute({
|
|
10
|
-
adminRoute,
|
|
11
|
-
config,
|
|
12
|
-
route
|
|
13
|
-
})) {
|
|
14
|
-
const routeWithoutAdmin = getRouteWithoutAdmin({
|
|
15
|
-
adminRoute,
|
|
16
|
-
route
|
|
17
|
-
});
|
|
18
|
-
const routeSegments = routeWithoutAdmin.split('/').filter(Boolean);
|
|
19
|
-
const [entityType, entitySlug, segment3, segment4] = routeSegments;
|
|
20
|
-
const collectionSlug = entityType === 'collections' ? entitySlug : undefined;
|
|
21
|
-
const globalSlug = entityType === 'globals' ? entitySlug : undefined;
|
|
22
|
-
let collectionConfig;
|
|
23
|
-
let globalConfig;
|
|
24
|
-
let idType = defaultIDType;
|
|
25
|
-
if (collectionSlug) {
|
|
26
|
-
collectionConfig = payload.collections?.[collectionSlug]?.config;
|
|
27
|
-
}
|
|
28
|
-
if (globalSlug) {
|
|
29
|
-
globalConfig = config.globals.find(global => global.slug === globalSlug);
|
|
30
|
-
}
|
|
31
|
-
// If the collection is using a custom ID, we need to determine its type
|
|
32
|
-
if (collectionConfig && payload) {
|
|
33
|
-
if (payload.collections?.[collectionSlug]?.customIDType) {
|
|
34
|
-
idType = payload.collections?.[collectionSlug].customIDType;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
let docID;
|
|
38
|
-
if (collectionSlug) {
|
|
39
|
-
if (segment3 === 'trash' && segment4) {
|
|
40
|
-
// /collections/:slug/trash/:id
|
|
41
|
-
docID = idType === 'number' ? Number(segment4) : segment4;
|
|
42
|
-
} else if (segment3 && segment3 !== 'create') {
|
|
43
|
-
// /collections/:slug/:id
|
|
44
|
-
docID = idType === 'number' ? Number(segment3) : segment3;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return {
|
|
48
|
-
collectionConfig,
|
|
49
|
-
collectionSlug,
|
|
50
|
-
docID,
|
|
51
|
-
globalConfig,
|
|
52
|
-
globalSlug
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
return {};
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=handleAdminPage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleAdminPage.js","names":["getRouteWithoutAdmin","isAdminRoute","getRouteInfo","adminRoute","config","defaultIDType","payload","route","routeWithoutAdmin","routeSegments","split","filter","Boolean","entityType","entitySlug","segment3","segment4","collectionSlug","undefined","globalSlug","collectionConfig","globalConfig","idType","collections","globals","find","global","slug","customIDType","docID","Number"],"sources":["../../../src/utilities/initPage/handleAdminPage.ts"],"sourcesContent":["import type {\n Payload,\n SanitizedCollectionConfig,\n SanitizedConfig,\n SanitizedGlobalConfig,\n} from 'payload'\n\nimport { getRouteWithoutAdmin, isAdminRoute } from './shared.js'\n\ntype Args = {\n adminRoute: string\n config: SanitizedConfig\n defaultIDType: Payload['db']['defaultIDType']\n payload?: Payload\n route: string\n}\n\ntype RouteInfo = {\n collectionConfig?: SanitizedCollectionConfig\n collectionSlug?: string\n docID?: number | string\n globalConfig?: SanitizedGlobalConfig\n globalSlug?: string\n}\n\nexport function getRouteInfo({\n adminRoute,\n config,\n defaultIDType,\n payload,\n route,\n}: Args): RouteInfo {\n if (isAdminRoute({ adminRoute, config, route })) {\n const routeWithoutAdmin = getRouteWithoutAdmin({ adminRoute, route })\n const routeSegments = routeWithoutAdmin.split('/').filter(Boolean)\n const [entityType, entitySlug, segment3, segment4] = routeSegments\n const collectionSlug = entityType === 'collections' ? entitySlug : undefined\n const globalSlug = entityType === 'globals' ? entitySlug : undefined\n\n let collectionConfig: SanitizedCollectionConfig | undefined\n let globalConfig: SanitizedGlobalConfig | undefined\n let idType = defaultIDType\n\n if (collectionSlug) {\n collectionConfig = payload.collections?.[collectionSlug]?.config\n }\n\n if (globalSlug) {\n globalConfig = config.globals.find((global) => global.slug === globalSlug)\n }\n\n // If the collection is using a custom ID, we need to determine its type\n if (collectionConfig && payload) {\n if (payload.collections?.[collectionSlug]?.customIDType) {\n idType = payload.collections?.[collectionSlug].customIDType\n }\n }\n\n let docID: number | string | undefined\n\n if (collectionSlug) {\n if (segment3 === 'trash' && segment4) {\n // /collections/:slug/trash/:id\n docID = idType === 'number' ? Number(segment4) : segment4\n } else if (segment3 && segment3 !== 'create') {\n // /collections/:slug/:id\n docID = idType === 'number' ? Number(segment3) : segment3\n }\n }\n\n return {\n collectionConfig,\n collectionSlug,\n docID,\n globalConfig,\n globalSlug,\n }\n }\n\n return {}\n}\n"],"mappings":"AAOA,SAASA,oBAAoB,EAAEC,YAAY,QAAQ;AAkBnD,OAAO,SAASC,aAAa;EAC3BC,UAAU;EACVC,MAAM;EACNC,aAAa;EACbC,OAAO;EACPC;AAAK,CACA;EACL,IAAIN,YAAA,CAAa;IAAEE,UAAA;IAAYC,MAAA;IAAQG;EAAM,IAAI;IAC/C,MAAMC,iBAAA,GAAoBR,oBAAA,CAAqB;MAAEG,UAAA;MAAYI;IAAM;IACnE,MAAME,aAAA,GAAgBD,iBAAA,CAAkBE,KAAK,CAAC,KAAKC,MAAM,CAACC,OAAA;IAC1D,MAAM,CAACC,UAAA,EAAYC,UAAA,EAAYC,QAAA,EAAUC,QAAA,CAAS,GAAGP,aAAA;IACrD,MAAMQ,cAAA,GAAiBJ,UAAA,KAAe,gBAAgBC,UAAA,GAAaI,SAAA;IACnE,MAAMC,UAAA,GAAaN,UAAA,KAAe,YAAYC,UAAA,GAAaI,SAAA;IAE3D,IAAIE,gBAAA;IACJ,IAAIC,YAAA;IACJ,IAAIC,MAAA,GAASjB,aAAA;IAEb,IAAIY,cAAA,EAAgB;MAClBG,gBAAA,GAAmBd,OAAA,CAAQiB,WAAW,GAAGN,cAAA,CAAe,EAAEb,MAAA;IAC5D;IAEA,IAAIe,UAAA,EAAY;MACdE,YAAA,GAAejB,MAAA,CAAOoB,OAAO,CAACC,IAAI,CAAEC,MAAA,IAAWA,MAAA,CAAOC,IAAI,KAAKR,UAAA;IACjE;IAEA;IACA,IAAIC,gBAAA,IAAoBd,OAAA,EAAS;MAC/B,IAAIA,OAAA,CAAQiB,WAAW,GAAGN,cAAA,CAAe,EAAEW,YAAA,EAAc;QACvDN,MAAA,GAAShB,OAAA,CAAQiB,WAAW,GAAGN,cAAA,CAAe,CAACW,YAAA;MACjD;IACF;IAEA,IAAIC,KAAA;IAEJ,IAAIZ,cAAA,EAAgB;MAClB,IAAIF,QAAA,KAAa,WAAWC,QAAA,EAAU;QACpC;QACAa,KAAA,GAAQP,MAAA,KAAW,WAAWQ,MAAA,CAAOd,QAAA,IAAYA,QAAA;MACnD,OAAO,IAAID,QAAA,IAAYA,QAAA,KAAa,UAAU;QAC5C;QACAc,KAAA,GAAQP,MAAA,KAAW,WAAWQ,MAAA,CAAOf,QAAA,IAAYA,QAAA;MACnD;IACF;IAEA,OAAO;MACLK,gBAAA;MACAH,cAAA;MACAY,KAAA;MACAR,YAAA;MACAF;IACF;EACF;EAEA,OAAO,CAAC;AACV","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleAuthRedirect.d.ts","sourceRoot":"","sources":["../../../src/utilities/initPage/handleAuthRedirect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAKxC,KAAK,IAAI,GAAG;IACV,MAAM,MAAA;IACN,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAA;IAClD,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,kBAAkB,0CAA2C,IAAI,KAAG,MAkChF,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleAuthRedirect.js","names":["formatAdminURL","qs","handleAuthRedirect","config","route","searchParams","user","admin","routes","login","loginRouteFromConfig","unauthorized","unauthorizedRoute","adminRoute","redirect","redirectRoute","Object","keys","length","stringify","addQueryPrefix","redirectTo","path","parsedLoginRouteSearchParams","parse","split","searchParamsWithRedirect"],"sources":["../../../src/utilities/initPage/handleAuthRedirect.ts"],"sourcesContent":["import type { TypedUser } from 'payload'\n\nimport { formatAdminURL } from 'payload/shared'\nimport * as qs from 'qs-esm'\n\ntype Args = {\n config\n route: string\n searchParams: { [key: string]: string | string[] }\n user?: TypedUser\n}\n\nexport const handleAuthRedirect = ({ config, route, searchParams, user }: Args): string => {\n const {\n admin: {\n routes: { login: loginRouteFromConfig, unauthorized: unauthorizedRoute },\n },\n routes: { admin: adminRoute },\n } = config\n\n if (searchParams && 'redirect' in searchParams) {\n delete searchParams.redirect\n }\n\n const redirectRoute =\n (route !== adminRoute ? route : '') +\n (Object.keys(searchParams ?? {}).length > 0\n ? `${qs.stringify(searchParams, { addQueryPrefix: true })}`\n : '')\n\n const redirectTo = formatAdminURL({\n adminRoute,\n path: user ? unauthorizedRoute : loginRouteFromConfig,\n })\n\n const parsedLoginRouteSearchParams = qs.parse(redirectTo.split('?')[1] ?? '')\n\n const searchParamsWithRedirect = `${qs.stringify(\n {\n ...parsedLoginRouteSearchParams,\n ...(redirectRoute ? { redirect: redirectRoute } : {}),\n },\n { addQueryPrefix: true },\n )}`\n\n return `${redirectTo.split('?')[0]}${searchParamsWithRedirect}`\n}\n"],"mappings":"AAEA,SAASA,cAAc,QAAQ;AAC/B,YAAYC,EAAA,MAAQ;AASpB,OAAO,MAAMC,kBAAA,GAAqBA,CAAC;EAAEC,MAAM;EAAEC,KAAK;EAAEC,YAAY;EAAEC;AAAI,CAAQ;EAC5E,MAAM;IACJC,KAAA,EAAO;MACLC,MAAA,EAAQ;QAAEC,KAAA,EAAOC,oBAAoB;QAAEC,YAAA,EAAcC;MAAiB;IAAE,CACzE;IACDJ,MAAA,EAAQ;MAAED,KAAA,EAAOM;IAAU;EAAE,CAC9B,GAAGV,MAAA;EAEJ,IAAIE,YAAA,IAAgB,cAAcA,YAAA,EAAc;IAC9C,OAAOA,YAAA,CAAaS,QAAQ;EAC9B;EAEA,MAAMC,aAAA,GACJ,CAACX,KAAA,KAAUS,UAAA,GAAaT,KAAA,GAAQ,EAAC,KAChCY,MAAA,CAAOC,IAAI,CAACZ,YAAA,IAAgB,CAAC,GAAGa,MAAM,GAAG,IACtC,GAAGjB,EAAA,CAAGkB,SAAS,CAACd,YAAA,EAAc;IAAEe,cAAA,EAAgB;EAAK,IAAI,GACzD,EAAC;EAEP,MAAMC,UAAA,GAAarB,cAAA,CAAe;IAChCa,UAAA;IACAS,IAAA,EAAMhB,IAAA,GAAOM,iBAAA,GAAoBF;EACnC;EAEA,MAAMa,4BAAA,GAA+BtB,EAAA,CAAGuB,KAAK,CAACH,UAAA,CAAWI,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI;EAE1E,MAAMC,wBAAA,GAA2B,GAAGzB,EAAA,CAAGkB,SAAS,CAC9C;IACE,GAAGI,4BAA4B;IAC/B,IAAIR,aAAA,GAAgB;MAAED,QAAA,EAAUC;IAAc,IAAI,CAAC,CAAC;EACtD,GACA;IAAEK,cAAA,EAAgB;EAAK,IACtB;EAEH,OAAO,GAAGC,UAAA,CAAWI,KAAK,CAAC,IAAI,CAAC,EAAE,GAAGC,wBAAA,EAA0B;AACjE","ignoreList":[]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { InitPageResult } from 'payload';
|
|
2
|
-
import type { Args } from './types.js';
|
|
3
|
-
export declare const initPage: ({ config: configPromise, importMap, route, routeParams, searchParams, useLayoutReq, }: Args) => Promise<InitPageResult>;
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utilities/initPage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,SAAS,CAAA;AAM9D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAQtC,eAAO,MAAM,QAAQ,0FAOlB,IAAI,KAAG,OAAO,CAAC,cAAc,CAmG/B,CAAA"}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { notFound } from 'next/navigation.js';
|
|
2
|
-
import { isEntityHidden } from 'payload';
|
|
3
|
-
import * as qs from 'qs-esm';
|
|
4
|
-
import { initReq } from '../initReq.js';
|
|
5
|
-
import { getRouteInfo } from './handleAdminPage.js';
|
|
6
|
-
import { handleAuthRedirect } from './handleAuthRedirect.js';
|
|
7
|
-
import { isCustomAdminView } from './isCustomAdminView.js';
|
|
8
|
-
import { isPublicAdminRoute } from './shared.js';
|
|
9
|
-
export const initPage = async ({
|
|
10
|
-
config: configPromise,
|
|
11
|
-
importMap,
|
|
12
|
-
route,
|
|
13
|
-
routeParams = {},
|
|
14
|
-
searchParams,
|
|
15
|
-
useLayoutReq
|
|
16
|
-
}) => {
|
|
17
|
-
const queryString = `${qs.stringify(searchParams ?? {}, {
|
|
18
|
-
addQueryPrefix: true
|
|
19
|
-
})}`;
|
|
20
|
-
const {
|
|
21
|
-
cookies,
|
|
22
|
-
locale,
|
|
23
|
-
permissions,
|
|
24
|
-
req,
|
|
25
|
-
req: {
|
|
26
|
-
payload
|
|
27
|
-
}
|
|
28
|
-
} = await initReq({
|
|
29
|
-
configPromise,
|
|
30
|
-
importMap,
|
|
31
|
-
key: useLayoutReq ? 'RootLayout' : 'initPage',
|
|
32
|
-
overrides: {
|
|
33
|
-
fallbackLocale: false,
|
|
34
|
-
req: {
|
|
35
|
-
query: qs.parse(queryString, {
|
|
36
|
-
depth: 10,
|
|
37
|
-
ignoreQueryPrefix: true
|
|
38
|
-
}),
|
|
39
|
-
routeParams
|
|
40
|
-
},
|
|
41
|
-
urlSuffix: `${route}${searchParams ? queryString : ''}`
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const {
|
|
45
|
-
collections,
|
|
46
|
-
globals,
|
|
47
|
-
routes: {
|
|
48
|
-
admin: adminRoute
|
|
49
|
-
}
|
|
50
|
-
} = payload.config;
|
|
51
|
-
const languageOptions = Object.entries(payload.config.i18n.supportedLanguages || {}).reduce((acc, [language, languageConfig]) => {
|
|
52
|
-
if (Object.keys(payload.config.i18n.supportedLanguages).includes(language)) {
|
|
53
|
-
acc.push({
|
|
54
|
-
label: languageConfig.translations.general.thisLanguage,
|
|
55
|
-
value: language
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
return acc;
|
|
59
|
-
}, []);
|
|
60
|
-
const visibleEntities = {
|
|
61
|
-
collections: collections.map(({
|
|
62
|
-
slug,
|
|
63
|
-
admin: {
|
|
64
|
-
hidden
|
|
65
|
-
}
|
|
66
|
-
}) => !isEntityHidden({
|
|
67
|
-
hidden,
|
|
68
|
-
user: req.user
|
|
69
|
-
}) ? slug : null).filter(Boolean),
|
|
70
|
-
globals: globals.map(({
|
|
71
|
-
slug,
|
|
72
|
-
admin: {
|
|
73
|
-
hidden
|
|
74
|
-
}
|
|
75
|
-
}) => !isEntityHidden({
|
|
76
|
-
hidden,
|
|
77
|
-
user: req.user
|
|
78
|
-
}) ? slug : null).filter(Boolean)
|
|
79
|
-
};
|
|
80
|
-
let redirectTo = null;
|
|
81
|
-
if (!permissions.canAccessAdmin && !isPublicAdminRoute({
|
|
82
|
-
adminRoute,
|
|
83
|
-
config: payload.config,
|
|
84
|
-
route
|
|
85
|
-
}) && !isCustomAdminView({
|
|
86
|
-
adminRoute,
|
|
87
|
-
config: payload.config,
|
|
88
|
-
route
|
|
89
|
-
})) {
|
|
90
|
-
redirectTo = handleAuthRedirect({
|
|
91
|
-
config: payload.config,
|
|
92
|
-
route,
|
|
93
|
-
searchParams,
|
|
94
|
-
user: req.user
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
const {
|
|
98
|
-
collectionConfig,
|
|
99
|
-
collectionSlug,
|
|
100
|
-
docID,
|
|
101
|
-
globalConfig,
|
|
102
|
-
globalSlug
|
|
103
|
-
} = getRouteInfo({
|
|
104
|
-
adminRoute,
|
|
105
|
-
config: payload.config,
|
|
106
|
-
defaultIDType: payload.db.defaultIDType,
|
|
107
|
-
payload,
|
|
108
|
-
route
|
|
109
|
-
});
|
|
110
|
-
if (collectionSlug && !collectionConfig || globalSlug && !globalConfig) {
|
|
111
|
-
return notFound();
|
|
112
|
-
}
|
|
113
|
-
return {
|
|
114
|
-
collectionConfig,
|
|
115
|
-
cookies,
|
|
116
|
-
docID,
|
|
117
|
-
globalConfig,
|
|
118
|
-
languageOptions,
|
|
119
|
-
locale,
|
|
120
|
-
permissions,
|
|
121
|
-
redirectTo,
|
|
122
|
-
req,
|
|
123
|
-
translations: req.i18n.translations,
|
|
124
|
-
visibleEntities
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["notFound","isEntityHidden","qs","initReq","getRouteInfo","handleAuthRedirect","isCustomAdminView","isPublicAdminRoute","initPage","config","configPromise","importMap","route","routeParams","searchParams","useLayoutReq","queryString","stringify","addQueryPrefix","cookies","locale","permissions","req","payload","key","overrides","fallbackLocale","query","parse","depth","ignoreQueryPrefix","urlSuffix","collections","globals","routes","admin","adminRoute","languageOptions","Object","entries","i18n","supportedLanguages","reduce","acc","language","languageConfig","keys","includes","push","label","translations","general","thisLanguage","value","visibleEntities","map","slug","hidden","user","filter","Boolean","redirectTo","canAccessAdmin","collectionConfig","collectionSlug","docID","globalConfig","globalSlug","defaultIDType","db"],"sources":["../../../src/utilities/initPage/index.ts"],"sourcesContent":["import type { InitPageResult, VisibleEntities } from 'payload'\n\nimport { notFound } from 'next/navigation.js'\nimport { isEntityHidden } from 'payload'\nimport * as qs from 'qs-esm'\n\nimport type { Args } from './types.js'\n\nimport { initReq } from '../initReq.js'\nimport { getRouteInfo } from './handleAdminPage.js'\nimport { handleAuthRedirect } from './handleAuthRedirect.js'\nimport { isCustomAdminView } from './isCustomAdminView.js'\nimport { isPublicAdminRoute } from './shared.js'\n\nexport const initPage = async ({\n config: configPromise,\n importMap,\n route,\n routeParams = {},\n searchParams,\n useLayoutReq,\n}: Args): Promise<InitPageResult> => {\n const queryString = `${qs.stringify(searchParams ?? {}, { addQueryPrefix: true })}`\n\n const {\n cookies,\n locale,\n permissions,\n req,\n req: { payload },\n } = await initReq({\n configPromise,\n importMap,\n key: useLayoutReq ? 'RootLayout' : 'initPage',\n overrides: {\n fallbackLocale: false,\n req: {\n query: qs.parse(queryString, {\n depth: 10,\n ignoreQueryPrefix: true,\n }),\n routeParams,\n },\n urlSuffix: `${route}${searchParams ? queryString : ''}`,\n },\n })\n\n const {\n collections,\n globals,\n routes: { admin: adminRoute },\n } = payload.config\n\n const languageOptions = Object.entries(payload.config.i18n.supportedLanguages || {}).reduce(\n (acc, [language, languageConfig]) => {\n if (Object.keys(payload.config.i18n.supportedLanguages).includes(language)) {\n acc.push({\n label: languageConfig.translations.general.thisLanguage,\n value: language,\n })\n }\n\n return acc\n },\n [],\n )\n\n const visibleEntities: VisibleEntities = {\n collections: collections\n .map(({ slug, admin: { hidden } }) =>\n !isEntityHidden({ hidden, user: req.user }) ? slug : null,\n )\n .filter(Boolean),\n globals: globals\n .map(({ slug, admin: { hidden } }) =>\n !isEntityHidden({ hidden, user: req.user }) ? slug : null,\n )\n .filter(Boolean),\n }\n\n let redirectTo = null\n\n if (\n !permissions.canAccessAdmin &&\n !isPublicAdminRoute({ adminRoute, config: payload.config, route }) &&\n !isCustomAdminView({ adminRoute, config: payload.config, route })\n ) {\n redirectTo = handleAuthRedirect({\n config: payload.config,\n route,\n searchParams,\n user: req.user,\n })\n }\n\n const { collectionConfig, collectionSlug, docID, globalConfig, globalSlug } = getRouteInfo({\n adminRoute,\n config: payload.config,\n defaultIDType: payload.db.defaultIDType,\n payload,\n route,\n })\n\n if ((collectionSlug && !collectionConfig) || (globalSlug && !globalConfig)) {\n return notFound()\n }\n\n return {\n collectionConfig,\n cookies,\n docID,\n globalConfig,\n languageOptions,\n locale,\n permissions,\n redirectTo,\n req,\n translations: req.i18n.translations,\n visibleEntities,\n }\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isCustomAdminView.d.ts","sourceRoot":"","sources":["../../../src/utilities/initPage/isCustomAdminView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmC,eAAe,EAAE,MAAM,SAAS,CAAA;AAI/E;;GAEG;AACH,eAAO,MAAM,iBAAiB,mCAI3B;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;CACd,KAAG,OAmBH,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isCustomAdminView.js","names":["getRouteWithoutAdmin","isCustomAdminView","adminRoute","config","route","admin","components","views","isPublicAdminRoute","Object","entries","some","_","view","routeWithoutAdmin","exact","path","startsWith"],"sources":["../../../src/utilities/initPage/isCustomAdminView.ts"],"sourcesContent":["import type { AdminViewConfig, PayloadRequest, SanitizedConfig } from 'payload'\n\nimport { getRouteWithoutAdmin } from './shared.js'\n\n/**\n * Returns an array of views marked with 'public: true' in the config\n */\nexport const isCustomAdminView = ({\n adminRoute,\n config,\n route,\n}: {\n adminRoute: string\n config: SanitizedConfig\n route: string\n}): boolean => {\n if (config.admin?.components?.views) {\n const isPublicAdminRoute = Object.entries(config.admin.components.views).some(([_, view]) => {\n const routeWithoutAdmin = getRouteWithoutAdmin({ adminRoute, route })\n\n if (view.exact) {\n if (routeWithoutAdmin === view.path) {\n return true\n }\n } else {\n if (routeWithoutAdmin.startsWith(view.path)) {\n return true\n }\n }\n return false\n })\n return isPublicAdminRoute\n }\n return false\n}\n"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ;AAErC;;;AAGA,OAAO,MAAMC,iBAAA,GAAoBA,CAAC;EAChCC,UAAU;EACVC,MAAM;EACNC;AAAK,CAKN;EACC,IAAID,MAAA,CAAOE,KAAK,EAAEC,UAAA,EAAYC,KAAA,EAAO;IACnC,MAAMC,kBAAA,GAAqBC,MAAA,CAAOC,OAAO,CAACP,MAAA,CAAOE,KAAK,CAACC,UAAU,CAACC,KAAK,EAAEI,IAAI,CAAC,CAAC,CAACC,CAAA,EAAGC,IAAA,CAAK;MACtF,MAAMC,iBAAA,GAAoBd,oBAAA,CAAqB;QAAEE,UAAA;QAAYE;MAAM;MAEnE,IAAIS,IAAA,CAAKE,KAAK,EAAE;QACd,IAAID,iBAAA,KAAsBD,IAAA,CAAKG,IAAI,EAAE;UACnC,OAAO;QACT;MACF,OAAO;QACL,IAAIF,iBAAA,CAAkBG,UAAU,CAACJ,IAAA,CAAKG,IAAI,GAAG;UAC3C,OAAO;QACT;MACF;MACA,OAAO;IACT;IACA,OAAOR,kBAAA;EACT;EACA,OAAO;AACT","ignoreList":[]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { SanitizedConfig } from 'payload';
|
|
2
|
-
export declare const isAdminRoute: ({ adminRoute, route, }: {
|
|
3
|
-
adminRoute: string;
|
|
4
|
-
config: SanitizedConfig;
|
|
5
|
-
route: string;
|
|
6
|
-
}) => boolean;
|
|
7
|
-
export declare const isPublicAdminRoute: ({ adminRoute, config, route, }: {
|
|
8
|
-
adminRoute: string;
|
|
9
|
-
config: SanitizedConfig;
|
|
10
|
-
route: string;
|
|
11
|
-
}) => boolean;
|
|
12
|
-
export declare const getRouteWithoutAdmin: ({ adminRoute, route, }: {
|
|
13
|
-
adminRoute: string;
|
|
14
|
-
route: string;
|
|
15
|
-
}) => string;
|
|
16
|
-
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/utilities/initPage/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAiB9C,eAAO,MAAM,YAAY,2BAGtB;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;CACd,KAAG,OAEH,CAAA;AAED,eAAO,MAAM,kBAAkB,mCAI5B;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,eAAe,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;CACd,KAAG,OAeH,CAAA;AAED,eAAO,MAAM,oBAAoB,2BAG9B;IACD,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;CACd,KAAG,MAEH,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","names":["publicAdminRoutes","isAdminRoute","adminRoute","route","startsWith","isPublicAdminRoute","config","some","routeSegment","segment","admin","routes","routeWithoutAdmin","getRouteWithoutAdmin","includes","replace"],"sources":["../../../src/utilities/initPage/shared.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\n// Routes that require admin authentication\nconst publicAdminRoutes: (keyof Pick<\n SanitizedConfig['admin']['routes'],\n 'createFirstUser' | 'forgot' | 'inactivity' | 'login' | 'logout' | 'reset' | 'unauthorized'\n>)[] = [\n 'createFirstUser',\n 'forgot',\n 'login',\n 'logout',\n 'forgot',\n 'inactivity',\n 'unauthorized',\n 'reset',\n]\n\nexport const isAdminRoute = ({\n adminRoute,\n route,\n}: {\n adminRoute: string\n config: SanitizedConfig\n route: string\n}): boolean => {\n return route.startsWith(adminRoute)\n}\n\nexport const isPublicAdminRoute = ({\n adminRoute,\n config,\n route,\n}: {\n adminRoute: string\n config: SanitizedConfig\n route: string\n}): boolean => {\n const isPublicAdminRoute = publicAdminRoutes.some((routeSegment) => {\n const segment = config.admin?.routes?.[routeSegment] || routeSegment\n const routeWithoutAdmin = getRouteWithoutAdmin({ adminRoute, route })\n\n if (routeWithoutAdmin.startsWith(segment)) {\n return true\n } else if (routeWithoutAdmin.includes('/verify/')) {\n return true\n } else {\n return false\n }\n })\n\n return isPublicAdminRoute\n}\n\nexport const getRouteWithoutAdmin = ({\n adminRoute,\n route,\n}: {\n adminRoute: string\n route: string\n}): string => {\n return adminRoute && adminRoute !== '/' ? route.replace(adminRoute, '') : route\n}\n"],"mappings":"AAEA;AACA,MAAMA,iBAAA,GAGC,CACL,mBACA,UACA,SACA,UACA,UACA,cACA,gBACA,QACD;AAED,OAAO,MAAMC,YAAA,GAAeA,CAAC;EAC3BC,UAAU;EACVC;AAAK,CAKN;EACC,OAAOA,KAAA,CAAMC,UAAU,CAACF,UAAA;AAC1B;AAEA,OAAO,MAAMG,kBAAA,GAAqBA,CAAC;EACjCH,UAAU;EACVI,MAAM;EACNH;AAAK,CAKN;EACC,MAAME,kBAAA,GAAqBL,iBAAA,CAAkBO,IAAI,CAAEC,YAAA;IACjD,MAAMC,OAAA,GAAUH,MAAA,CAAOI,KAAK,EAAEC,MAAA,GAASH,YAAA,CAAa,IAAIA,YAAA;IACxD,MAAMI,iBAAA,GAAoBC,oBAAA,CAAqB;MAAEX,UAAA;MAAYC;IAAM;IAEnE,IAAIS,iBAAA,CAAkBR,UAAU,CAACK,OAAA,GAAU;MACzC,OAAO;IACT,OAAO,IAAIG,iBAAA,CAAkBE,QAAQ,CAAC,aAAa;MACjD,OAAO;IACT,OAAO;MACL,OAAO;IACT;EACF;EAEA,OAAOT,kBAAA;AACT;AAEA,OAAO,MAAMQ,oBAAA,GAAuBA,CAAC;EACnCX,UAAU;EACVC;AAAK,CAIN;EACC,OAAOD,UAAA,IAAcA,UAAA,KAAe,MAAMC,KAAA,CAAMY,OAAO,CAACb,UAAA,EAAY,MAAMC,KAAA;AAC5E","ignoreList":[]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { ImportMap, SanitizedConfig } from 'payload';
|
|
2
|
-
export type Args = {
|
|
3
|
-
/**
|
|
4
|
-
* Your sanitized Payload config.
|
|
5
|
-
* If unresolved, this function will await the promise.
|
|
6
|
-
*/
|
|
7
|
-
config: Promise<SanitizedConfig> | SanitizedConfig;
|
|
8
|
-
importMap: ImportMap;
|
|
9
|
-
/**
|
|
10
|
-
* If true, redirects unauthenticated users to the admin login page.
|
|
11
|
-
* If a string is provided, the user will be redirected to that specific URL.
|
|
12
|
-
*/
|
|
13
|
-
redirectUnauthenticatedUser?: boolean | string;
|
|
14
|
-
/**
|
|
15
|
-
* The current route, i.e. `/admin/collections/posts`.
|
|
16
|
-
*/
|
|
17
|
-
route: string;
|
|
18
|
-
/**
|
|
19
|
-
* The route parameters of the current route
|
|
20
|
-
*
|
|
21
|
-
* @example `{ collection: 'posts', id: "post-id" }`.
|
|
22
|
-
*/
|
|
23
|
-
routeParams?: {
|
|
24
|
-
[key: string]: string;
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* The search parameters of the current route provided to all pages in Next.js.
|
|
28
|
-
*/
|
|
29
|
-
searchParams: {
|
|
30
|
-
[key: string]: string | string[] | undefined;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* If `useLayoutReq` is `true`, this page will use the cached `req` created by the root layout
|
|
34
|
-
* instead of creating a new one.
|
|
35
|
-
*
|
|
36
|
-
* This improves performance for pages that are able to share the same `req` as the root layout,
|
|
37
|
-
* as permissions do not need to be re-calculated.
|
|
38
|
-
*
|
|
39
|
-
* If the page has unique query and url params that need to be part of the `req` object, or if you
|
|
40
|
-
* need permissions calculation to respect those you should not use this property.
|
|
41
|
-
*/
|
|
42
|
-
useLayoutReq?: boolean;
|
|
43
|
-
};
|
|
44
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utilities/initPage/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzD,MAAM,MAAM,IAAI,GAAG;IACjB;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,CAAA;IAClD,SAAS,EAAE,SAAS,CAAA;IACpB;;;OAGG;IACH,2BAA2B,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAC9C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;OAIG;IACH,WAAW,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;IACvC;;OAEG;IACH,YAAY,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAA;KAAE,CAAA;IAC9D;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../../src/utilities/initPage/types.ts"],"sourcesContent":["import type { ImportMap, SanitizedConfig } from 'payload'\n\nexport type Args = {\n /**\n * Your sanitized Payload config.\n * If unresolved, this function will await the promise.\n */\n config: Promise<SanitizedConfig> | SanitizedConfig\n importMap: ImportMap\n /**\n * If true, redirects unauthenticated users to the admin login page.\n * If a string is provided, the user will be redirected to that specific URL.\n */\n redirectUnauthenticatedUser?: boolean | string\n /**\n * The current route, i.e. `/admin/collections/posts`.\n */\n route: string\n /**\n * The route parameters of the current route\n *\n * @example `{ collection: 'posts', id: \"post-id\" }`.\n */\n routeParams?: { [key: string]: string }\n /**\n * The search parameters of the current route provided to all pages in Next.js.\n */\n searchParams: { [key: string]: string | string[] | undefined }\n /**\n * If `useLayoutReq` is `true`, this page will use the cached `req` created by the root layout\n * instead of creating a new one.\n *\n * This improves performance for pages that are able to share the same `req` as the root layout,\n * as permissions do not need to be re-calculated.\n *\n * If the page has unique query and url params that need to be part of the `req` object, or if you\n * need permissions calculation to respect those you should not use this property.\n */\n useLayoutReq?: boolean\n}\n"],"mappings":"AAEA","ignoreList":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|