@payloadcms/next 3.42.0-internal.dfe4bec → 3.42.0

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.
@@ -1,4 +1,4 @@
1
1
  import type { InitPageResult } from 'payload';
2
2
  import type { Args } from './types.js';
3
- export declare const initPage: ({ config: configPromise, importMap, route, searchParams, useLayoutReq, }: Args) => Promise<InitPageResult>;
3
+ export declare const initPage: ({ config: configPromise, importMap, route, routeParams, searchParams, useLayoutReq, }: Args) => Promise<InitPageResult>;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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,6EAMlB,IAAI,KAAG,OAAO,CAAC,cAAc,CAkG/B,CAAA"}
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"}
@@ -10,6 +10,7 @@ export const initPage = async ({
10
10
  config: configPromise,
11
11
  importMap,
12
12
  route,
13
+ routeParams = {},
13
14
  searchParams,
14
15
  useLayoutReq
15
16
  }) => {
@@ -34,7 +35,8 @@ export const initPage = async ({
34
35
  query: qs.parse(queryString, {
35
36
  depth: 10,
36
37
  ignoreQueryPrefix: true
37
- })
38
+ }),
39
+ routeParams
38
40
  },
39
41
  urlSuffix: `${route}${searchParams ? queryString : ''}`
40
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["notFound","isEntityHidden","qs","initReq","getRouteInfo","handleAuthRedirect","isCustomAdminView","isPublicAdminRoute","initPage","config","configPromise","importMap","route","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 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 },\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":"AAEA,SAASA,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAC/B,YAAYC,EAAA,MAAQ;AAIpB,SAASC,OAAO,QAAQ;AACxB,SAASC,YAAY,QAAQ;AAC7B,SAASC,kBAAkB,QAAQ;AACnC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,kBAAkB,QAAQ;AAEnC,OAAO,MAAMC,QAAA,GAAW,MAAAA,CAAO;EAC7BC,MAAA,EAAQC,aAAa;EACrBC,SAAS;EACTC,KAAK;EACLC,YAAY;EACZC;AAAY,CACP;EACL,MAAMC,WAAA,GAAc,GAAGb,EAAA,CAAGc,SAAS,CAACH,YAAA,IAAgB,CAAC,GAAG;IAAEI,cAAA,EAAgB;EAAK,IAAI;EAEnF,MAAM;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I,CAACU,YAAY;IACnCI;EACF;AACF","ignoreList":[]}
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":"AAEA,SAASA,QAAQ,QAAQ;AACzB,SAASC,cAAc,QAAQ;AAC/B,YAAYC,EAAA,MAAQ;AAIpB,SAASC,OAAO,QAAQ;AACxB,SAASC,YAAY,QAAQ;AAC7B,SAASC,kBAAkB,QAAQ;AACnC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,kBAAkB,QAAQ;AAEnC,OAAO,MAAMC,QAAA,GAAW,MAAAA,CAAO;EAC7BC,MAAA,EAAQC,aAAa;EACrBC,SAAS;EACTC,KAAK;EACLC,WAAA,GAAc,CAAC,CAAC;EAChBC,YAAY;EACZC;AAAY,CACP;EACL,MAAMC,WAAA,GAAc,G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C,YAAA;IACA7B,eAAA;IACAjB,MAAA;IACAC,WAAA;IACAwC,UAAA;IACAvC,GAAA;IACA4B,YAAA,EAAc5B,GAAA,CAAIkB,IAAI,CAACU,YAAY;IACnCI;EACF;AACF","ignoreList":[]}
@@ -15,6 +15,14 @@ export type Args = {
15
15
  * The current route, i.e. `/admin/collections/posts`.
16
16
  */
17
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
+ };
18
26
  /**
19
27
  * The search parameters of the current route provided to all pages in Next.js.
20
28
  */
@@ -1 +1 @@
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;;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
+ {"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 +1 @@
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 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":[]}
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":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"getRouteData.d.ts","sourceRoot":"","sources":["../../../src/views/Root/getRouteData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,SAAS,EACV,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAiCjE,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAA;IAC1C,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,oBAAoB,CAAC,CAAA;CAC1D,CAAA;AAaD,KAAK,gBAAgB,GAAG;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,eAAe,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,SAAS,CAAA;IACpB,YA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SAAS,EAAE,SAAS,CAAA;IACpB,YAAY,EAAE;QACZ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;KACjC,CAAA;IACD,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB,CAAA;AAED,KAAK,kBAAkB,GAAG;IACxB,mBAAmB,EAAE,cAAc,EAAE,CAAA;IACrC,WAAW,EAAE,cAAc,CAAA;IAC3B,mBAAmB,CAAC,EAAE,oBAAoB,CAAA;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/C,WAAW,EAAE,mBAAmB,CAAA;IAChC,iBAAiB,EAAE,MAAM,CAAA;IACzB,YAAY,EAAE,SAAS,GAAG,SAAS,CAAA;IACnC,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,YAAY,6EAOtB,gBAAgB,KAAG,kBA6QrB,CAAA"}
@@ -52,6 +52,7 @@ export const getRouteData = ({
52
52
  config,
53
53
  importMap,
54
54
  route: currentRoute,
55
+ routeParams: {},
55
56
  searchParams
56
57
  };
57
58
  const [segmentOne, segmentTwo, segmentThree, segmentFour, segmentFive] = segments;
@@ -154,6 +155,7 @@ export const getRouteData = ({
154
155
  viewType = 'reset';
155
156
  } else if (isBrowseByFolderEnabled && `/${segmentOne}` === config.admin.routes.browseByFolder) {
156
157
  // --> /browse-by-folder/:folderID
158
+ initPageOptions.routeParams.folderID = folderID;
157
159
  ViewToRender = {
158
160
  Component: oneSegmentViews.browseByFolder
159
161
  };
@@ -163,6 +165,7 @@ export const getRouteData = ({
163
165
  folderID = segmentTwo;
164
166
  } else if (isCollection && matchedCollection) {
165
167
  // --> /collections/:collectionSlug
168
+ initPageOptions.routeParams.collection = matchedCollection.slug;
166
169
  ViewToRender = {
167
170
  Component: ListView
168
171
  };
@@ -172,6 +175,7 @@ export const getRouteData = ({
172
175
  serverProps.viewActions = serverProps.viewActions.concat(matchedCollection.admin.components?.views?.list?.actions);
173
176
  } else if (isGlobal && matchedGlobal) {
174
177
  // --> /globals/:globalSlug
178
+ initPageOptions.routeParams.global = matchedGlobal.slug;
175
179
  ViewToRender = {
176
180
  Component: DocumentView
177
181
  };
@@ -189,6 +193,7 @@ export const getRouteData = ({
189
193
  default:
190
194
  if (segmentTwo === 'verify') {
191
195
  // --> /:collectionSlug/verify/:token
196
+ initPageOptions.routeParams.collection = segmentOne;
192
197
  ViewToRender = {
193
198
  Component: Verify
194
199
  };
@@ -196,10 +201,13 @@ export const getRouteData = ({
196
201
  templateType = 'minimal';
197
202
  viewType = 'verify';
198
203
  } else if (isCollection && matchedCollection) {
204
+ initPageOptions.routeParams.collection = matchedCollection.slug;
199
205
  if (config.folders && segmentThree === config.folders.slug && matchedCollection.folders) {
200
206
  // Collection Folder Views
201
207
  // --> /collections/:collectionSlug/:folderCollectionSlug
202
208
  // --> /collections/:collectionSlug/:folderCollectionSlug/:folderID
209
+ initPageOptions.routeParams.folderCollection = segmentThree;
210
+ initPageOptions.routeParams.folderID = segmentFour;
203
211
  ViewToRender = {
204
212
  Component: CollectionFolderView
205
213
  };
@@ -214,6 +222,8 @@ export const getRouteData = ({
214
222
  // --> /collections/:collectionSlug/:id/preview
215
223
  // --> /collections/:collectionSlug/:id/versions
216
224
  // --> /collections/:collectionSlug/:id/versions/:versionID
225
+ initPageOptions.routeParams.id = segmentThree;
226
+ initPageOptions.routeParams.versionID = segmentFive;
217
227
  ViewToRender = {
218
228
  Component: DocumentView
219
229
  };
@@ -234,6 +244,8 @@ export const getRouteData = ({
234
244
  // --> /globals/:globalSlug/preview
235
245
  // --> /globals/:globalSlug/versions/:versionID
236
246
  // --> /globals/:globalSlug/api
247
+ initPageOptions.routeParams.global = matchedGlobal.slug;
248
+ initPageOptions.routeParams.versionID = segmentFour;
237
249
  ViewToRender = {
238
250
  Component: DocumentView
239
251
  };
@@ -1 +1 @@
1
- {"version":3,"file":"getRouteData.js","names":["formatAdminURL","Account","BrowseByFolder","CollectionFolderView","CreateFirstUserView","Dashboard","Document","DocumentView","forgotPasswordBaseClass","ForgotPasswordView","ListView","loginBaseClass","LoginView","LogoutInactivity","LogoutView","ResetPassword","resetPasswordBaseClass","UnauthorizedView","Verify","verifyBaseClass","attachViewActions","getViewActions","getCustomViewByRoute","getDocumentViewInfo","isPathMatchingRoute","baseClasses","account","folders","forgot","login","reset","verify","oneSegmentViews","browseByFolder","createFirstUser","inactivity","logout","unauthorized","getRouteData","adminRoute","config","currentRoute","importMap","searchParams","segments","ViewToRender","templateClassName","templateType","documentSubViewType","viewType","folderID","initPageOptions","route","segmentOne","segmentTwo","segmentThree","segmentFour","segmentFive","isGlobal","isCollection","matchedCollection","undefined","matchedGlobal","isBrowseByFolderEnabled","browseByFolderSlugs","collections","reduce","acc","slug","serverProps","viewActions","admin","components","actions","find","collectionConfig","globals","globalConfig","length","Component","viewKey","routes","matchedRoute","Object","entries","exact","path","concat","views","list","editConfig","edit","viewInfo","collectionOrGlobal","viewKeyArg","view","reverse","DefaultView"],"sources":["../../../src/views/Root/getRouteData.ts"],"sourcesContent":["import type {\n AdminViewServerProps,\n CollectionSlug,\n DocumentSubViewTypes,\n ImportMap,\n PayloadComponent,\n SanitizedConfig,\n ServerPropsFromView,\n ViewTypes,\n} from 'payload'\nimport type React from 'react'\n\nimport { formatAdminURL } from 'payload/shared'\n\nimport type { initPage } from '../../utilities/initPage/index.js'\n\nimport { Account } from '../Account/index.js'\nimport { BrowseByFolder } from '../BrowseByFolder/index.js'\nimport { CollectionFolderView } from '../CollectionFolders/index.js'\nimport { CreateFirstUserView } from '../CreateFirstUser/index.js'\nimport { Dashboard } from '../Dashboard/index.js'\nimport { Document as DocumentView } from '../Document/index.js'\nimport { forgotPasswordBaseClass, ForgotPasswordView } from '../ForgotPassword/index.js'\nimport { ListView } from '../List/index.js'\nimport { loginBaseClass, LoginView } from '../Login/index.js'\nimport { LogoutInactivity, LogoutView } from '../Logout/index.js'\nimport { ResetPassword, resetPasswordBaseClass } from '../ResetPassword/index.js'\nimport { UnauthorizedView } from '../Unauthorized/index.js'\nimport { Verify, verifyBaseClass } from '../Verify/index.js'\nimport { attachViewActions, getViewActions } from './attachViewActions.js'\nimport { getCustomViewByRoute } from './getCustomViewByRoute.js'\nimport { getDocumentViewInfo } from './getDocumentViewInfo.js'\nimport { isPathMatchingRoute } from './isPathMatchingRoute.js'\n\nconst baseClasses = {\n account: 'account',\n folders: 'folders',\n forgot: forgotPasswordBaseClass,\n login: loginBaseClass,\n reset: resetPasswordBaseClass,\n verify: verifyBaseClass,\n}\n\ntype OneSegmentViews = {\n [K in Exclude<keyof SanitizedConfig['admin']['routes'], 'reset'>]: React.FC<AdminViewServerProps>\n}\n\nexport type ViewFromConfig = {\n Component?: React.FC<AdminViewServerProps>\n payloadComponent?: PayloadComponent<AdminViewServerProps>\n}\n\nconst oneSegmentViews: OneSegmentViews = {\n account: Account,\n browseByFolder: BrowseByFolder,\n createFirstUser: CreateFirstUserView,\n forgot: ForgotPasswordView,\n inactivity: LogoutInactivity,\n login: LoginView,\n logout: LogoutView,\n unauthorized: UnauthorizedView,\n}\n\ntype GetRouteDataArgs = {\n adminRoute: string\n config: SanitizedConfig\n currentRoute: string\n importMap: ImportMap\n searchParams: {\n [key: string]: string | string[]\n }\n segments: string[]\n}\n\ntype GetRouteDataResult = {\n browseByFolderSlugs: CollectionSlug[]\n DefaultView: ViewFromConfig\n documentSubViewType?: DocumentSubViewTypes\n folderID?: string\n initPageOptions: Parameters<typeof initPage>[0]\n serverProps: ServerPropsFromView\n templateClassName: string\n templateType: 'default' | 'minimal'\n viewType?: ViewTypes\n}\n\nexport const getRouteData = ({\n adminRoute,\n config,\n currentRoute,\n importMap,\n searchParams,\n segments,\n}: GetRouteDataArgs): GetRouteDataResult => {\n let ViewToRender: ViewFromConfig = null\n let templateClassName: string\n let templateType: 'default' | 'minimal' | undefined\n let documentSubViewType: DocumentSubViewTypes\n let viewType: ViewTypes\n let folderID: string\n\n const initPageOptions: Parameters<typeof initPage>[0] = {\n config,\n importMap,\n route: currentRoute,\n searchParams,\n }\n\n const [segmentOne, segmentTwo, segmentThree, segmentFour, segmentFive] = segments\n\n const isGlobal = segmentOne === 'globals'\n const isCollection = segmentOne === 'collections'\n let matchedCollection: SanitizedConfig['collections'][number] = undefined\n let matchedGlobal: SanitizedConfig['globals'][number] = undefined\n\n const isBrowseByFolderEnabled = config.folders && config.folders.browseByFolder\n const browseByFolderSlugs =\n (isBrowseByFolderEnabled &&\n config.collections.reduce((acc, { slug, folders }) => {\n if (folders && folders.browseByFolder) {\n return [...acc, slug]\n }\n return acc\n }, [])) ||\n []\n\n const serverProps: ServerPropsFromView = {\n viewActions: config?.admin?.components?.actions || [],\n }\n\n if (isCollection) {\n matchedCollection = config.collections.find(({ slug }) => slug === segmentTwo)\n serverProps.collectionConfig = matchedCollection\n }\n\n if (isGlobal) {\n matchedGlobal = config.globals.find(({ slug }) => slug === segmentTwo)\n serverProps.globalConfig = matchedGlobal\n }\n\n switch (segments.length) {\n case 0: {\n if (currentRoute === adminRoute) {\n ViewToRender = {\n Component: Dashboard,\n }\n templateClassName = 'dashboard'\n templateType = 'default'\n viewType = 'dashboard'\n }\n break\n }\n case 1: {\n // users can override the default routes via `admin.routes` config\n // i.e.{ admin: { routes: { logout: '/sign-out', inactivity: '/idle' }}}\n let viewKey: keyof typeof oneSegmentViews\n\n if (config.admin.routes) {\n const matchedRoute = Object.entries(config.admin.routes).find(([, route]) => {\n return isPathMatchingRoute({\n currentRoute,\n exact: true,\n path: formatAdminURL({ adminRoute, path: route }),\n })\n })\n\n if (matchedRoute) {\n viewKey = matchedRoute[0] as keyof typeof oneSegmentViews\n }\n }\n\n if (oneSegmentViews[viewKey]) {\n // --> /account\n // --> /create-first-user\n // --> /browse-by-folder\n // --> /forgot\n // --> /login\n // --> /logout\n // --> /logout-inactivity\n // --> /unauthorized\n\n ViewToRender = {\n Component: oneSegmentViews[viewKey],\n }\n\n templateClassName = baseClasses[viewKey]\n templateType = 'minimal'\n\n if (viewKey === 'account') {\n templateType = 'default'\n viewType = 'account'\n }\n\n if (isBrowseByFolderEnabled && viewKey === 'browseByFolder') {\n templateType = 'default'\n viewType = 'folders'\n }\n }\n break\n }\n case 2: {\n if (`/${segmentOne}` === config.admin.routes.reset) {\n // --> /reset/:token\n ViewToRender = {\n Component: ResetPassword,\n }\n templateClassName = baseClasses[segmentTwo]\n templateType = 'minimal'\n viewType = 'reset'\n } else if (\n isBrowseByFolderEnabled &&\n `/${segmentOne}` === config.admin.routes.browseByFolder\n ) {\n // --> /browse-by-folder/:folderID\n ViewToRender = {\n Component: oneSegmentViews.browseByFolder,\n }\n templateClassName = baseClasses.folders\n templateType = 'default'\n viewType = 'folders'\n folderID = segmentTwo\n } else if (isCollection && matchedCollection) {\n // --> /collections/:collectionSlug\n\n ViewToRender = {\n Component: ListView,\n }\n\n templateClassName = `${segmentTwo}-list`\n templateType = 'default'\n viewType = 'list'\n serverProps.viewActions = serverProps.viewActions.concat(\n matchedCollection.admin.components?.views?.list?.actions,\n )\n } else if (isGlobal && matchedGlobal) {\n // --> /globals/:globalSlug\n\n ViewToRender = {\n Component: DocumentView,\n }\n\n templateClassName = 'global-edit'\n templateType = 'default'\n viewType = 'document'\n\n // add default view actions\n serverProps.viewActions = serverProps.viewActions.concat(\n getViewActions({\n editConfig: matchedGlobal.admin?.components?.views?.edit,\n viewKey: 'default',\n }),\n )\n }\n break\n }\n default:\n if (segmentTwo === 'verify') {\n // --> /:collectionSlug/verify/:token\n ViewToRender = {\n Component: Verify,\n }\n\n templateClassName = 'verify'\n templateType = 'minimal'\n viewType = 'verify'\n } else if (isCollection && matchedCollection) {\n if (config.folders && segmentThree === config.folders.slug && matchedCollection.folders) {\n // Collection Folder Views\n // --> /collections/:collectionSlug/:folderCollectionSlug\n // --> /collections/:collectionSlug/:folderCollectionSlug/:folderID\n ViewToRender = {\n Component: CollectionFolderView,\n }\n\n templateClassName = `collection-folders`\n templateType = 'default'\n viewType = 'collection-folders'\n folderID = segmentFour\n } else {\n // Collection Edit Views\n // --> /collections/:collectionSlug/:id\n // --> /collections/:collectionSlug/:id/api\n // --> /collections/:collectionSlug/:id/preview\n // --> /collections/:collectionSlug/:id/versions\n // --> /collections/:collectionSlug/:id/versions/:versionID\n ViewToRender = {\n Component: DocumentView,\n }\n\n templateClassName = `collection-default-edit`\n templateType = 'default'\n\n const viewInfo = getDocumentViewInfo([segmentFour, segmentFive])\n viewType = viewInfo.viewType\n documentSubViewType = viewInfo.documentSubViewType\n\n attachViewActions({\n collectionOrGlobal: matchedCollection,\n serverProps,\n viewKeyArg: documentSubViewType,\n })\n }\n } else if (isGlobal && matchedGlobal) {\n // Global Edit Views\n // --> /globals/:globalSlug/versions\n // --> /globals/:globalSlug/preview\n // --> /globals/:globalSlug/versions/:versionID\n // --> /globals/:globalSlug/api\n\n ViewToRender = {\n Component: DocumentView,\n }\n\n templateClassName = `global-edit`\n templateType = 'default'\n\n const viewInfo = getDocumentViewInfo([segmentThree, segmentFour])\n viewType = viewInfo.viewType\n documentSubViewType = viewInfo.documentSubViewType\n\n attachViewActions({\n collectionOrGlobal: matchedGlobal,\n serverProps,\n viewKeyArg: documentSubViewType,\n })\n }\n break\n }\n\n if (!ViewToRender) {\n ViewToRender = getCustomViewByRoute({ config, currentRoute })?.view\n }\n\n serverProps.viewActions.reverse()\n\n return {\n browseByFolderSlugs,\n DefaultView: ViewToRender,\n documentSubViewType,\n folderID,\n initPageOptions,\n serverProps,\n templateClassName,\n templateType,\n viewType,\n }\n}\n"],"mappings":"AAYA,SAASA,cAAc,QAAQ;AAI/B,SAASC,OAAO,QAAQ;AACxB,SAASC,cAAc,QAAQ;AAC/B,SAASC,oBAAoB,QAAQ;AACrC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,SAAS,QAAQ;AAC1B,SAASC,QAAA,IAAYC,YAAY,QAAQ;AACzC,SAASC,uBAAuB,EAAEC,kBAAk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{"version":3,"file":"getRouteData.js","names":["formatAdminURL","Account","BrowseByFolder","CollectionFolderView","CreateFirstUserView","Dashboard","Document","DocumentView","forgotPasswordBaseClass","ForgotPasswordView","ListView","loginBaseClass","LoginView","LogoutInactivity","LogoutView","ResetPassword","resetPasswordBaseClass","UnauthorizedView","Verify","verifyBaseClass","attachViewActions","getViewActions","getCustomViewByRoute","getDocumentViewInfo","isPathMatchingRoute","baseClasses","account","folders","forgot","login","reset","verify","oneSegmentViews","browseByFolder","createFirstUser","inactivity","logout","unauthorized","getRouteData","adminRoute","config","currentRoute","importMap","searchParams","segments","ViewToRender","templateClassName","templateType","documentSubViewType","viewType","folderID","initPageOptions","route","routeParams","segmentOne","segmentTwo","segmentThree","segmentFour","segmentFive","isGlobal","isCollection","matchedCollection","undefined","matchedGlobal","isBrowseByFolderEnabled","browseByFolderSlugs","collections","reduce","acc","slug","serverProps","viewActions","admin","components","actions","find","collectionConfig","globals","globalConfig","length","Component","viewKey","routes","matchedRoute","Object","entries","exact","path","collection","concat","views","list","global","editConfig","edit","folderCollection","id","versionID","viewInfo","collectionOrGlobal","viewKeyArg","view","reverse","DefaultView"],"sources":["../../../src/views/Root/getRouteData.ts"],"sourcesContent":["import type {\n AdminViewServerProps,\n CollectionSlug,\n DocumentSubViewTypes,\n ImportMap,\n PayloadComponent,\n SanitizedConfig,\n ServerPropsFromView,\n ViewTypes,\n} from 'payload'\nimport type React from 'react'\n\nimport { formatAdminURL } from 'payload/shared'\n\nimport type { initPage } from '../../utilities/initPage/index.js'\n\nimport { Account } from '../Account/index.js'\nimport { BrowseByFolder } from '../BrowseByFolder/index.js'\nimport { CollectionFolderView } from '../CollectionFolders/index.js'\nimport { CreateFirstUserView } from '../CreateFirstUser/index.js'\nimport { Dashboard } from '../Dashboard/index.js'\nimport { Document as DocumentView } from '../Document/index.js'\nimport { forgotPasswordBaseClass, ForgotPasswordView } from '../ForgotPassword/index.js'\nimport { ListView } from '../List/index.js'\nimport { loginBaseClass, LoginView } from '../Login/index.js'\nimport { LogoutInactivity, LogoutView } from '../Logout/index.js'\nimport { ResetPassword, resetPasswordBaseClass } from '../ResetPassword/index.js'\nimport { UnauthorizedView } from '../Unauthorized/index.js'\nimport { Verify, verifyBaseClass } from '../Verify/index.js'\nimport { attachViewActions, getViewActions } from './attachViewActions.js'\nimport { getCustomViewByRoute } from './getCustomViewByRoute.js'\nimport { getDocumentViewInfo } from './getDocumentViewInfo.js'\nimport { isPathMatchingRoute } from './isPathMatchingRoute.js'\n\nconst baseClasses = {\n account: 'account',\n folders: 'folders',\n forgot: forgotPasswordBaseClass,\n login: loginBaseClass,\n reset: resetPasswordBaseClass,\n verify: verifyBaseClass,\n}\n\ntype OneSegmentViews = {\n [K in Exclude<keyof SanitizedConfig['admin']['routes'], 'reset'>]: React.FC<AdminViewServerProps>\n}\n\nexport type ViewFromConfig = {\n Component?: React.FC<AdminViewServerProps>\n payloadComponent?: PayloadComponent<AdminViewServerProps>\n}\n\nconst oneSegmentViews: OneSegmentViews = {\n account: Account,\n browseByFolder: BrowseByFolder,\n createFirstUser: CreateFirstUserView,\n forgot: ForgotPasswordView,\n inactivity: LogoutInactivity,\n login: LoginView,\n logout: LogoutView,\n unauthorized: UnauthorizedView,\n}\n\ntype GetRouteDataArgs = {\n adminRoute: string\n config: SanitizedConfig\n currentRoute: string\n importMap: ImportMap\n searchParams: {\n [key: string]: string | string[]\n }\n segments: string[]\n}\n\ntype GetRouteDataResult = {\n browseByFolderSlugs: CollectionSlug[]\n DefaultView: ViewFromConfig\n documentSubViewType?: DocumentSubViewTypes\n folderID?: string\n initPageOptions: Parameters<typeof initPage>[0]\n serverProps: ServerPropsFromView\n templateClassName: string\n templateType: 'default' | 'minimal'\n viewType?: ViewTypes\n}\n\nexport const getRouteData = ({\n adminRoute,\n config,\n currentRoute,\n importMap,\n searchParams,\n segments,\n}: GetRouteDataArgs): GetRouteDataResult => {\n let ViewToRender: ViewFromConfig = null\n let templateClassName: string\n let templateType: 'default' | 'minimal' | undefined\n let documentSubViewType: DocumentSubViewTypes\n let viewType: ViewTypes\n let folderID: string\n\n const initPageOptions: Parameters<typeof initPage>[0] = {\n config,\n importMap,\n route: currentRoute,\n routeParams: {},\n searchParams,\n }\n\n const [segmentOne, segmentTwo, segmentThree, segmentFour, segmentFive] = segments\n\n const isGlobal = segmentOne === 'globals'\n const isCollection = segmentOne === 'collections'\n let matchedCollection: SanitizedConfig['collections'][number] = undefined\n let matchedGlobal: SanitizedConfig['globals'][number] = undefined\n\n const isBrowseByFolderEnabled = config.folders && config.folders.browseByFolder\n const browseByFolderSlugs =\n (isBrowseByFolderEnabled &&\n config.collections.reduce((acc, { slug, folders }) => {\n if (folders && folders.browseByFolder) {\n return [...acc, slug]\n }\n return acc\n }, [])) ||\n []\n\n const serverProps: ServerPropsFromView = {\n viewActions: config?.admin?.components?.actions || [],\n }\n\n if (isCollection) {\n matchedCollection = config.collections.find(({ slug }) => slug === segmentTwo)\n serverProps.collectionConfig = matchedCollection\n }\n\n if (isGlobal) {\n matchedGlobal = config.globals.find(({ slug }) => slug === segmentTwo)\n serverProps.globalConfig = matchedGlobal\n }\n\n switch (segments.length) {\n case 0: {\n if (currentRoute === adminRoute) {\n ViewToRender = {\n Component: Dashboard,\n }\n templateClassName = 'dashboard'\n templateType = 'default'\n viewType = 'dashboard'\n }\n break\n }\n case 1: {\n // users can override the default routes via `admin.routes` config\n // i.e.{ admin: { routes: { logout: '/sign-out', inactivity: '/idle' }}}\n let viewKey: keyof typeof oneSegmentViews\n\n if (config.admin.routes) {\n const matchedRoute = Object.entries(config.admin.routes).find(([, route]) => {\n return isPathMatchingRoute({\n currentRoute,\n exact: true,\n path: formatAdminURL({ adminRoute, path: route }),\n })\n })\n\n if (matchedRoute) {\n viewKey = matchedRoute[0] as keyof typeof oneSegmentViews\n }\n }\n\n if (oneSegmentViews[viewKey]) {\n // --> /account\n // --> /create-first-user\n // --> /browse-by-folder\n // --> /forgot\n // --> /login\n // --> /logout\n // --> /logout-inactivity\n // --> /unauthorized\n\n ViewToRender = {\n Component: oneSegmentViews[viewKey],\n }\n\n templateClassName = baseClasses[viewKey]\n templateType = 'minimal'\n\n if (viewKey === 'account') {\n templateType = 'default'\n viewType = 'account'\n }\n\n if (isBrowseByFolderEnabled && viewKey === 'browseByFolder') {\n templateType = 'default'\n viewType = 'folders'\n }\n }\n break\n }\n case 2: {\n if (`/${segmentOne}` === config.admin.routes.reset) {\n // --> /reset/:token\n ViewToRender = {\n Component: ResetPassword,\n }\n templateClassName = baseClasses[segmentTwo]\n templateType = 'minimal'\n viewType = 'reset'\n } else if (\n isBrowseByFolderEnabled &&\n `/${segmentOne}` === config.admin.routes.browseByFolder\n ) {\n // --> /browse-by-folder/:folderID\n initPageOptions.routeParams.folderID = folderID\n\n ViewToRender = {\n Component: oneSegmentViews.browseByFolder,\n }\n templateClassName = baseClasses.folders\n templateType = 'default'\n viewType = 'folders'\n folderID = segmentTwo\n } else if (isCollection && matchedCollection) {\n // --> /collections/:collectionSlug\n initPageOptions.routeParams.collection = matchedCollection.slug\n\n ViewToRender = {\n Component: ListView,\n }\n\n templateClassName = `${segmentTwo}-list`\n templateType = 'default'\n viewType = 'list'\n serverProps.viewActions = serverProps.viewActions.concat(\n matchedCollection.admin.components?.views?.list?.actions,\n )\n } else if (isGlobal && matchedGlobal) {\n // --> /globals/:globalSlug\n initPageOptions.routeParams.global = matchedGlobal.slug\n\n ViewToRender = {\n Component: DocumentView,\n }\n\n templateClassName = 'global-edit'\n templateType = 'default'\n viewType = 'document'\n\n // add default view actions\n serverProps.viewActions = serverProps.viewActions.concat(\n getViewActions({\n editConfig: matchedGlobal.admin?.components?.views?.edit,\n viewKey: 'default',\n }),\n )\n }\n break\n }\n default:\n if (segmentTwo === 'verify') {\n // --> /:collectionSlug/verify/:token\n initPageOptions.routeParams.collection = segmentOne\n\n ViewToRender = {\n Component: Verify,\n }\n\n templateClassName = 'verify'\n templateType = 'minimal'\n viewType = 'verify'\n } else if (isCollection && matchedCollection) {\n initPageOptions.routeParams.collection = matchedCollection.slug\n if (config.folders && segmentThree === config.folders.slug && matchedCollection.folders) {\n // Collection Folder Views\n // --> /collections/:collectionSlug/:folderCollectionSlug\n // --> /collections/:collectionSlug/:folderCollectionSlug/:folderID\n initPageOptions.routeParams.folderCollection = segmentThree\n initPageOptions.routeParams.folderID = segmentFour\n\n ViewToRender = {\n Component: CollectionFolderView,\n }\n\n templateClassName = `collection-folders`\n templateType = 'default'\n viewType = 'collection-folders'\n folderID = segmentFour\n } else {\n // Collection Edit Views\n // --> /collections/:collectionSlug/:id\n // --> /collections/:collectionSlug/:id/api\n // --> /collections/:collectionSlug/:id/preview\n // --> /collections/:collectionSlug/:id/versions\n // --> /collections/:collectionSlug/:id/versions/:versionID\n initPageOptions.routeParams.id = segmentThree\n initPageOptions.routeParams.versionID = segmentFive\n\n ViewToRender = {\n Component: DocumentView,\n }\n\n templateClassName = `collection-default-edit`\n templateType = 'default'\n\n const viewInfo = getDocumentViewInfo([segmentFour, segmentFive])\n viewType = viewInfo.viewType\n documentSubViewType = viewInfo.documentSubViewType\n\n attachViewActions({\n collectionOrGlobal: matchedCollection,\n serverProps,\n viewKeyArg: documentSubViewType,\n })\n }\n } else if (isGlobal && matchedGlobal) {\n // Global Edit Views\n // --> /globals/:globalSlug/versions\n // --> /globals/:globalSlug/preview\n // --> /globals/:globalSlug/versions/:versionID\n // --> /globals/:globalSlug/api\n initPageOptions.routeParams.global = matchedGlobal.slug\n initPageOptions.routeParams.versionID = segmentFour\n\n ViewToRender = {\n Component: DocumentView,\n }\n\n templateClassName = `global-edit`\n templateType = 'default'\n\n const viewInfo = getDocumentViewInfo([segmentThree, segmentFour])\n viewType = viewInfo.viewType\n documentSubViewType = viewInfo.documentSubViewType\n\n attachViewActions({\n collectionOrGlobal: matchedGlobal,\n serverProps,\n viewKeyArg: documentSubViewType,\n })\n }\n break\n }\n\n if (!ViewToRender) {\n ViewToRender = getCustomViewByRoute({ config, currentRoute })?.view\n }\n\n serverProps.viewActions.reverse()\n\n return {\n browseByFolderSlugs,\n DefaultView: ViewToRender,\n documentSubViewType,\n folderID,\n initPageOptions,\n serverProps,\n templateClassName,\n templateType,\n viewType,\n }\n}\n"],"mappings":"AAYA,SAASA,cAAc,QAAQ;AAI/B,SAASC,OAAO,QAAQ;AACxB,SAASC,cAAc,QAAQ;AAC/B,SAASC,oBAAoB,QAAQ;AACrC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,SAAS,QAAQ;AAC1B,SAASC,QAAA,IAAYC,YAAY,QAAQ;AACzC,SAASC,uBAAuB,EAAEC,kBAAkB,QAAQ;AAC5D,SAASC,QAAQ,QAAQ;AACzB,SAASC,cAAc,EAAEC,SAAS,QAAQ;AAC1C,SAASC,gBAAgB,EAAEC,UAAU,QAAQ;AAC7C,SAASC,aAAa,EAAEC,sBAAsB,QAAQ;AACtD,SAASC,gBAAgB,QAAQ;AACjC,SAASC,MAAM,EAAEC,eAAe,QAAQ;AACxC,SAASC,iBAAiB,EAAEC,cAAc,QAAQ;AAClD,SAASC,oBAAoB,QAAQ;AACrC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,mBAAmB,QAAQ;AAEpC,MAAMC,WAAA,GAAc;EAClBC,OAAA,EAAS;EACTC,OAAA,EAAS;EACTC,MAAA,EAAQpB,uBAAA;EACRqB,KAAA,EAAOlB,cAAA;EACPmB,KAAA,EAAOd,sBAAA;EACPe,MAAA,EAAQZ;AACV;AAWA,MAAMa,eAAA,GAAmC;EACvCN,OAAA,EAASzB,OAAA;EACTgC,cAAA,EAAgB/B,cAAA;EAChBgC,eAAA,EAAiB9B,mBAAA;EACjBwB,MAAA,EAAQnB,kBAAA;EACR0B,UAAA,EAAYtB,gBAAA;EACZgB,KAAA,EAAOjB,SAAA;EACPwB,MAAA,EAAQtB,UAAA;EACRuB,YAAA,EAAcpB;AAChB;AAyBA,OAAO,MAAMqB,YAAA,GAAeA,CAAC;EAC3BC,UAAU;EACVC,MAAM;EACNC,YAAY;EACZC,SAAS;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T,QAAA,GAAWiD,QAAA,CAASjD,QAAQ;UAC5BD,mBAAA,GAAsBkD,QAAA,CAASlD,mBAAmB;UAElD5B,iBAAA,CAAkB;YAChB+E,kBAAA,EAAoBtC,iBAAA;YACpBS,WAAA;YACA8B,UAAA,EAAYpD;UACd;QACF;MACF,OAAO,IAAIW,QAAA,IAAYI,aAAA,EAAe;QACpC;QACA;QACA;QACA;QACA;QACAZ,eAAA,CAAgBE,WAAW,CAACuC,MAAM,GAAG7B,aAAA,CAAcM,IAAI;QACvDlB,eAAA,CAAgBE,WAAW,CAAC4C,SAAS,GAAGxC,WAAA;QAExCZ,YAAA,GAAe;UACbmC,SAAA,EAAWzE;QACb;QAEAuC,iBAAA,GAAoB,aAAa;QACjCC,YAAA,GAAe;QAEf,MAAMmD,QAAA,GAAW3E,mBAAA,CAAoB,CAACiC,YAAA,EAAcC,WAAA,CAAY;QAChER,QAAA,GAAWiD,QAAA,CAASjD,QAAQ;QAC5BD,mBAAA,GAAsBkD,QAAA,CAASlD,mBAAmB;QAElD5B,iBAAA,CAAkB;UAChB+E,kBAAA,EAAoBpC,aAAA;UACpBO,WAAA;UACA8B,UAAA,EAAYpD;QACd;MACF;MACA;EACJ;EAEA,IAAI,CAACH,YAAA,EAAc;IACjBA,YAAA,GAAevB,oBAAA,CAAqB;MAAEkB,MAAA;MAAQC;IAAa,IAAI4D,IAAA;EACjE;EAEA/B,WAAA,CAAYC,WAAW,CAAC+B,OAAO;EAE/B,OAAO;IACLrC,mBAAA;IACAsC,WAAA,EAAa1D,YAAA;IACbG,mBAAA;IACAE,QAAA;IACAC,eAAA;IACAmB,WAAA;IACAxB,iBAAA;IACAC,YAAA;IACAE;EACF;AACF","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/next",
3
- "version": "3.42.0-internal.dfe4bec",
3
+ "version": "3.42.0",
4
4
  "homepage": "https://payloadcms.com",
5
5
  "repository": {
6
6
  "type": "git",
@@ -88,9 +88,9 @@
88
88
  "react-diff-viewer-continued": "4.0.5",
89
89
  "sass": "1.77.4",
90
90
  "uuid": "10.0.0",
91
- "@payloadcms/graphql": "3.42.0-internal.dfe4bec",
92
- "@payloadcms/ui": "3.42.0-internal.dfe4bec",
93
- "@payloadcms/translations": "3.42.0-internal.dfe4bec"
91
+ "@payloadcms/graphql": "3.42.0",
92
+ "@payloadcms/ui": "3.42.0",
93
+ "@payloadcms/translations": "3.42.0"
94
94
  },
95
95
  "devDependencies": {
96
96
  "@babel/cli": "7.27.2",
@@ -108,12 +108,12 @@
108
108
  "esbuild-sass-plugin": "3.3.1",
109
109
  "swc-plugin-transform-remove-imports": "4.0.4",
110
110
  "@payloadcms/eslint-config": "3.28.0",
111
- "payload": "3.42.0-internal.dfe4bec"
111
+ "payload": "3.42.0"
112
112
  },
113
113
  "peerDependencies": {
114
114
  "graphql": "^16.8.1",
115
115
  "next": "^15.2.3",
116
- "payload": "3.42.0-internal.dfe4bec"
116
+ "payload": "3.42.0"
117
117
  },
118
118
  "engines": {
119
119
  "node": "^18.20.2 || >=20.9.0"