@payloadcms/next 3.59.0-canary.0 → 3.59.0-canary.2

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.
@@ -6,7 +6,7 @@ export async function getRequestLocale({
6
6
  }) {
7
7
  if (req.payload.config.localization) {
8
8
  const localeFromParams = req.query.locale;
9
- if (localeFromParams) {
9
+ if (req.user && localeFromParams) {
10
10
  await upsertPreferences({
11
11
  key: 'locale',
12
12
  req,
@@ -1 +1 @@
1
- {"version":3,"file":"getRequestLocale.js","names":["upsertPreferences","findLocaleFromCode","getPreferences","getRequestLocale","req","payload","config","localization","localeFromParams","query","locale","key","value","user","id","collection","defaultLocale","undefined"],"sources":["../../src/utilities/getRequestLocale.ts"],"sourcesContent":["import type { Locale, PayloadRequest } from 'payload'\n\nimport { upsertPreferences } from '@payloadcms/ui/rsc'\nimport { findLocaleFromCode } from '@payloadcms/ui/shared'\n\nimport { getPreferences } from './getPreferences.js'\n\ntype GetRequestLocalesArgs = {\n req: PayloadRequest\n}\n\nexport async function getRequestLocale({ req }: GetRequestLocalesArgs): Promise<Locale> {\n if (req.payload.config.localization) {\n const localeFromParams = req.query.locale as string | undefined\n\n if (localeFromParams) {\n await upsertPreferences<Locale['code']>({ key: 'locale', req, value: localeFromParams })\n }\n\n return (\n (req.user &&\n findLocaleFromCode(\n req.payload.config.localization,\n localeFromParams ||\n (\n await getPreferences<Locale['code']>(\n 'locale',\n req.payload,\n req.user.id,\n req.user.collection,\n )\n )?.value,\n )) ||\n findLocaleFromCode(\n req.payload.config.localization,\n req.payload.config.localization.defaultLocale || 'en',\n )\n )\n }\n\n return undefined\n}\n"],"mappings":"AAEA,SAASA,iBAAiB,QAAQ;AAClC,SAASC,kBAAkB,QAAQ;AAEnC,SAASC,cAAc,QAAQ;AAM/B,OAAO,eAAeC,iBAAiB;EAAEC;AAAG,CAAyB;EACnE,IAAIA,GAAA,CAAIC,OAAO,CAACC,MAAM,CAACC,YAAY,EAAE;IACnC,MAAMC,gBAAA,GAAmBJ,GAAA,CAAIK,KAAK,CAACC,MAAM;IAEzC,IAAIF,gBAAA,EAAkB;MACpB,MAAMR,iBAAA,CAAkC;QAAEW,GAAA,EAAK;QAAUP,GAAA;QAAKQ,KAAA,EAAOJ;MAAiB;IACxF;IAEA,OACEJ,GAAC,CAAIS,IAAI,IACPZ,kBAAA,CACEG,GAAA,CAAIC,OAAO,CAACC,MAAM,CAACC,YAAY,EAC/BC,gBAAA,IAEI,OAAMN,cAAA,CACJ,UACAE,GAAA,CAAIC,OAAO,EACXD,GAAA,CAAIS,IAAI,CAACC,EAAE,EACXV,GAAA,CAAIS,IAAI,CAACE,UAAU,CACrB,GACCH,KAAA,KAETX,kBAAA,CACEG,GAAA,CAAIC,OAAO,CAACC,MAAM,CAACC,YAAY,EAC/BH,GAAA,CAAIC,OAAO,CAACC,MAAM,CAACC,YAAY,CAACS,aAAa,IAAI;EAGvD;EAEA,OAAOC,SAAA;AACT","ignoreList":[]}
1
+ {"version":3,"file":"getRequestLocale.js","names":["upsertPreferences","findLocaleFromCode","getPreferences","getRequestLocale","req","payload","config","localization","localeFromParams","query","locale","user","key","value","id","collection","defaultLocale","undefined"],"sources":["../../src/utilities/getRequestLocale.ts"],"sourcesContent":["import type { Locale, PayloadRequest } from 'payload'\n\nimport { upsertPreferences } from '@payloadcms/ui/rsc'\nimport { findLocaleFromCode } from '@payloadcms/ui/shared'\n\nimport { getPreferences } from './getPreferences.js'\n\ntype GetRequestLocalesArgs = {\n req: PayloadRequest\n}\n\nexport async function getRequestLocale({ req }: GetRequestLocalesArgs): Promise<Locale> {\n if (req.payload.config.localization) {\n const localeFromParams = req.query.locale as string | undefined\n\n if (req.user && localeFromParams) {\n await upsertPreferences<Locale['code']>({ key: 'locale', req, value: localeFromParams })\n }\n\n return (\n (req.user &&\n findLocaleFromCode(\n req.payload.config.localization,\n localeFromParams ||\n (\n await getPreferences<Locale['code']>(\n 'locale',\n req.payload,\n req.user.id,\n req.user.collection,\n )\n )?.value,\n )) ||\n findLocaleFromCode(\n req.payload.config.localization,\n req.payload.config.localization.defaultLocale || 'en',\n )\n )\n }\n\n return undefined\n}\n"],"mappings":"AAEA,SAASA,iBAAiB,QAAQ;AAClC,SAASC,kBAAkB,QAAQ;AAEnC,SAASC,cAAc,QAAQ;AAM/B,OAAO,eAAeC,iBAAiB;EAAEC;AAAG,CAAyB;EACnE,IAAIA,GAAA,CAAIC,OAAO,CAACC,MAAM,CAACC,YAAY,EAAE;IACnC,MAAMC,gBAAA,GAAmBJ,GAAA,CAAIK,KAAK,CAACC,MAAM;IAEzC,IAAIN,GAAA,CAAIO,IAAI,IAAIH,gBAAA,EAAkB;MAChC,MAAMR,iBAAA,CAAkC;QAAEY,GAAA,EAAK;QAAUR,GAAA;QAAKS,KAAA,EAAOL;MAAiB;IACxF;IAEA,OACEJ,GAAC,CAAIO,IAAI,IACPV,kBAAA,CACEG,GAAA,CAAIC,OAAO,CAACC,MAAM,CAACC,YAAY,EAC/BC,gBAAA,IAEI,OAAMN,cAAA,CACJ,UACAE,GAAA,CAAIC,OAAO,EACXD,GAAA,CAAIO,IAAI,CAACG,EAAE,EACXV,GAAA,CAAIO,IAAI,CAACI,UAAU,CACrB,GACCF,KAAA,KAETZ,kBAAA,CACEG,GAAA,CAAIC,OAAO,CAACC,MAAM,CAACC,YAAY,EAC/BH,GAAA,CAAIC,OAAO,CAACC,MAAM,CAACC,YAAY,CAACS,aAAa,IAAI;EAGvD;EAEA,OAAOC,SAAA;AACT","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"renderDocumentSlots.d.ts","sourceRoot":"","sources":["../../../src/views/Document/renderDocumentSlots.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EAEb,cAAc,EAGd,yBAAyB,EACzB,4BAA4B,EAC5B,qBAAqB,EAGrB,cAAc,EAKf,MAAM,SAAS,CAAA;AAOhB,eAAO,MAAM,mBAAmB,EAAE,CAAC,IAAI,EAAE;IACvC,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,iBAAiB,EAAE,OAAO,CAAA;IAC1B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,WAAW,EAAE,4BAA4B,CAAA;IACzC,GAAG,EAAE,cAAc,CAAA;CACpB,KAAK,aA2IL,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,cAAc,CAAC;IACtD,cAAc,EAAE,MAAM,CAAA;IACtB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACrB,CAsBA,CAAA"}
1
+ {"version":3,"file":"renderDocumentSlots.d.ts","sourceRoot":"","sources":["../../../src/views/Document/renderDocumentSlots.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,aAAa,EAEb,cAAc,EAGd,yBAAyB,EACzB,4BAA4B,EAC5B,qBAAqB,EAGrB,cAAc,EAKf,MAAM,SAAS,CAAA;AAOhB,eAAO,MAAM,mBAAmB,EAAE,CAAC,IAAI,EAAE;IACvC,gBAAgB,CAAC,EAAE,yBAAyB,CAAA;IAC5C,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,iBAAiB,EAAE,OAAO,CAAA;IAC1B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,WAAW,EAAE,4BAA4B,CAAA;IACzC,GAAG,EAAE,cAAc,CAAA;CACpB,KAAK,aAuJL,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,cAAc,CAAC;IACtD,cAAc,EAAE,MAAM,CAAA;IACtB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CACrB,CAsBA,CAAA"}
@@ -42,6 +42,14 @@ export const renderDocumentSlots = args => {
42
42
  serverProps: serverProps
43
43
  });
44
44
  }
45
+ const LivePreview = collectionConfig?.admin?.components?.views?.edit?.livePreview || globalConfig?.admin?.components?.views?.edit?.livePreview;
46
+ if (LivePreview?.Component) {
47
+ components.LivePreview = RenderServerComponent({
48
+ Component: LivePreview.Component,
49
+ importMap: req.payload.importMap,
50
+ serverProps
51
+ });
52
+ }
45
53
  const descriptionFromConfig = collectionConfig?.admin?.description || globalConfig?.admin?.description;
46
54
  const staticDescription = typeof descriptionFromConfig === 'function' ? descriptionFromConfig({
47
55
  t: req.i18n.t
@@ -1 +1 @@
1
- {"version":3,"file":"renderDocumentSlots.js","names":["ViewDescription","RenderServerComponent","getDocumentPermissions","renderDocumentSlots","args","id","collectionConfig","globalConfig","hasSavePermission","req","components","unsavedDraftWithValidations","undefined","isPreviewEnabled","admin","preview","serverProps","i18n","payload","user","BeforeDocumentControls","edit","beforeDocumentControls","elements","Component","importMap","EditMenuItems","editMenuItems","CustomPreviewButton","PreviewButton","descriptionFromConfig","description","staticDescription","t","CustomDescription","Description","hasDescription","clientProps","collectionSlug","slug","Fallback","versions","drafts","CustomPublishButton","PublishButton","CustomSaveDraftButton","SaveDraftButton","draftsEnabled","autosave","CustomSaveButton","SaveButton","upload","Upload","controls","UploadControls","renderDocumentSlotsHandler","collections","config","Error","docPermissions","data","permissions"],"sources":["../../../src/views/Document/renderDocumentSlots.tsx"],"sourcesContent":["import type {\n BeforeDocumentControlsServerPropsOnly,\n DocumentSlots,\n EditMenuItemsServerPropsOnly,\n PayloadRequest,\n PreviewButtonServerPropsOnly,\n PublishButtonServerPropsOnly,\n SanitizedCollectionConfig,\n SanitizedDocumentPermissions,\n SanitizedGlobalConfig,\n SaveButtonServerPropsOnly,\n SaveDraftButtonServerPropsOnly,\n ServerFunction,\n ServerProps,\n StaticDescription,\n ViewDescriptionClientProps,\n ViewDescriptionServerPropsOnly,\n} from 'payload'\n\nimport { ViewDescription } from '@payloadcms/ui'\nimport { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent'\n\nimport { getDocumentPermissions } from './getDocumentPermissions.js'\n\nexport const renderDocumentSlots: (args: {\n collectionConfig?: SanitizedCollectionConfig\n globalConfig?: SanitizedGlobalConfig\n hasSavePermission: boolean\n id?: number | string\n permissions: SanitizedDocumentPermissions\n req: PayloadRequest\n}) => DocumentSlots = (args) => {\n const { id, collectionConfig, globalConfig, hasSavePermission, req } = args\n\n const components: DocumentSlots = {} as DocumentSlots\n\n const unsavedDraftWithValidations = undefined\n\n const isPreviewEnabled = collectionConfig?.admin?.preview || globalConfig?.admin?.preview\n\n const serverProps: ServerProps = {\n id,\n i18n: req.i18n,\n payload: req.payload,\n user: req.user,\n // TODO: Add remaining serverProps\n }\n\n const BeforeDocumentControls =\n collectionConfig?.admin?.components?.edit?.beforeDocumentControls ||\n globalConfig?.admin?.components?.elements?.beforeDocumentControls\n\n if (BeforeDocumentControls) {\n components.BeforeDocumentControls = RenderServerComponent({\n Component: BeforeDocumentControls,\n importMap: req.payload.importMap,\n serverProps: serverProps satisfies BeforeDocumentControlsServerPropsOnly,\n })\n }\n\n const EditMenuItems = collectionConfig?.admin?.components?.edit?.editMenuItems\n\n if (EditMenuItems) {\n components.EditMenuItems = RenderServerComponent({\n Component: EditMenuItems,\n importMap: req.payload.importMap,\n serverProps: serverProps satisfies EditMenuItemsServerPropsOnly,\n })\n }\n\n const CustomPreviewButton =\n collectionConfig?.admin?.components?.edit?.PreviewButton ||\n globalConfig?.admin?.components?.elements?.PreviewButton\n\n if (isPreviewEnabled && CustomPreviewButton) {\n components.PreviewButton = RenderServerComponent({\n Component: CustomPreviewButton,\n importMap: req.payload.importMap,\n serverProps: serverProps satisfies PreviewButtonServerPropsOnly,\n })\n }\n\n const descriptionFromConfig =\n collectionConfig?.admin?.description || globalConfig?.admin?.description\n\n const staticDescription: StaticDescription =\n typeof descriptionFromConfig === 'function'\n ? descriptionFromConfig({ t: req.i18n.t })\n : descriptionFromConfig\n\n const CustomDescription =\n collectionConfig?.admin?.components?.Description ||\n globalConfig?.admin?.components?.elements?.Description\n\n const hasDescription = CustomDescription || staticDescription\n\n if (hasDescription) {\n components.Description = RenderServerComponent({\n clientProps: {\n collectionSlug: collectionConfig?.slug,\n description: staticDescription,\n } satisfies ViewDescriptionClientProps,\n Component: CustomDescription,\n Fallback: ViewDescription,\n importMap: req.payload.importMap,\n serverProps: serverProps satisfies ViewDescriptionServerPropsOnly,\n })\n }\n\n if (hasSavePermission) {\n if (collectionConfig?.versions?.drafts || globalConfig?.versions?.drafts) {\n const CustomPublishButton =\n collectionConfig?.admin?.components?.edit?.PublishButton ||\n globalConfig?.admin?.components?.elements?.PublishButton\n\n if (CustomPublishButton) {\n components.PublishButton = RenderServerComponent({\n Component: CustomPublishButton,\n importMap: req.payload.importMap,\n serverProps: serverProps satisfies PublishButtonServerPropsOnly,\n })\n }\n\n const CustomSaveDraftButton =\n collectionConfig?.admin?.components?.edit?.SaveDraftButton ||\n globalConfig?.admin?.components?.elements?.SaveDraftButton\n\n const draftsEnabled =\n (collectionConfig?.versions?.drafts && !collectionConfig?.versions?.drafts?.autosave) ||\n (globalConfig?.versions?.drafts && !globalConfig?.versions?.drafts?.autosave)\n\n if ((draftsEnabled || unsavedDraftWithValidations) && CustomSaveDraftButton) {\n components.SaveDraftButton = RenderServerComponent({\n Component: CustomSaveDraftButton,\n importMap: req.payload.importMap,\n serverProps: serverProps satisfies SaveDraftButtonServerPropsOnly,\n })\n }\n } else {\n const CustomSaveButton =\n collectionConfig?.admin?.components?.edit?.SaveButton ||\n globalConfig?.admin?.components?.elements?.SaveButton\n\n if (CustomSaveButton) {\n components.SaveButton = RenderServerComponent({\n Component: CustomSaveButton,\n importMap: req.payload.importMap,\n serverProps: serverProps satisfies SaveButtonServerPropsOnly,\n })\n }\n }\n }\n\n if (collectionConfig?.upload && collectionConfig?.admin?.components?.edit?.Upload) {\n components.Upload = RenderServerComponent({\n Component: collectionConfig.admin.components.edit.Upload,\n importMap: req.payload.importMap,\n serverProps,\n })\n }\n\n if (collectionConfig?.upload && collectionConfig.upload.admin?.components?.controls) {\n components.UploadControls = RenderServerComponent({\n Component: collectionConfig.upload.admin.components.controls,\n importMap: req.payload.importMap,\n serverProps,\n })\n }\n\n return components\n}\n\nexport const renderDocumentSlotsHandler: ServerFunction<{\n collectionSlug: string\n id?: number | string\n}> = async (args) => {\n const { id, collectionSlug, req } = args\n\n const collectionConfig = req.payload.collections[collectionSlug]?.config\n\n if (!collectionConfig) {\n throw new Error(req.t('error:incorrectCollection'))\n }\n\n const { docPermissions, hasSavePermission } = await getDocumentPermissions({\n collectionConfig,\n data: {},\n req,\n })\n\n return renderDocumentSlots({\n id,\n collectionConfig,\n hasSavePermission,\n permissions: docPermissions,\n req,\n })\n}\n"],"mappings":"AAmBA,SAASA,eAAe,QAAQ;AAChC,SAASC,qBAAqB,QAAQ;AAEtC,SAASC,sBAAsB,QAAQ;AAEvC,OAAO,MAAMC,mBAAA,GAOUC,IAAA;EACrB,MAAM;IAAEC,EAAE;IAAEC,gBAAgB;IAAEC,YAAY;IAAEC,iBAAiB;IAAEC;EAAG,CAAE,GAAGL,IAAA;EAEvE,MAAMM,UAAA,GAA4B,CAAC;EAEnC,MAAMC,2BAAA,GAA8BC,SAAA;EAEpC,MAAMC,gBAAA,GAAmBP,gBAAA,EAAkBQ,KAAA,EAAOC,OAAA,IAAWR,YAAA,EAAcO,KAAA,EAAOC,OAAA;EAElF,MAAMC,WAAA,GAA2B;IAC/BX,EAAA;IACAY,IAAA,EAAMR,GAAA,CAAIQ,IAAI;IACdC,OAAA,EAAST,GAAA,CAAIS,OAAO;IACpBC,IAAA,EAAMV,GAAA,CAAIU;EAEZ;EAEA,MAAMC,sBAAA,GACJd,gBAAA,EAAkBQ,KAAA,EAAOJ,UAAA,EAAYW,IAAA,EAAMC,sBAAA,IAC3Cf,YAAA,EAAcO,KAAA,EAAOJ,UAAA,EAAYa,QAAA,EAAUD,sBAAA;EAE7C,IAAIF,sBAAA,EAAwB;IAC1BV,UAAA,CAAWU,sBAAsB,GAAGnB,qBAAA,CAAsB;MACxDuB,SAAA,EAAWJ,sBAAA;MACXK,SAAA,EAAWhB,GAAA,CAAIS,OAAO,CAACO,SAAS;MAChCT,WA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GAAGL,IAAA;EAEpC,MAAME,gBAAA,GAAmBG,GAAA,CAAIS,OAAO,CAACsC,WAAW,CAAClB,cAAA,CAAe,EAAEmB,MAAA;EAElE,IAAI,CAACnD,gBAAA,EAAkB;IACrB,MAAM,IAAIoD,KAAA,CAAMjD,GAAA,CAAIwB,CAAC,CAAC;EACxB;EAEA,MAAM;IAAE0B,cAAc;IAAEnD;EAAiB,CAAE,GAAG,MAAMN,sBAAA,CAAuB;IACzEI,gBAAA;IACAsD,IAAA,EAAM,CAAC;IACPnD;EACF;EAEA,OAAON,mBAAA,CAAoB;IACzBE,EAAA;IACAC,gBAAA;IACAE,iBAAA;IACAqD,WAAA,EAAaF,cAAA;IACblD;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"renderDocumentSlots.js","names":["ViewDescription","RenderServerComponent","getDocumentPermissions","renderDocumentSlots","args","id","collectionConfig","globalConfig","hasSavePermission","req","components","unsavedDraftWithValidations","undefined","isPreviewEnabled","admin","preview","serverProps","i18n","payload","user","BeforeDocumentControls","edit","beforeDocumentControls","elements","Component","importMap","EditMenuItems","editMenuItems","CustomPreviewButton","PreviewButton","LivePreview","views","livePreview","descriptionFromConfig","description","staticDescription","t","CustomDescription","Description","hasDescription","clientProps","collectionSlug","slug","Fallback","versions","drafts","CustomPublishButton","PublishButton","CustomSaveDraftButton","SaveDraftButton","draftsEnabled","autosave","CustomSaveButton","SaveButton","upload","Upload","controls","UploadControls","renderDocumentSlotsHandler","collections","config","Error","docPermissions","data","permissions"],"sources":["../../../src/views/Document/renderDocumentSlots.tsx"],"sourcesContent":["import type {\n BeforeDocumentControlsServerPropsOnly,\n DocumentSlots,\n EditMenuItemsServerPropsOnly,\n PayloadRequest,\n PreviewButtonServerPropsOnly,\n PublishButtonServerPropsOnly,\n SanitizedCollectionConfig,\n SanitizedDocumentPermissions,\n SanitizedGlobalConfig,\n SaveButtonServerPropsOnly,\n SaveDraftButtonServerPropsOnly,\n ServerFunction,\n ServerProps,\n StaticDescription,\n ViewDescriptionClientProps,\n ViewDescriptionServerPropsOnly,\n} from 'payload'\n\nimport { ViewDescription } from '@payloadcms/ui'\nimport { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent'\n\nimport { getDocumentPermissions } from './getDocumentPermissions.js'\n\nexport const renderDocumentSlots: (args: {\n collectionConfig?: SanitizedCollectionConfig\n globalConfig?: SanitizedGlobalConfig\n hasSavePermission: boolean\n id?: number | string\n permissions: SanitizedDocumentPermissions\n req: PayloadRequest\n}) => DocumentSlots = (args) => {\n const { id, collectionConfig, globalConfig, hasSavePermission, req } = args\n\n const components: DocumentSlots = {} as DocumentSlots\n\n const unsavedDraftWithValidations = undefined\n\n const isPreviewEnabled = collectionConfig?.admin?.preview || globalConfig?.admin?.preview\n\n const serverProps: ServerProps = {\n id,\n i18n: req.i18n,\n payload: req.payload,\n user: req.user,\n // TODO: Add remaining serverProps\n }\n\n const BeforeDocumentControls =\n collectionConfig?.admin?.components?.edit?.beforeDocumentControls ||\n globalConfig?.admin?.components?.elements?.beforeDocumentControls\n\n if (BeforeDocumentControls) {\n components.BeforeDocumentControls = RenderServerComponent({\n Component: BeforeDocumentControls,\n importMap: req.payload.importMap,\n serverProps: serverProps satisfies BeforeDocumentControlsServerPropsOnly,\n })\n }\n\n const EditMenuItems = collectionConfig?.admin?.components?.edit?.editMenuItems\n\n if (EditMenuItems) {\n components.EditMenuItems = RenderServerComponent({\n Component: EditMenuItems,\n importMap: req.payload.importMap,\n serverProps: serverProps satisfies EditMenuItemsServerPropsOnly,\n })\n }\n\n const CustomPreviewButton =\n collectionConfig?.admin?.components?.edit?.PreviewButton ||\n globalConfig?.admin?.components?.elements?.PreviewButton\n\n if (isPreviewEnabled && CustomPreviewButton) {\n components.PreviewButton = RenderServerComponent({\n Component: CustomPreviewButton,\n importMap: req.payload.importMap,\n serverProps: serverProps satisfies PreviewButtonServerPropsOnly,\n })\n }\n\n const LivePreview =\n collectionConfig?.admin?.components?.views?.edit?.livePreview ||\n globalConfig?.admin?.components?.views?.edit?.livePreview\n\n if (LivePreview?.Component) {\n components.LivePreview = RenderServerComponent({\n Component: LivePreview.Component,\n importMap: req.payload.importMap,\n serverProps,\n })\n }\n\n const descriptionFromConfig =\n collectionConfig?.admin?.description || globalConfig?.admin?.description\n\n const staticDescription: StaticDescription =\n typeof descriptionFromConfig === 'function'\n ? descriptionFromConfig({ t: req.i18n.t })\n : descriptionFromConfig\n\n const CustomDescription =\n collectionConfig?.admin?.components?.Description ||\n globalConfig?.admin?.components?.elements?.Description\n\n const hasDescription = CustomDescription || staticDescription\n\n if (hasDescription) {\n components.Description = RenderServerComponent({\n clientProps: {\n collectionSlug: collectionConfig?.slug,\n description: staticDescription,\n } satisfies ViewDescriptionClientProps,\n Component: CustomDescription,\n Fallback: ViewDescription,\n importMap: req.payload.importMap,\n serverProps: serverProps satisfies ViewDescriptionServerPropsOnly,\n })\n }\n\n if (hasSavePermission) {\n if (collectionConfig?.versions?.drafts || globalConfig?.versions?.drafts) {\n const CustomPublishButton =\n collectionConfig?.admin?.components?.edit?.PublishButton ||\n globalConfig?.admin?.components?.elements?.PublishButton\n\n if (CustomPublishButton) {\n components.PublishButton = RenderServerComponent({\n Component: CustomPublishButton,\n importMap: req.payload.importMap,\n serverProps: serverProps satisfies PublishButtonServerPropsOnly,\n })\n }\n\n const CustomSaveDraftButton =\n collectionConfig?.admin?.components?.edit?.SaveDraftButton ||\n globalConfig?.admin?.components?.elements?.SaveDraftButton\n\n const draftsEnabled =\n (collectionConfig?.versions?.drafts && !collectionConfig?.versions?.drafts?.autosave) ||\n (globalConfig?.versions?.drafts && !globalConfig?.versions?.drafts?.autosave)\n\n if ((draftsEnabled || unsavedDraftWithValidations) && CustomSaveDraftButton) {\n components.SaveDraftButton = RenderServerComponent({\n Component: CustomSaveDraftButton,\n importMap: req.payload.importMap,\n serverProps: serverProps satisfies SaveDraftButtonServerPropsOnly,\n })\n }\n } else {\n const CustomSaveButton =\n collectionConfig?.admin?.components?.edit?.SaveButton ||\n globalConfig?.admin?.components?.elements?.SaveButton\n\n if (CustomSaveButton) {\n components.SaveButton = RenderServerComponent({\n Component: CustomSaveButton,\n importMap: req.payload.importMap,\n serverProps: serverProps satisfies SaveButtonServerPropsOnly,\n })\n }\n }\n }\n\n if (collectionConfig?.upload && collectionConfig?.admin?.components?.edit?.Upload) {\n components.Upload = RenderServerComponent({\n Component: collectionConfig.admin.components.edit.Upload,\n importMap: req.payload.importMap,\n serverProps,\n })\n }\n\n if (collectionConfig?.upload && collectionConfig.upload.admin?.components?.controls) {\n components.UploadControls = RenderServerComponent({\n Component: collectionConfig.upload.admin.components.controls,\n importMap: req.payload.importMap,\n serverProps,\n })\n }\n\n return components\n}\n\nexport const renderDocumentSlotsHandler: ServerFunction<{\n collectionSlug: string\n id?: number | string\n}> = async (args) => {\n const { id, collectionSlug, req } = args\n\n const collectionConfig = req.payload.collections[collectionSlug]?.config\n\n if (!collectionConfig) {\n throw new Error(req.t('error:incorrectCollection'))\n }\n\n const { docPermissions, hasSavePermission } = await getDocumentPermissions({\n collectionConfig,\n data: {},\n req,\n })\n\n return renderDocumentSlots({\n id,\n collectionConfig,\n hasSavePermission,\n permissions: docPermissions,\n req,\n })\n}\n"],"mappings":"AAmBA,SAASA,eAAe,QAAQ;AAChC,SAASC,qBAAqB,QAAQ;AAEtC,SAASC,sBAAsB,QAAQ;AAEvC,OAAO,MAAMC,mBAAA,GAOUC,IAAA;EACrB,MAAM;IAAEC,EAAE;IAAEC,gBAAgB;IAAEC,YAAY;IAAEC,iBAAiB;IAAEC;EAAG,CAAE,GAAGL,IAAA;EAEvE,MAAMM,UAAA,GAA4B,CAAC;EAEnC,MAAMC,2BAAA,GAA8BC,SAAA;EAEpC,MAAMC,gBAAA,GAAmBP,gBAAA,EAAkBQ,KAAA,EAAOC,OAAA,IAAWR,YAAA,EAAcO,KAAA,EAAOC,OAAA;EAElF,MAAMC,WAAA,GAA2B;IAC/BX,EAAA;IACAY,IAAA,EAAMR,GAAA,CAAIQ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,WAAA,EAAaF,cAAA;IACbrD;EACF;AACF","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/next",
3
- "version": "3.59.0-canary.0",
3
+ "version": "3.59.0-canary.2",
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.59.0-canary.0",
91
- "@payloadcms/translations": "3.59.0-canary.0",
92
- "@payloadcms/ui": "3.59.0-canary.0"
90
+ "@payloadcms/graphql": "3.59.0-canary.2",
91
+ "@payloadcms/ui": "3.59.0-canary.2",
92
+ "@payloadcms/translations": "3.59.0-canary.2"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@babel/cli": "7.27.2",
@@ -107,12 +107,12 @@
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.59.0-canary.0"
110
+ "payload": "3.59.0-canary.2"
111
111
  },
112
112
  "peerDependencies": {
113
113
  "graphql": "^16.8.1",
114
114
  "next": "^15.2.3",
115
- "payload": "3.59.0-canary.0"
115
+ "payload": "3.59.0-canary.2"
116
116
  },
117
117
  "engines": {
118
118
  "node": "^18.20.2 || >=20.9.0"
@@ -130,7 +130,7 @@
130
130
  "build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
131
131
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
132
132
  "build:without_reactcompiler": "rm -rf dist && rm -rf tsconfig.tsbuildinfo && pnpm copyfiles && pnpm build:types && pnpm build:swc && pnpm build:cjs && pnpm build:esbuild",
133
- "clean": "rimraf -g {dist,*.tsbuildinfo}",
133
+ "clean": "rimraf -g {dist,*.tsbuildinfo,esbuild}",
134
134
  "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
135
135
  "lint": "eslint .",
136
136
  "lint:fix": "eslint . --fix"