@tetherto/dev-websites-core 0.3.3 → 0.3.4
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/README.md +72 -0
- package/dist/cms/google-oauth.d.mts +20 -0
- package/dist/cms/google-oauth.d.mts.map +1 -0
- package/dist/cms/google-oauth.mjs +130 -0
- package/dist/cms/google-oauth.mjs.map +1 -0
- package/dist/cms/index.d.mts +2 -2
- package/dist/cms/index.mjs +2 -2
- package/dist/cms.mjs +136 -5
- package/dist/cms.mjs.map +1 -1
- package/dist/index.d.mts +11 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -3
- package/dist/index5.d.mts +2 -2
- package/dist/seo/index.mjs +2 -1
- package/dist/seo.mjs +2 -13
- package/dist/seo.mjs.map +1 -1
- package/dist/site-url.mjs +16 -0
- package/dist/site-url.mjs.map +1 -0
- package/dist/ui/components/Button/Button.d.mts +1 -1
- package/dist/ui/components/GoogleOAuthButton/GoogleOAuthButton.d.mts +5 -0
- package/dist/ui/components/GoogleOAuthButton/GoogleOAuthButton.d.mts.map +1 -0
- package/dist/ui/components/GoogleOAuthButton/GoogleOAuthButton.mjs +72 -0
- package/dist/ui/components/GoogleOAuthButton/GoogleOAuthButton.mjs.map +1 -0
- package/dist/ui/components/GoogleOAuthButton/googleOAuthStartPath.d.mts +6 -0
- package/dist/ui/components/GoogleOAuthButton/googleOAuthStartPath.d.mts.map +1 -0
- package/dist/ui/components/GoogleOAuthButton/googleOAuthStartPath.mjs +7 -0
- package/dist/ui/components/GoogleOAuthButton/googleOAuthStartPath.mjs.map +1 -0
- package/dist/ui/components/GoogleOAuthButton/index.d.mts +2 -0
- package/dist/ui/components/GoogleOAuthButton/index.mjs +2 -0
- package/dist/ui/index.d.mts +3 -1
- package/dist/ui/index.mjs +1 -0
- package/package.json +18 -2
- package/src/ui/components/GoogleOAuthButton/GoogleOAuthButton.tsx +69 -0
- package/src/ui/components/GoogleOAuthButton/googleOAuthStartPath.ts +2 -0
- package/src/ui/components/GoogleOAuthButton/index.ts +1 -0
package/dist/cms.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cms.mjs","names":[],"sources":["../src/cms/shared/access.ts","../src/cms/collections/createApiTokens.ts","../src/cms/hooks/slugify.ts","../src/cms/shared/seo-fields.ts","../src/cms/collections/createAuthors.ts","../src/cms/blocks/language-options.ts","../src/cms/blocks/code.ts","../src/cms/blocks/code-tabs.ts","../src/cms/blocks/download-cta.ts","../src/cms/blocks/image.ts","../src/cms/blocks/video.ts","../src/cms/lexical/editor.ts","../src/cms/blocks/rich-text.ts","../src/cms/blocks/steps.ts","../src/cms/blocks/leaf-blocks.ts","../src/cms/blocks/accordion.ts","../src/cms/blocks/section-heading.ts","../src/cms/blocks/index.ts","../src/cms/hooks/set-published-at.ts","../src/cms/shared/drafts-with-autosave.ts","../src/cms/collections/createBlogPosts.ts","../src/cms/collections/createCategories.ts","../src/cms/collections/createChangelog.ts","../src/cms/collections/createChangelogTags.ts","../src/cms/collections/createEventTags.ts","../src/cms/collections/createEvents.ts","../src/cms/collections/createMedia.ts","../src/cms/collections/createPages.ts","../src/cms/collections/createUsers.ts","../src/cms/globals/createSiteSettings.ts","../src/cms/applyOverride.ts","../src/cms/overrides.ts","../src/cms/buildCmsConfig.ts","../src/cms/requireEnv.ts","../src/cms/createS3MediaPlugin.ts"],"sourcesContent":["import type { Access, FieldAccess, PayloadRequest } from 'payload'\n\nexport type AccessOptions = {\n /**\n * When true, disabled `api-tokens` users are denied public reads.\n * Defaults to on when the stock `api-tokens` collection is enabled.\n */\n apiTokens?: boolean\n}\n\nexport type AccessHelpers = {\n adminOnly: ({ req }: { req: PayloadRequest }) => boolean\n adminOrPublished: Access\n publicRead: Access\n adminOnlyField: FieldAccess\n}\n\nconst isAdminUser = (req: PayloadRequest): boolean => req.user?.collection === 'users'\n\nconst isDisabledApiToken = (req: PayloadRequest): boolean =>\n req.user?.collection === 'api-tokens' && req.user?.enabled === false\n\n/**\n * Build access helpers. Pass `{ apiTokens: true }` when the `api-tokens`\n * collection is registered (stock by default via `buildCmsConfig`).\n */\nexport function createAccessHelpers(options: AccessOptions = {}): AccessHelpers {\n const apiTokens = options.apiTokens === true\n\n const adminOnly = ({ req }: { req: PayloadRequest }): boolean => isAdminUser(req)\n\n const adminOrPublished: Access = ({ req }) => {\n if (isAdminUser(req)) return true\n if (apiTokens && isDisabledApiToken(req)) return false\n return { _status: { equals: 'published' } }\n }\n\n const publicRead: Access = ({ req }) => {\n if (apiTokens && isDisabledApiToken(req)) return false\n return true\n }\n\n const adminOnlyField: FieldAccess = ({ req }) => isAdminUser(req)\n\n return { adminOnly, adminOrPublished, publicRead, adminOnlyField }\n}\n","import type { AccessHelpers } from '../shared/access.js'\nimport type { Access, CollectionConfig } from 'payload'\n\nconst adminOrSelf: Access = ({ req }) => {\n if (req.user?.collection === 'users') return true\n if (req.user?.collection === 'api-tokens') return { id: { equals: req.user.id } }\n return false\n}\n\n/**\n * Stock API-key auth collection for server-to-server Payload REST/GraphQL clients.\n * Disable per site with `overrides['api-tokens'] = false`.\n */\nexport function createApiTokens(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'api-tokens',\n labels: {\n singular: 'API Token',\n plural: 'API Tokens',\n },\n admin: {\n useAsTitle: 'name',\n defaultColumns: ['name', 'description', 'enabled', 'createdAt'],\n description:\n 'Server-to-server tokens for non-admin clients calling the Payload REST/GraphQL API. ' +\n 'Each token authenticates as an api-tokens user and is restricted to published, public-readable content.',\n },\n auth: {\n useAPIKey: true,\n disableLocalStrategy: true,\n },\n access: {\n read: adminOrSelf,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n admin: access.adminOnly,\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n admin: {\n description: 'Human-readable label, e.g. \"mobile-app-prod\" or \"partner-foo\".',\n },\n },\n {\n name: 'description',\n type: 'textarea',\n admin: {\n description: 'Who is this token for and what is it used for? Free-form notes.',\n },\n },\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n admin: {\n position: 'sidebar',\n description:\n 'Disable to soft-revoke. To hard-revoke, clear the API Key field or delete the document.',\n },\n },\n ],\n }\n}\n","import type { FieldHook } from 'payload'\n\nexport const slugify: FieldHook = ({ value }) =>\n typeof value === 'string'\n ? value\n .toLowerCase()\n .replace(/\\s+/g, '-')\n .replace(/[^a-z0-9-]/g, '')\n : value\n","import type { GroupField, Validate } from 'payload'\n\nconst MAX_META_TITLE = 60\nconst MAX_META_DESCRIPTION = 160\n\nconst validateMetaTitle: Validate<string | null | undefined> = (value) => {\n if (!value || value.trim().length === 0) return 'Meta title is required.'\n if (value.length > MAX_META_TITLE)\n return `Meta title must be ${MAX_META_TITLE} characters or fewer (currently ${value.length}).`\n return true\n}\n\nconst validateMetaDescription: Validate<string | null | undefined> = (value) => {\n if (!value || value.trim().length === 0) return 'Meta description is required.'\n if (value.length > MAX_META_DESCRIPTION)\n return `Meta description must be ${MAX_META_DESCRIPTION} characters or fewer (currently ${value.length}).`\n return true\n}\n\nconst validateUrl: Validate<string | null | undefined> = (value) => {\n if (!value) return true\n try {\n new URL(value)\n return true\n } catch {\n return 'Must be a valid URL (e.g. https://example.com/page).'\n }\n}\n\nexport const seoFields: GroupField = {\n name: 'seo',\n type: 'group',\n label: 'SEO',\n fields: [\n {\n name: 'metaTitle',\n type: 'text',\n required: true,\n localized: true,\n maxLength: MAX_META_TITLE,\n validate: validateMetaTitle,\n admin: {\n description: `Required. ${MAX_META_TITLE} characters max — shown in browser tabs and search results.`,\n },\n },\n {\n name: 'metaDescription',\n type: 'textarea',\n required: true,\n localized: true,\n validate: validateMetaDescription,\n admin: {\n description: `Required. ${MAX_META_DESCRIPTION} characters max — shown in search result snippets.`,\n },\n },\n {\n name: 'ogImage',\n type: 'upload',\n relationTo: 'media',\n admin: {\n description:\n 'Used when the page is shared on social media (1200×630 recommended). Falls back to cover image if empty.',\n },\n },\n {\n name: 'canonicalUrl',\n type: 'text',\n validate: validateUrl,\n admin: {\n description: 'Override for syndicated content. Leave empty to auto-derive from slug.',\n },\n },\n {\n name: 'noIndex',\n type: 'checkbox',\n defaultValue: false,\n admin: {\n description: 'When checked, search engines will not index this page.',\n },\n },\n {\n name: 'noFollow',\n type: 'checkbox',\n defaultValue: false,\n admin: {\n description:\n 'When checked, search engines will not follow links on this page (paired with noIndex if needed).',\n },\n },\n ],\n}\n","import { slugify } from '../hooks/slugify.js'\nimport { seoFields } from '../shared/seo-fields.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\nexport function createAuthors(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'authors',\n admin: {\n useAsTitle: 'name',\n defaultColumns: ['name', 'slug', 'role'],\n },\n access: {\n read: access.publicRead,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: { position: 'sidebar' },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'avatar',\n type: 'upload',\n relationTo: 'media',\n },\n {\n name: 'role',\n type: 'text',\n localized: true,\n admin: {\n description: 'Job title or role (e.g. \"Lead Engineer\")',\n },\n },\n {\n name: 'bio',\n type: 'textarea',\n localized: true,\n },\n {\n name: 'social',\n type: 'group',\n label: 'Social Profiles',\n admin: { position: 'sidebar' },\n fields: [\n { name: 'website', type: 'text' },\n { name: 'twitter', type: 'text', admin: { description: '@handle or full URL' } },\n { name: 'linkedin', type: 'text' },\n { name: 'github', type: 'text' },\n ],\n },\n {\n ...seoFields,\n fields: [\n ...seoFields.fields,\n {\n name: 'jsonLd',\n type: 'group',\n label: 'Structured Data Overrides',\n admin: {\n description: 'Used in JSON-LD Person schema on author pages and article bylines.',\n },\n fields: [\n {\n name: 'jobTitle',\n type: 'text',\n admin: { description: 'schema.org jobTitle (defaults to role if empty)' },\n },\n {\n name: 'worksFor',\n type: 'text',\n admin: { description: 'Organization name for schema.org worksFor' },\n },\n {\n name: 'sameAs',\n type: 'array',\n admin: {\n description: 'Extra canonical URLs for this person (Wikipedia, Crunchbase, etc.)',\n },\n fields: [{ name: 'url', type: 'text', required: true }],\n },\n ],\n },\n ],\n },\n ],\n }\n}\n","/** Shared language options for CMS code blocks and Lexical CodeBlock feature. */\nexport const languageOptions = [\n { label: 'TypeScript', value: 'typescript' },\n { label: 'JavaScript', value: 'javascript' },\n { label: 'Python', value: 'python' },\n { label: 'Bash / Shell', value: 'bash' },\n { label: 'Shell', value: 'shell' },\n { label: 'JSON', value: 'json' },\n { label: 'CSS', value: 'css' },\n { label: 'HTML', value: 'html' },\n { label: 'Rust', value: 'rust' },\n { label: 'Go', value: 'go' },\n { label: 'YAML', value: 'yaml' },\n { label: 'Markdown', value: 'markdown' },\n { label: 'Plain Text', value: 'plaintext' },\n]\n\nexport const codeBlockLanguages: Record<string, string> = Object.fromEntries(\n languageOptions.map((opt) => [opt.value, opt.label])\n)\n\nexport const defaultCodeLanguage = 'plaintext'\n","import { languageOptions } from './language-options.js'\n\nimport type { Block } from 'payload'\n\nexport const codeBlock: Block = {\n slug: 'code',\n labels: { singular: 'Code Block', plural: 'Code Blocks' },\n fields: [\n {\n name: 'language',\n type: 'select',\n defaultValue: 'typescript',\n options: languageOptions,\n },\n {\n name: 'filename',\n type: 'text',\n admin: { description: 'Optional filename label shown above the block' },\n },\n {\n name: 'code',\n type: 'code',\n required: true,\n admin: { language: 'typescript' },\n },\n ],\n}\n","import { languageOptions } from './language-options.js'\n\nimport type { Block } from 'payload'\n\nexport const codeTabsBlock: Block = {\n slug: 'code-tabs',\n labels: { singular: 'Code Tabs', plural: 'Code Tabs' },\n fields: [\n {\n name: 'tabs',\n type: 'array',\n required: true,\n minRows: 1,\n fields: [\n {\n name: 'label',\n type: 'text',\n required: true,\n admin: { description: 'Tab label (e.g. Windows, Linux, Android)' },\n },\n {\n name: 'language',\n type: 'select',\n defaultValue: 'bash',\n options: languageOptions,\n },\n {\n name: 'code',\n type: 'code',\n required: true,\n admin: { language: 'bash' },\n },\n ],\n },\n ],\n}\n","import type { Block } from 'payload'\n\nexport const downloadCtaBlock: Block = {\n slug: 'download-cta',\n labels: { singular: 'Download CTA', plural: 'Download CTAs' },\n fields: [\n {\n name: 'eyebrow',\n type: 'text',\n localized: true,\n },\n {\n name: 'heading',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'headingAccent',\n type: 'text',\n localized: true,\n },\n {\n name: 'description',\n type: 'textarea',\n localized: true,\n },\n {\n name: 'submitLabel',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'downloadUrl',\n type: 'text',\n required: true,\n },\n {\n name: 'downloadLabel',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'successMessage',\n type: 'textarea',\n localized: true,\n },\n {\n name: 'consent',\n type: 'textarea',\n localized: true,\n },\n {\n name: 'footnote',\n type: 'textarea',\n localized: true,\n },\n ],\n}\n","import type { Block } from 'payload'\n\nexport const imageBlock: Block = {\n slug: 'image',\n labels: { singular: 'Image', plural: 'Images' },\n fields: [\n {\n name: 'image',\n type: 'upload',\n relationTo: 'media',\n required: true,\n },\n {\n name: 'caption',\n type: 'text',\n localized: true,\n },\n {\n name: 'size',\n type: 'select',\n defaultValue: 'full',\n options: [\n { label: 'Full Width', value: 'full' },\n { label: 'Wide', value: 'wide' },\n { label: 'Medium', value: 'medium' },\n ],\n },\n ],\n}\n","import type { Block } from 'payload'\n\nexport const videoBlock: Block = {\n slug: 'video',\n labels: { singular: 'Video', plural: 'Videos' },\n fields: [\n {\n name: 'video',\n type: 'upload',\n relationTo: 'media',\n required: true,\n filterOptions: {\n mimeType: { contains: 'video' },\n },\n },\n {\n name: 'caption',\n type: 'text',\n localized: true,\n },\n {\n name: 'size',\n type: 'select',\n defaultValue: 'full',\n options: [\n { label: 'Full Width', value: 'full' },\n { label: 'Wide', value: 'wide' },\n { label: 'Medium', value: 'medium' },\n ],\n },\n ],\n}\n","import {\n BlocksFeature,\n CodeBlock,\n EXPERIMENTAL_TableFeature,\n UploadFeature,\n editorConfigFactory,\n lexicalEditor,\n} from '@payloadcms/richtext-lexical'\n\nimport { codeBlockLanguages, defaultCodeLanguage } from '../blocks/language-options.js'\nimport { videoBlock } from '../blocks/video.js'\n\nimport type { FeatureProviderServer } from '@payloadcms/richtext-lexical'\nimport type { SanitizedConfig } from 'payload'\n\nconst richTextFeatures = ({\n defaultFeatures,\n}: {\n defaultFeatures: FeatureProviderServer[]\n rootFeatures: FeatureProviderServer[]\n}) => [\n ...defaultFeatures.filter((feature) => feature.key !== 'upload'),\n UploadFeature({\n collections: {\n media: {\n fields: [\n {\n name: 'caption',\n type: 'text',\n },\n ],\n },\n },\n }),\n BlocksFeature({\n blocks: [\n CodeBlock({\n languages: codeBlockLanguages,\n defaultLanguage: defaultCodeLanguage,\n }),\n videoBlock,\n ],\n }),\n EXPERIMENTAL_TableFeature(),\n]\n\n/**\n * Shared Lexical editor for every `richText` field.\n *\n * Adds `CodeBlock`, inline `video` block, media upload captions, and\n * `EXPERIMENTAL_TableFeature` on top of Payload defaults.\n */\n// Return type is derived from `lexicalEditor` (a public export) rather than the\n// inferred `LexicalRichTextAdapterProvider` (not re-exported), so the generated\n// declaration stays portable while keeping the narrow Lexical adapter type that\n// consumers like `editorConfigFactory.fromEditor` require.\nexport const richTextEditor = (): ReturnType<typeof lexicalEditor> =>\n lexicalEditor({\n features: richTextFeatures,\n })\n\n/** Resolve Lexical editor config for seed scripts / markdown conversion. */\nexport async function getRichTextEditorConfig(config: SanitizedConfig) {\n return editorConfigFactory.fromFeatures({\n config,\n features: richTextFeatures,\n })\n}\n","import { richTextEditor } from '../lexical/editor.js'\n\nimport type { Block } from 'payload'\n\nexport const richTextBlock: Block = {\n slug: 'rich-text',\n labels: { singular: 'Rich Text', plural: 'Rich Text Blocks' },\n fields: [\n {\n name: 'content',\n type: 'richText',\n localized: true,\n editor: richTextEditor(),\n },\n ],\n}\n","import type { Block } from 'payload'\n\nexport const stepsBlock: Block = {\n slug: 'steps',\n labels: { singular: 'Steps List', plural: 'Steps Lists' },\n fields: [\n {\n name: 'items',\n type: 'array',\n required: true,\n minRows: 1,\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'description',\n type: 'textarea',\n localized: true,\n },\n {\n name: 'avatar',\n type: 'upload',\n relationTo: 'media',\n admin: { description: 'Optional avatar or icon shown next to the step' },\n },\n ],\n },\n ],\n}\n","import { codeBlock } from './code.js'\nimport { codeTabsBlock } from './code-tabs.js'\nimport { downloadCtaBlock } from './download-cta.js'\nimport { imageBlock } from './image.js'\nimport { richTextBlock } from './rich-text.js'\nimport { stepsBlock } from './steps.js'\nimport { videoBlock } from './video.js'\n\nimport type { Block } from 'payload'\n\nexport const leafBlocks: Block[] = [\n richTextBlock,\n codeBlock,\n codeTabsBlock,\n imageBlock,\n videoBlock,\n downloadCtaBlock,\n stepsBlock,\n]\n","import { leafBlocks } from './leaf-blocks.js'\n\nimport type { Block } from 'payload'\n\nexport const accordionBlock: Block = {\n slug: 'accordion',\n labels: { singular: 'Accordion', plural: 'Accordions' },\n fields: [\n {\n name: 'items',\n type: 'array',\n required: true,\n minRows: 1,\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'defaultOpen',\n type: 'checkbox',\n defaultValue: false,\n },\n {\n name: 'content',\n type: 'blocks',\n blocks: leafBlocks,\n localized: true,\n },\n ],\n },\n ],\n}\n","import type { Block } from 'payload'\n\nexport const sectionHeadingBlock: Block = {\n slug: 'section-heading',\n labels: { singular: 'Section Heading', plural: 'Section Headings' },\n fields: [\n {\n name: 'text',\n type: 'text',\n required: true,\n localized: true,\n },\n ],\n}\n","import { accordionBlock } from './accordion.js'\nimport { codeBlock } from './code.js'\nimport { codeTabsBlock } from './code-tabs.js'\nimport { downloadCtaBlock } from './download-cta.js'\nimport { imageBlock } from './image.js'\nimport { richTextBlock } from './rich-text.js'\nimport { sectionHeadingBlock } from './section-heading.js'\nimport { stepsBlock } from './steps.js'\nimport { videoBlock } from './video.js'\n\nimport type { Block } from 'payload'\n\nexport { richTextBlock } from './rich-text.js'\nexport { codeBlock } from './code.js'\nexport { codeTabsBlock } from './code-tabs.js'\nexport { imageBlock } from './image.js'\nexport { videoBlock } from './video.js'\nexport { downloadCtaBlock } from './download-cta.js'\nexport { stepsBlock } from './steps.js'\nexport { accordionBlock } from './accordion.js'\nexport { sectionHeadingBlock } from './section-heading.js'\nexport { leafBlocks } from './leaf-blocks.js'\nexport { languageOptions, codeBlockLanguages, defaultCodeLanguage } from './language-options.js'\n\nexport const blogContentBlocks: Block[] = [\n richTextBlock,\n codeBlock,\n codeTabsBlock,\n imageBlock,\n videoBlock,\n downloadCtaBlock,\n stepsBlock,\n accordionBlock,\n]\n\nexport const pageContentBlocks: Block[] = [\n richTextBlock,\n codeBlock,\n codeTabsBlock,\n imageBlock,\n stepsBlock,\n accordionBlock,\n]\n\nexport const showcaseContentBlocks: Block[] = [\n sectionHeadingBlock,\n richTextBlock,\n codeBlock,\n imageBlock,\n]\n","import type { CollectionBeforeChangeHook } from 'payload'\n\nexport const setPublishedAt: CollectionBeforeChangeHook = ({ data }) => {\n if (data && !data.publishedAt && data._status === 'published') {\n data.publishedAt = new Date().toISOString()\n }\n return data\n}\n","import type { CollectionConfig } from 'payload'\n\nexport const draftsWithAutosave: CollectionConfig['versions'] = {\n maxPerDoc: 25,\n drafts: {\n autosave: {\n interval: 800,\n },\n schedulePublish: true,\n },\n}\n","import { blogContentBlocks } from '../blocks/index.js'\nimport { setPublishedAt } from '../hooks/set-published-at.js'\nimport { slugify } from '../hooks/slugify.js'\nimport { draftsWithAutosave } from '../shared/drafts-with-autosave.js'\nimport { seoFields } from '../shared/seo-fields.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\n/** Stock blog-posts collection (no site revalidation — add via overrides.hooks). */\nexport function createBlogPosts(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'blog-posts',\n defaultSort: '-publishedAt',\n admin: {\n useAsTitle: 'title',\n defaultColumns: ['title', 'slug', 'author', 'publishedAt', '_status'],\n },\n access: {\n read: access.adminOrPublished,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n versions: draftsWithAutosave,\n hooks: {\n beforeChange: [setPublishedAt],\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: {\n position: 'sidebar',\n description: 'URL-friendly identifier. Not localized — one slug per post.',\n },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'coverImage',\n type: 'upload',\n relationTo: 'media',\n },\n {\n name: 'imageAlt',\n type: 'text',\n localized: true,\n admin: {\n description:\n 'Alt text used for the auto-generated social/OG image (`og:image:alt`). Should describe the post for screen readers.',\n },\n },\n {\n name: 'excerpt',\n type: 'textarea',\n localized: true,\n admin: {\n description: 'Short summary shown in listing cards and meta description fallback.',\n },\n },\n {\n name: 'content',\n type: 'blocks',\n localized: true,\n blocks: blogContentBlocks,\n },\n {\n name: 'author',\n type: 'relationship',\n relationTo: 'authors',\n admin: { position: 'sidebar' },\n },\n {\n name: 'category',\n type: 'relationship',\n relationTo: 'categories',\n admin: { position: 'sidebar' },\n },\n {\n name: 'readingTime',\n type: 'number',\n min: 1,\n admin: {\n position: 'sidebar',\n description: 'Estimated reading time in minutes.',\n },\n },\n {\n name: 'publishedAt',\n type: 'date',\n admin: {\n position: 'sidebar',\n date: { pickerAppearance: 'dayAndTime' },\n description: 'Auto-filled on first publish if left empty.',\n },\n },\n {\n name: 'showLatestNews',\n type: 'checkbox',\n defaultValue: true,\n admin: {\n position: 'sidebar',\n description: 'Show a \"Latest News\" section at the bottom of this post.',\n },\n },\n seoFields,\n ],\n }\n}\n","import { slugify } from '../hooks/slugify.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\nexport function createCategories(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'categories',\n admin: {\n useAsTitle: 'name',\n defaultColumns: ['name', 'slug'],\n },\n access: {\n read: access.publicRead,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: { position: 'sidebar' },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'description',\n type: 'textarea',\n localized: true,\n },\n ],\n }\n}\n","import { slugify } from '../hooks/slugify.js'\nimport { draftsWithAutosave } from '../shared/drafts-with-autosave.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\n/**\n * Stock changelog collection (shared fields only).\n * Site-specific body / GitHub / related-block fields — add via `overrides.fields`.\n * Revalidation — add via `overrides.hooks`.\n */\nexport function createChangelog(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'changelog',\n labels: { singular: 'Changelog', plural: 'Changelog' },\n defaultSort: '-releaseDate',\n admin: {\n useAsTitle: 'title',\n defaultColumns: ['title', 'version', 'versionType', 'tags', 'releaseDate', '_status'],\n },\n access: {\n read: access.adminOrPublished,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n versions: draftsWithAutosave,\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n localized: true,\n admin: {\n description:\n 'Release headline shown on the changelog detail page (e.g. \"Added Solana Support\").',\n },\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: {\n position: 'sidebar',\n description: 'URL-friendly identifier. Not localized — one slug per entry.',\n },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'version',\n type: 'text',\n admin: {\n position: 'sidebar',\n description:\n 'Optional semantic version label shown in the badge, e.g. v1.1.0 or 2.3.0. Omit for non-versioned announcements.',\n },\n },\n {\n name: 'versionType',\n type: 'select',\n options: [\n { label: 'Major', value: 'major' },\n { label: 'Minor', value: 'minor' },\n { label: 'Patch', value: 'patch' },\n ],\n admin: {\n position: 'sidebar',\n description:\n 'Release line for badge styling (major / minor / patch). Editors set this explicitly.',\n },\n },\n {\n name: 'releaseDate',\n type: 'date',\n required: true,\n admin: {\n position: 'sidebar',\n date: { pickerAppearance: 'dayOnly', displayFormat: 'MMM d, yyyy' },\n },\n },\n {\n name: 'tags',\n type: 'relationship',\n relationTo: 'changelog-tags',\n hasMany: true,\n label: 'Tags',\n admin: {\n position: 'sidebar',\n description: 'Editor-managed tags from the Changelog Tags collection.',\n },\n },\n {\n name: 'heroImage',\n type: 'upload',\n relationTo: 'media',\n admin: {\n description: 'Large visual above the article body on the changelog detail page.',\n },\n },\n {\n name: 'summary',\n type: 'textarea',\n localized: true,\n admin: {\n description: 'Short excerpt for listing cards and previews.',\n },\n },\n ],\n }\n}\n","import { slugify } from '../hooks/slugify.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\n/** Stock changelog-tags (no site revalidation — add via overrides.hooks). */\nexport function createChangelogTags(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'changelog-tags',\n defaultSort: 'order',\n admin: {\n useAsTitle: 'name',\n defaultColumns: ['name', 'slug', 'order'],\n description: 'Tags shown on changelog entries.',\n },\n access: {\n read: access.publicRead,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: {\n position: 'sidebar',\n description: 'URL-friendly identifier used by listing filters.',\n },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'order',\n type: 'number',\n defaultValue: 0,\n admin: {\n position: 'sidebar',\n description: 'Display order in admin lists (ascending). Ties broken by name.',\n },\n },\n {\n name: 'description',\n type: 'textarea',\n localized: true,\n admin: { description: 'Optional context shown to editors. Not rendered publicly yet.' },\n },\n ],\n }\n}\n","import { slugify } from '../hooks/slugify.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\n/** Stock event-tags (no site revalidation — add via overrides.hooks). */\nexport function createEventTags(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'event-tags',\n labels: { singular: 'Event Tag', plural: 'Event Tags' },\n defaultSort: 'order',\n admin: {\n useAsTitle: 'name',\n defaultColumns: ['name', 'slug', 'order'],\n description:\n 'Reusable event categories (Meetup, Workshop, Hackathon, …). Editors can add types without code changes. Related from Events.',\n },\n access: {\n read: access.publicRead,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: {\n position: 'sidebar',\n description: 'URL-friendly identifier used by filters and relationships.',\n },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'order',\n type: 'number',\n defaultValue: 0,\n admin: {\n position: 'sidebar',\n description: 'Display order in admin lists (ascending). Ties broken by name.',\n },\n },\n {\n name: 'description',\n type: 'textarea',\n localized: true,\n admin: { description: 'Optional context shown to editors.' },\n },\n ],\n }\n}\n","import { setPublishedAt } from '../hooks/set-published-at.js'\nimport { slugify } from '../hooks/slugify.js'\nimport { richTextEditor } from '../lexical/editor.js'\nimport { draftsWithAutosave } from '../shared/drafts-with-autosave.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig, Validate } from 'payload'\n\n/**\n * Display abbreviations accepted in addition to IANA names (e.g. Europe/Paris).\n * Sites map these to IANA when they need a timezone database identifier.\n */\nconst TIMEZONE_ABBREVIATIONS = new Set([\n 'UTC',\n 'GMT',\n 'CET',\n 'CEST',\n 'WET',\n 'WEST',\n 'EET',\n 'EEST',\n 'BST',\n 'EST',\n 'EDT',\n 'CST',\n 'CDT',\n 'MST',\n 'MDT',\n 'PST',\n 'PDT',\n])\n\nfunction parseDate(value: unknown): Date | null {\n if (value instanceof Date) {\n return Number.isNaN(value.getTime()) ? null : value\n }\n if (typeof value === 'string' && value.trim()) {\n const date = new Date(value)\n return Number.isNaN(date.getTime()) ? null : date\n }\n return null\n}\n\nfunction isValidIanaTimeZone(timeZone: string): boolean {\n try {\n Intl.DateTimeFormat('en-US', { timeZone }).format(new Date())\n return true\n } catch {\n return false\n }\n}\n\nconst validateTimezone: Validate<string | null | undefined> = (value) => {\n if (!value || !value.trim()) return 'Timezone is required.'\n const timeZone = value.trim()\n if (TIMEZONE_ABBREVIATIONS.has(timeZone.toUpperCase())) return true\n if (isValidIanaTimeZone(timeZone)) return true\n return 'Must be a timezone abbreviation (CET, UTC, …) or a valid IANA timezone (e.g. Europe/Paris).'\n}\n\nconst validateExternalUrl: Validate<string | null | undefined> = (value) => {\n if (!value || !value.trim()) return 'External URL is required.'\n try {\n new URL(value)\n return true\n } catch {\n return 'Must be a valid URL (e.g. https://example.com/event).'\n }\n}\n\nconst validateEndsAt: Validate<string | Date | null | undefined> = (value, { siblingData }) => {\n const end = parseDate(value)\n if (!end) return 'End date and time is required.'\n\n const start = parseDate(\n siblingData && typeof siblingData === 'object' && 'startsAt' in siblingData\n ? siblingData.startsAt\n : undefined\n )\n if (start && end.getTime() <= start.getTime()) {\n return 'End date and time must be after the start.'\n }\n\n return true\n}\n\n/**\n * Stock events collection (shared fields only).\n * SEO / site-specific fields — add via `overrides.fields`.\n * Revalidation — add via `overrides.hooks`.\n */\nexport function createEvents(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'events',\n labels: { singular: 'Event', plural: 'Events' },\n defaultSort: 'startsAt',\n admin: {\n useAsTitle: 'title',\n defaultColumns: ['title', 'slug', 'tag', 'startsAt', 'endsAt', '_status'],\n description: 'Reusable events consumed by marketing / community surfaces across sites.',\n },\n access: {\n read: access.adminOrPublished,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n versions: draftsWithAutosave,\n hooks: {\n beforeChange: [setPublishedAt],\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: {\n position: 'sidebar',\n description: 'URL-friendly identifier. Not localized — one slug per event.',\n },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'summary',\n type: 'textarea',\n required: true,\n localized: true,\n admin: {\n description: 'Short description for listings, previews, and calendar bodies.',\n },\n },\n {\n name: 'coverImage',\n type: 'upload',\n relationTo: 'media',\n admin: {\n description: 'Optional cover/hero image for detail or promotional surfaces.',\n },\n },\n {\n name: 'startsAt',\n type: 'date',\n required: true,\n admin: {\n position: 'sidebar',\n date: { pickerAppearance: 'dayAndTime', displayFormat: 'MMM d, yyyy h:mm a' },\n description: 'Event start date and time. Sites derive upcoming vs past from this value.',\n },\n },\n {\n name: 'endsAt',\n type: 'date',\n required: true,\n validate: validateEndsAt,\n admin: {\n position: 'sidebar',\n date: { pickerAppearance: 'dayAndTime', displayFormat: 'MMM d, yyyy h:mm a' },\n description: 'Event end date and time. Must be after the start.',\n },\n },\n {\n name: 'timezone',\n type: 'text',\n required: true,\n validate: validateTimezone,\n admin: {\n position: 'sidebar',\n description:\n 'Display timezone: abbreviation (CET, WET, UTC) or IANA name (Europe/Paris).',\n },\n },\n {\n name: 'location',\n type: 'text',\n required: true,\n localized: true,\n admin: {\n description: 'Venue or platform (e.g. Discord, Online, Lisbon).',\n },\n },\n {\n name: 'tag',\n type: 'relationship',\n relationTo: 'event-tags',\n required: true,\n admin: {\n position: 'sidebar',\n description: 'Primary event category from Event Tags.',\n },\n },\n {\n name: 'ctaKind',\n type: 'select',\n required: true,\n defaultValue: 'link',\n options: [\n { label: 'External link', value: 'link' },\n { label: 'Add to calendar', value: 'calendar' },\n ],\n admin: {\n position: 'sidebar',\n description:\n 'Primary listing action. Link opens the external URL; calendar lets the site offer an add-to-calendar flow.',\n },\n },\n {\n name: 'ctaLabel',\n type: 'text',\n required: true,\n localized: true,\n admin: {\n description: 'Label for the primary listing action (e.g. Register, Watch recording).',\n },\n },\n {\n name: 'ctaUrl',\n type: 'text',\n required: true,\n validate: validateExternalUrl,\n admin: {\n description:\n 'External event URL. Opened for link actions; included in calendar details for calendar actions.',\n },\n },\n {\n name: 'content',\n type: 'richText',\n localized: true,\n editor: richTextEditor(),\n admin: {\n description: 'Optional long-form body for event detail pages.',\n },\n },\n {\n name: 'publishedAt',\n type: 'date',\n admin: {\n position: 'sidebar',\n date: { pickerAppearance: 'dayAndTime' },\n description: 'Auto-filled on first publish if left empty.',\n },\n },\n ],\n }\n}\n","import type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\n/** Stock media upload collection (always publicly readable once uploaded). */\nexport function createMedia(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'media',\n admin: {\n useAsTitle: 'filename',\n defaultColumns: ['filename', 'alt', 'updatedAt'],\n },\n access: {\n read: access.publicRead,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n upload: {\n imageSizes: [\n {\n name: 'thumbnail',\n width: 400,\n height: 300,\n position: 'centre',\n },\n {\n name: 'card',\n width: 768,\n height: 512,\n position: 'centre',\n },\n {\n name: 'tablet',\n width: 1024,\n height: undefined,\n position: 'centre',\n },\n ],\n adminThumbnail: 'thumbnail',\n mimeTypes: ['image/*', 'video/*', 'application/pdf'],\n },\n fields: [\n {\n name: 'alt',\n type: 'text',\n required: true,\n localized: true,\n },\n ],\n }\n}\n","import { pageContentBlocks } from '../blocks/index.js'\nimport { setPublishedAt } from '../hooks/set-published-at.js'\nimport { slugify } from '../hooks/slugify.js'\nimport { draftsWithAutosave } from '../shared/drafts-with-autosave.js'\nimport { seoFields } from '../shared/seo-fields.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\nfunction createContentPageCollection(\n access: AccessHelpers,\n slug: 'pages' | 'legal-pages'\n): CollectionConfig {\n return {\n slug,\n admin: {\n useAsTitle: 'title',\n defaultColumns: ['title', 'slug', 'publishedAt', '_status'],\n },\n access: {\n read: access.adminOrPublished,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n versions: draftsWithAutosave,\n hooks: {\n beforeChange: [setPublishedAt],\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: {\n position: 'sidebar',\n description: 'URL-friendly identifier. Not localized — one slug per page.',\n },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'content',\n type: 'blocks',\n localized: true,\n blocks: pageContentBlocks,\n },\n {\n name: 'publishedAt',\n type: 'date',\n admin: {\n position: 'sidebar',\n date: { pickerAppearance: 'dayAndTime' },\n description: 'Auto-filled on first publish if left empty.',\n },\n },\n seoFields,\n ],\n }\n}\n\nexport function createPages(access: AccessHelpers): CollectionConfig {\n return createContentPageCollection(access, 'pages')\n}\n\nexport function createLegalPages(access: AccessHelpers): CollectionConfig {\n return createContentPageCollection(access, 'legal-pages')\n}\n","import type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\nexport function createUsers(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'users',\n admin: {\n useAsTitle: 'email',\n },\n auth: true,\n access: {\n read: access.adminOnly,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n admin: access.adminOnly,\n },\n fields: [],\n }\n}\n","import type { AccessHelpers } from '../shared/access.js'\nimport type { GlobalConfig } from 'payload'\n\nexport function createSiteSettings(access: AccessHelpers): GlobalConfig {\n return {\n slug: 'site-settings',\n label: 'Site Settings',\n access: {\n read: access.publicRead,\n update: access.adminOnly,\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n localized: true,\n admin: {\n description: 'Public site name used in titles and structured data.',\n },\n },\n {\n name: 'defaultDescription',\n type: 'textarea',\n required: true,\n localized: true,\n admin: {\n description: 'Fallback meta description when a page does not define its own.',\n },\n },\n {\n name: 'defaultOgImage',\n type: 'upload',\n relationTo: 'media',\n admin: {\n description: 'Default Open Graph image (1200×630 recommended).',\n },\n },\n {\n name: 'organization',\n type: 'group',\n label: 'Organization',\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n },\n {\n name: 'legalName',\n type: 'text',\n },\n {\n name: 'description',\n type: 'textarea',\n localized: true,\n },\n {\n name: 'logo',\n type: 'upload',\n relationTo: 'media',\n },\n {\n name: 'foundingDate',\n type: 'text',\n admin: { description: 'Year or ISO date for schema.org structured data.' },\n },\n ],\n },\n {\n name: 'social',\n type: 'group',\n label: 'Social Profiles',\n fields: [\n { name: 'twitter', type: 'text' },\n { name: 'github', type: 'text' },\n { name: 'linkedin', type: 'text' },\n ],\n },\n ],\n }\n}\n","import type { CollectionConfig, Field, GlobalConfig } from 'payload'\n\ntype OverridableConfig = CollectionConfig | GlobalConfig\n\ntype Override<TConfig extends OverridableConfig> =\n | false\n | {\n fields?: (base: Field[]) => Field[]\n hooks?: Partial<TConfig['hooks']>\n admin?: Partial<TConfig['admin']>\n access?: Partial<TConfig['access']>\n config?: (base: TConfig) => TConfig\n }\n\nexport type CollectionOverride = Override<CollectionConfig>\nexport type GlobalOverride = Override<GlobalConfig>\n\ntype HookArrays = Record<string, unknown[] | undefined>\n\n// Payload collection/global hooks are all arrays of functions, so overrides are\n// appended to the base hooks rather than replacing them.\nfunction mergeHooks(base: HookArrays | undefined, extra: HookArrays | undefined): HookArrays {\n const keys = new Set([...Object.keys(base ?? {}), ...Object.keys(extra ?? {})])\n const merged: HookArrays = {}\n keys.forEach((key) => {\n const combined = [...(base?.[key] ?? []), ...(extra?.[key] ?? [])]\n if (combined.length) merged[key] = combined\n })\n return merged\n}\n\nfunction applyOverride<TConfig extends OverridableConfig>(\n base: TConfig,\n override: Override<TConfig> | undefined\n): TConfig | null {\n if (override === false) return null\n if (!override) return base\n\n const next = {\n ...base,\n ...(override.admin && { admin: { ...base.admin, ...override.admin } }),\n ...(override.access && { access: { ...base.access, ...override.access } }),\n ...(override.fields && { fields: override.fields(base.fields ?? []) }),\n ...(override.hooks && { hooks: mergeHooks(base.hooks, override.hooks as HookArrays) }),\n } as TConfig\n\n return override.config ? override.config(next) : next\n}\n\nexport const applyCollectionOverride = (\n base: CollectionConfig,\n override: CollectionOverride | undefined\n): CollectionConfig | null => applyOverride(base, override)\n\nexport const applyGlobalOverride = (\n base: GlobalConfig,\n override: GlobalOverride | undefined\n): GlobalConfig | null => applyOverride(base, override)\n","import type { CollectionOverride, GlobalOverride } from './applyOverride.js'\n\n/** Slugs of the stock collections shipped by `buildCmsConfig`, in registration order. */\nexport const STOCK_COLLECTION_SLUGS = [\n 'users',\n 'api-tokens',\n 'media',\n 'authors',\n 'categories',\n 'blog-posts',\n 'pages',\n 'legal-pages',\n 'changelog-tags',\n 'changelog',\n 'event-tags',\n 'events',\n] as const\n\nexport type StockCollectionSlug = (typeof STOCK_COLLECTION_SLUGS)[number]\n\n/** Typed map of collection/global overrides for `buildCmsConfig`. */\nexport type Overrides = Partial<Record<StockCollectionSlug, CollectionOverride>> & {\n 'site-settings'?: GlobalOverride\n}\n","import { buildConfig } from 'payload'\n\nimport { createAccessHelpers, type AccessOptions } from './shared/access.js'\nimport { createApiTokens } from './collections/createApiTokens.js'\nimport { createAuthors } from './collections/createAuthors.js'\nimport { createBlogPosts } from './collections/createBlogPosts.js'\nimport { createCategories } from './collections/createCategories.js'\nimport { createChangelog } from './collections/createChangelog.js'\nimport { createChangelogTags } from './collections/createChangelogTags.js'\nimport { createEventTags } from './collections/createEventTags.js'\nimport { createEvents } from './collections/createEvents.js'\nimport { createMedia } from './collections/createMedia.js'\nimport { createLegalPages, createPages } from './collections/createPages.js'\nimport { createUsers } from './collections/createUsers.js'\nimport { createSiteSettings } from './globals/createSiteSettings.js'\nimport { richTextEditor } from './lexical/editor.js'\nimport { applyCollectionOverride, applyGlobalOverride } from './applyOverride.js'\nimport { STOCK_COLLECTION_SLUGS, type Overrides, type StockCollectionSlug } from './overrides.js'\n\nimport type { CollectionConfig, Config, GlobalConfig, Plugin } from 'payload'\n\nexport type BuildCmsConfigOptions<TLocale extends string = string> = {\n secret: string\n // Payload DB adapter instance (e.g. mongooseAdapter({ url }))\n db: Config['db']\n /** Sharp instance from the `sharp` package. */\n sharp?: Config['sharp']\n cors?: Config['cors']\n csrf?: Config['csrf']\n locales: readonly TLocale[]\n /** Must be one of `locales`. */\n defaultLocale: TLocale\n admin?: Config['admin']\n plugins?: Plugin[]\n /** Defaults to the package Lexical editor. */\n editor?: Config['editor']\n access?: AccessOptions\n /** Collection/global slug → override | false. */\n overrides?: Overrides\n extraCollections?: CollectionConfig[]\n extraGlobals?: GlobalConfig[]\n typescript?: Config['typescript']\n /** Extra top-level Payload config keys (e.g. endpoints, graphQL). */\n payload?: Partial<\n Omit<\n Config,\n | 'secret'\n | 'db'\n | 'sharp'\n | 'cors'\n | 'csrf'\n | 'admin'\n | 'plugins'\n | 'editor'\n | 'collections'\n | 'globals'\n | 'localization'\n | 'typescript'\n >\n >\n}\n\n/** Drop keys whose value is `undefined` so they don't clobber Payload defaults. */\nfunction defined<T extends Record<string, unknown>>(obj: T): Partial<T> {\n return Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== undefined)) as Partial<T>\n}\n\n/**\n * Build a Payload config from shared stock collections/globals plus site\n * overrides and extras. Types are still generated in the consuming app.\n */\nexport function buildCmsConfig<const TLocale extends string>(\n options: BuildCmsConfigOptions<TLocale>\n) {\n const overrides = options.overrides ?? {}\n const access = createAccessHelpers({\n ...options.access,\n apiTokens: options.access?.apiTokens ?? overrides['api-tokens'] !== false,\n })\n\n const stock: Record<StockCollectionSlug, CollectionConfig> = {\n 'users': createUsers(access),\n 'api-tokens': createApiTokens(access),\n 'media': createMedia(access),\n 'authors': createAuthors(access),\n 'categories': createCategories(access),\n 'blog-posts': createBlogPosts(access),\n 'pages': createPages(access),\n 'legal-pages': createLegalPages(access),\n 'changelog-tags': createChangelogTags(access),\n 'changelog': createChangelog(access),\n 'event-tags': createEventTags(access),\n 'events': createEvents(access),\n }\n\n const collections = [\n ...STOCK_COLLECTION_SLUGS.map((slug) =>\n applyCollectionOverride(stock[slug], overrides[slug])\n ).filter((c): c is CollectionConfig => c !== null),\n ...(options.extraCollections ?? []),\n ]\n\n const siteSettings = applyGlobalOverride(createSiteSettings(access), overrides['site-settings'])\n const globals = [...(siteSettings ? [siteSettings] : []), ...(options.extraGlobals ?? [])]\n\n return buildConfig({\n ...options.payload,\n ...defined({\n sharp: options.sharp,\n cors: options.cors,\n csrf: options.csrf,\n plugins: options.plugins,\n }),\n secret: options.secret,\n db: options.db,\n admin: {\n user: 'users',\n ...options.admin,\n },\n editor: options.editor ?? richTextEditor(),\n collections,\n ...(globals.length ? { globals } : {}),\n localization: {\n locales: options.locales.map((code) => ({\n code,\n label: code.toUpperCase(),\n })),\n defaultLocale: options.defaultLocale,\n fallback: true,\n },\n typescript: options.typescript ?? {\n outputFile: 'src/payload-types.ts',\n },\n })\n}\n","import { createLogger } from '../utils/logger/logger.js'\n\nconst log = createLogger('env')\n\n/**\n * Read a required env var. During Next.js `phase-production-build` and\n * `generate:importmap` (when NEXT_PHASE is unset) returns \"\" instead of throwing,\n * because those phases do not connect to the DB.\n */\nexport function requireEnvAtRuntime(name: string): string {\n const value = process.env[name]\n const isBuildTime = !process.env.NEXT_PHASE || process.env.NEXT_PHASE === 'phase-production-build'\n if (!value && !isBuildTime) {\n log.error(`Missing required environment variable: ${name}`)\n throw new Error(`Missing required environment variable: ${name}`)\n }\n return value ?? ''\n}\n","import { s3Storage } from '@payloadcms/storage-s3'\n\nimport type { Plugin } from 'payload'\n\nexport type CreateS3MediaPluginOptions = {\n /** Defaults to `process.env.AWS_S3_BUCKET`. */\n bucket?: string\n accessKeyId?: string\n secretAccessKey?: string\n region?: string\n /** Custom S3-compatible endpoint (MinIO, etc.). Defaults to `AWS_S3_ENDPOINT`. */\n endpoint?: string\n /** Defaults to `AWS_S3_FORCE_PATH_STYLE === 'true'`. */\n forcePathStyle?: boolean\n /** Collection slug that owns uploads. Defaults to `media`. */\n collection?: string\n}\n\n/** Payload S3 storage plugin wired for the stock `media` collection. */\nexport function createS3MediaPlugin(options: CreateS3MediaPluginOptions = {}): Plugin {\n const bucket = options.bucket ?? process.env.AWS_S3_BUCKET ?? ''\n const endpoint = options.endpoint ?? process.env.AWS_S3_ENDPOINT ?? ''\n const forcePathStyle = options.forcePathStyle ?? process.env.AWS_S3_FORCE_PATH_STYLE === 'true'\n\n return s3Storage({\n enabled: Boolean(bucket),\n collections: {\n [options.collection ?? 'media']: true,\n },\n bucket,\n config: {\n credentials: {\n accessKeyId: options.accessKeyId ?? process.env.AWS_ACCESS_KEY_ID ?? '',\n secretAccessKey: options.secretAccessKey ?? process.env.AWS_SECRET_ACCESS_KEY ?? '',\n },\n region: options.region ?? process.env.AWS_S3_REGION ?? 'us-east-1',\n ...(endpoint ? { endpoint } : {}),\n ...(forcePathStyle ? { forcePathStyle: true } : {}),\n },\n })\n}\n"],"mappings":";;;;;AAiBA,MAAM,eAAe,QAAiC,IAAI,MAAM,eAAe;AAE/E,MAAM,sBAAsB,QAC1B,IAAI,MAAM,eAAe,gBAAgB,IAAI,MAAM,YAAY;;;;;AAMjE,SAAgB,oBAAoB,UAAyB,CAAC,GAAkB;CAC9E,MAAM,YAAY,QAAQ,cAAc;CAExC,MAAM,aAAa,EAAE,UAA4C,YAAY,GAAG;CAEhF,MAAM,oBAA4B,EAAE,UAAU;EAC5C,IAAI,YAAY,GAAG,GAAG,OAAO;EAC7B,IAAI,aAAa,mBAAmB,GAAG,GAAG,OAAO;EACjD,OAAO,EAAE,SAAS,EAAE,QAAQ,YAAY,EAAE;CAC5C;CAEA,MAAM,cAAsB,EAAE,UAAU;EACtC,IAAI,aAAa,mBAAmB,GAAG,GAAG,OAAO;EACjD,OAAO;CACT;CAEA,MAAM,kBAA+B,EAAE,UAAU,YAAY,GAAG;CAEh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AM;IACN,UAAU;IACV,QAAQ;IACR,OAAO;KACL,UAAU;KACV,aAAa;IACf;IACA,OAAO,EAAE,gBAAgB,CAAC,OAAO,EAAE;GACrC;GACA;IACE,MAAM;IACN,MAAM;IACN,UAAU;IACV,WAAW;IACX,OAAO,EACL,aAAa,iEACf;GACF;GACA;IACE,MAAM;IACN,MAAM;IACN,YAAY;IACZ,OAAO,EACL,aAAa,gEACf;GACF;GACA;IACE,MAAM;IACN,MAAM;IACN,UAAU;IACV,OAAO;KACL,UAAU;KACV,MAAM;MAAE,kBAAkB;MAAc,eAAe;KAAqB;KAC5E,aAAa;IACf;GACF;GACA;IACE,MAAM;IACN,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;KACL,UAAU;KACV,MAAM;MAAE,kBAAkB;MAAc,eAAe;KAAqB;KAC5E,aAAa;IACf;GACF;GACA;IACE,MAAM;IACN,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO;KACL,UAAU;KACV,aACE;IACJ;GACF;GACA;IACE,MAAM;IACN,MAAM;IACN,UAAU;IACV,WAAW;IACX,OAAO,EACL,aAAa,oDACf;GACF;GACA;IACE,MAAM;IACN,MAAM;IACN,YAAY;IACZ,UAAU;IACV,OAAO;KACL,UAAU;KACV,aAAa;IACf;GACF;GACA;IACE,MAAM;IACN,MAAM;IACN,UAAU;IACV,cAAc;IACd,SAAS,CACP;KAAE,OAAO;KAAiB,OAAO;IAAO,GACxC;KAAE,OAAO;KAAmB,OAAO;IAAW,CAChD;IACA,OAAO;KACL,UAAU;KACV,aACE;IACJ;GACF;GACA;IACE,MAAM;IACN,MAAM;IACN,UAAU;IACV,WAAW;IACX,OAAO,EACL,aAAa,yEACf;GACF;GACA;IACE,MAAM;IACN,MAAM;IACN,UAAU;IACV,UAAU;IACV,OAAO,EACL,aACE,kGACJ;GACF;GACA;IACE,MAAM;IACN,MAAM;IACN,WAAW;IACX,QAAQ,eAAe;IACvB,OAAO,EACL,aAAa,kDACf;GACF;GACA;IACE,M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,QAAQ;GACvB,UAAU;EACZ;EACA,YAAY,QAAQ,cAAc,EAChC,YAAY,uBACd;CACF,CAAC;AACH;;;ACpIA,MAAM,MAAM,aAAa,KAAK;;;;;;AAO9B,SAAgB,oBAAoB,MAAsB;CACxD,MAAM,QAAQ,QAAQ,IAAI;CAC1B,MAAM,cAAc,CAAC,QAAQ,IAAI,cAAc,QAAQ,IAAI,eAAe;CAC1E,IAAI,CAAC,SAAS,CAAC,aAAa;EAC1B,IAAI,MAAM,0CAA0C,MAAM;EAC1D,MAAM,IAAI,MAAM,0CAA0C,MAAM;CAClE;CACA,OAAO,SAAS;AAClB;;;;ACEA,SAAgB,oBAAoB,UAAsC,CAAC,GAAW;CACpF,MAAM,SAAS,QAAQ,UAAU,QAAQ,IAAI,iBAAiB;CAC9D,MAAM,WAAW,QAAQ,YAAY,QAAQ,IAAI,mBAAmB;CACpE,MAAM,iBAAiB,QAAQ,kBAAkB,QAAQ,IAAI,4BAA4B;CAEzF,OAAO,UAAU;EACf,SAAS,QAAQ,MAAM;EACvB,aAAa,GACV,QAAQ,cAAc,UAAU,KACnC;EACA;EACA,QAAQ;GACN,aAAa;IACX,aAAa,QAAQ,eAAe,QAAQ,IAAI,qBAAqB;IACrE,iBAAiB,QAAQ,mBAAmB,QAAQ,IAAI,yBAAyB;GACnF;GACA,QAAQ,QAAQ,UAAU,QAAQ,IAAI,iBAAiB;GACvD,GAAI,WAAW,EAAE,SAAS,IAAI,CAAC;GAC/B,GAAI,iBAAiB,EAAE,gBAAgB,KAAK,IAAI,CAAC;EACnD;CACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"cms.mjs","names":[],"sources":["../src/cms/shared/access.ts","../src/cms/collections/createApiTokens.ts","../src/cms/hooks/slugify.ts","../src/cms/shared/seo-fields.ts","../src/cms/collections/createAuthors.ts","../src/cms/blocks/language-options.ts","../src/cms/blocks/code.ts","../src/cms/blocks/code-tabs.ts","../src/cms/blocks/download-cta.ts","../src/cms/blocks/image.ts","../src/cms/blocks/video.ts","../src/cms/lexical/editor.ts","../src/cms/blocks/rich-text.ts","../src/cms/blocks/steps.ts","../src/cms/blocks/leaf-blocks.ts","../src/cms/blocks/accordion.ts","../src/cms/blocks/section-heading.ts","../src/cms/blocks/index.ts","../src/cms/hooks/coerce-blog-post-categories.ts","../src/cms/hooks/set-published-at.ts","../src/cms/shared/drafts-with-autosave.ts","../src/cms/collections/createBlogPosts.ts","../src/cms/collections/createCategories.ts","../src/cms/collections/createChangelog.ts","../src/cms/collections/createChangelogTags.ts","../src/cms/collections/createEventTags.ts","../src/cms/collections/createEvents.ts","../src/cms/collections/createMedia.ts","../src/cms/collections/createPages.ts","../src/cms/collections/createUsers.ts","../src/cms/globals/createSiteSettings.ts","../src/cms/applyOverride.ts","../src/cms/overrides.ts","../src/cms/buildCmsConfig.ts","../src/cms/requireEnv.ts","../src/cms/createS3MediaPlugin.ts","../src/cms/globals/createAnnouncementBanner.ts"],"sourcesContent":["import type { Access, FieldAccess, PayloadRequest } from 'payload'\n\nexport type AccessOptions = {\n /**\n * When true, disabled `api-tokens` users are denied public reads.\n * Defaults to on when the stock `api-tokens` collection is enabled.\n */\n apiTokens?: boolean\n}\n\nexport type AccessHelpers = {\n adminOnly: ({ req }: { req: PayloadRequest }) => boolean\n adminOrPublished: Access\n publicRead: Access\n adminOnlyField: FieldAccess\n}\n\nconst isAdminUser = (req: PayloadRequest): boolean => req.user?.collection === 'users'\n\nconst isDisabledApiToken = (req: PayloadRequest): boolean =>\n req.user?.collection === 'api-tokens' && req.user?.enabled === false\n\n/**\n * Build access helpers. Pass `{ apiTokens: true }` when the `api-tokens`\n * collection is registered (stock by default via `buildCmsConfig`).\n */\nexport function createAccessHelpers(options: AccessOptions = {}): AccessHelpers {\n const apiTokens = options.apiTokens === true\n\n const adminOnly = ({ req }: { req: PayloadRequest }): boolean => isAdminUser(req)\n\n const adminOrPublished: Access = ({ req }) => {\n if (isAdminUser(req)) return true\n if (apiTokens && isDisabledApiToken(req)) return false\n return { _status: { equals: 'published' } }\n }\n\n const publicRead: Access = ({ req }) => {\n if (apiTokens && isDisabledApiToken(req)) return false\n return true\n }\n\n const adminOnlyField: FieldAccess = ({ req }) => isAdminUser(req)\n\n return { adminOnly, adminOrPublished, publicRead, adminOnlyField }\n}\n","import type { AccessHelpers } from '../shared/access.js'\nimport type { Access, CollectionConfig } from 'payload'\n\nconst adminOrSelf: Access = ({ req }) => {\n if (req.user?.collection === 'users') return true\n if (req.user?.collection === 'api-tokens') return { id: { equals: req.user.id } }\n return false\n}\n\n/**\n * Stock API-key auth collection for server-to-server Payload REST/GraphQL clients.\n * Disable per site with `overrides['api-tokens'] = false`.\n */\nexport function createApiTokens(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'api-tokens',\n labels: {\n singular: 'API Token',\n plural: 'API Tokens',\n },\n admin: {\n useAsTitle: 'name',\n defaultColumns: ['name', 'description', 'enabled', 'createdAt'],\n description:\n 'Server-to-server tokens for non-admin clients calling the Payload REST/GraphQL API. ' +\n 'Each token authenticates as an api-tokens user and is restricted to published, public-readable content.',\n },\n auth: {\n useAPIKey: true,\n disableLocalStrategy: true,\n },\n access: {\n read: adminOrSelf,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n admin: access.adminOnly,\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n admin: {\n description: 'Human-readable label, e.g. \"mobile-app-prod\" or \"partner-foo\".',\n },\n },\n {\n name: 'description',\n type: 'textarea',\n admin: {\n description: 'Who is this token for and what is it used for? Free-form notes.',\n },\n },\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: true,\n admin: {\n position: 'sidebar',\n description:\n 'Disable to soft-revoke. To hard-revoke, clear the API Key field or delete the document.',\n },\n },\n ],\n }\n}\n","import type { FieldHook } from 'payload'\n\nexport const slugify: FieldHook = ({ value }) =>\n typeof value === 'string'\n ? value\n .toLowerCase()\n .replace(/\\s+/g, '-')\n .replace(/[^a-z0-9-]/g, '')\n : value\n","import type { GroupField, Validate } from 'payload'\n\nconst MAX_META_TITLE = 60\nconst MAX_META_DESCRIPTION = 160\n\nconst validateMetaTitle: Validate<string | null | undefined> = (value) => {\n if (!value || value.trim().length === 0) return 'Meta title is required.'\n if (value.length > MAX_META_TITLE)\n return `Meta title must be ${MAX_META_TITLE} characters or fewer (currently ${value.length}).`\n return true\n}\n\nconst validateMetaDescription: Validate<string | null | undefined> = (value) => {\n if (!value || value.trim().length === 0) return 'Meta description is required.'\n if (value.length > MAX_META_DESCRIPTION)\n return `Meta description must be ${MAX_META_DESCRIPTION} characters or fewer (currently ${value.length}).`\n return true\n}\n\nconst validateUrl: Validate<string | null | undefined> = (value) => {\n if (!value) return true\n try {\n new URL(value)\n return true\n } catch {\n return 'Must be a valid URL (e.g. https://example.com/page).'\n }\n}\n\nexport const seoFields: GroupField = {\n name: 'seo',\n type: 'group',\n label: 'SEO',\n fields: [\n {\n name: 'metaTitle',\n type: 'text',\n required: true,\n localized: true,\n maxLength: MAX_META_TITLE,\n validate: validateMetaTitle,\n admin: {\n description: `Required. ${MAX_META_TITLE} characters max — shown in browser tabs and search results.`,\n },\n },\n {\n name: 'metaDescription',\n type: 'textarea',\n required: true,\n localized: true,\n validate: validateMetaDescription,\n admin: {\n description: `Required. ${MAX_META_DESCRIPTION} characters max — shown in search result snippets.`,\n },\n },\n {\n name: 'ogImage',\n type: 'upload',\n relationTo: 'media',\n admin: {\n description:\n 'Used when the page is shared on social media (1200×630 recommended). Falls back to cover image if empty.',\n },\n },\n {\n name: 'canonicalUrl',\n type: 'text',\n validate: validateUrl,\n admin: {\n description: 'Override for syndicated content. Leave empty to auto-derive from slug.',\n },\n },\n {\n name: 'noIndex',\n type: 'checkbox',\n defaultValue: false,\n admin: {\n description: 'When checked, search engines will not index this page.',\n },\n },\n {\n name: 'noFollow',\n type: 'checkbox',\n defaultValue: false,\n admin: {\n description:\n 'When checked, search engines will not follow links on this page (paired with noIndex if needed).',\n },\n },\n ],\n}\n","import { slugify } from '../hooks/slugify.js'\nimport { seoFields } from '../shared/seo-fields.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\nexport function createAuthors(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'authors',\n admin: {\n useAsTitle: 'name',\n defaultColumns: ['name', 'slug', 'role'],\n },\n access: {\n read: access.publicRead,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: { position: 'sidebar' },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'avatar',\n type: 'upload',\n relationTo: 'media',\n },\n {\n name: 'role',\n type: 'text',\n localized: true,\n admin: {\n description: 'Job title or role (e.g. \"Lead Engineer\")',\n },\n },\n {\n name: 'bio',\n type: 'textarea',\n localized: true,\n },\n {\n name: 'social',\n type: 'group',\n label: 'Social Profiles',\n admin: { position: 'sidebar' },\n fields: [\n { name: 'website', type: 'text' },\n { name: 'twitter', type: 'text', admin: { description: '@handle or full URL' } },\n { name: 'linkedin', type: 'text' },\n { name: 'github', type: 'text' },\n ],\n },\n {\n ...seoFields,\n fields: [\n ...seoFields.fields,\n {\n name: 'jsonLd',\n type: 'group',\n label: 'Structured Data Overrides',\n admin: {\n description: 'Used in JSON-LD Person schema on author pages and article bylines.',\n },\n fields: [\n {\n name: 'jobTitle',\n type: 'text',\n admin: { description: 'schema.org jobTitle (defaults to role if empty)' },\n },\n {\n name: 'worksFor',\n type: 'text',\n admin: { description: 'Organization name for schema.org worksFor' },\n },\n {\n name: 'sameAs',\n type: 'array',\n admin: {\n description: 'Extra canonical URLs for this person (Wikipedia, Crunchbase, etc.)',\n },\n fields: [{ name: 'url', type: 'text', required: true }],\n },\n ],\n },\n ],\n },\n ],\n }\n}\n","/** Shared language options for CMS code blocks and Lexical CodeBlock feature. */\nexport const languageOptions = [\n { label: 'TypeScript', value: 'typescript' },\n { label: 'JavaScript', value: 'javascript' },\n { label: 'Python', value: 'python' },\n { label: 'Bash / Shell', value: 'bash' },\n { label: 'Shell', value: 'shell' },\n { label: 'JSON', value: 'json' },\n { label: 'CSS', value: 'css' },\n { label: 'HTML', value: 'html' },\n { label: 'Rust', value: 'rust' },\n { label: 'Go', value: 'go' },\n { label: 'YAML', value: 'yaml' },\n { label: 'Markdown', value: 'markdown' },\n { label: 'Plain Text', value: 'plaintext' },\n]\n\nexport const codeBlockLanguages: Record<string, string> = Object.fromEntries(\n languageOptions.map((opt) => [opt.value, opt.label])\n)\n\nexport const defaultCodeLanguage = 'plaintext'\n","import { languageOptions } from './language-options.js'\n\nimport type { Block } from 'payload'\n\nexport const codeBlock: Block = {\n slug: 'code',\n labels: { singular: 'Code Block', plural: 'Code Blocks' },\n fields: [\n {\n name: 'language',\n type: 'select',\n defaultValue: 'typescript',\n options: languageOptions,\n },\n {\n name: 'filename',\n type: 'text',\n admin: { description: 'Optional filename label shown above the block' },\n },\n {\n name: 'code',\n type: 'code',\n required: true,\n admin: { language: 'typescript' },\n },\n ],\n}\n","import { languageOptions } from './language-options.js'\n\nimport type { Block } from 'payload'\n\nexport const codeTabsBlock: Block = {\n slug: 'code-tabs',\n labels: { singular: 'Code Tabs', plural: 'Code Tabs' },\n fields: [\n {\n name: 'tabs',\n type: 'array',\n required: true,\n minRows: 1,\n fields: [\n {\n name: 'label',\n type: 'text',\n required: true,\n admin: { description: 'Tab label (e.g. Windows, Linux, Android)' },\n },\n {\n name: 'language',\n type: 'select',\n defaultValue: 'bash',\n options: languageOptions,\n },\n {\n name: 'code',\n type: 'code',\n required: true,\n admin: { language: 'bash' },\n },\n ],\n },\n ],\n}\n","import type { Block } from 'payload'\n\nexport const downloadCtaBlock: Block = {\n slug: 'download-cta',\n labels: { singular: 'Download CTA', plural: 'Download CTAs' },\n fields: [\n {\n name: 'eyebrow',\n type: 'text',\n localized: true,\n },\n {\n name: 'heading',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'headingAccent',\n type: 'text',\n localized: true,\n },\n {\n name: 'description',\n type: 'textarea',\n localized: true,\n },\n {\n name: 'submitLabel',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'downloadUrl',\n type: 'text',\n required: true,\n },\n {\n name: 'downloadLabel',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'successMessage',\n type: 'textarea',\n localized: true,\n },\n {\n name: 'consent',\n type: 'textarea',\n localized: true,\n },\n {\n name: 'footnote',\n type: 'textarea',\n localized: true,\n },\n ],\n}\n","import type { Block } from 'payload'\n\nexport const imageBlock: Block = {\n slug: 'image',\n labels: { singular: 'Image', plural: 'Images' },\n fields: [\n {\n name: 'image',\n type: 'upload',\n relationTo: 'media',\n required: true,\n },\n {\n name: 'caption',\n type: 'text',\n localized: true,\n },\n {\n name: 'size',\n type: 'select',\n defaultValue: 'full',\n options: [\n { label: 'Full Width', value: 'full' },\n { label: 'Wide', value: 'wide' },\n { label: 'Medium', value: 'medium' },\n ],\n },\n ],\n}\n","import type { Block } from 'payload'\n\nexport const videoBlock: Block = {\n slug: 'video',\n labels: { singular: 'Video', plural: 'Videos' },\n fields: [\n {\n name: 'video',\n type: 'upload',\n relationTo: 'media',\n required: true,\n filterOptions: {\n mimeType: { contains: 'video' },\n },\n },\n {\n name: 'caption',\n type: 'text',\n localized: true,\n },\n {\n name: 'size',\n type: 'select',\n defaultValue: 'full',\n options: [\n { label: 'Full Width', value: 'full' },\n { label: 'Wide', value: 'wide' },\n { label: 'Medium', value: 'medium' },\n ],\n },\n ],\n}\n","import {\n BlocksFeature,\n CodeBlock,\n EXPERIMENTAL_TableFeature,\n UploadFeature,\n editorConfigFactory,\n lexicalEditor,\n} from '@payloadcms/richtext-lexical'\n\nimport { codeBlockLanguages, defaultCodeLanguage } from '../blocks/language-options.js'\nimport { videoBlock } from '../blocks/video.js'\n\nimport type { FeatureProviderServer } from '@payloadcms/richtext-lexical'\nimport type { SanitizedConfig } from 'payload'\n\nconst richTextFeatures = ({\n defaultFeatures,\n}: {\n defaultFeatures: FeatureProviderServer[]\n rootFeatures: FeatureProviderServer[]\n}) => [\n ...defaultFeatures.filter((feature) => feature.key !== 'upload'),\n UploadFeature({\n collections: {\n media: {\n fields: [\n {\n name: 'caption',\n type: 'text',\n },\n ],\n },\n },\n }),\n BlocksFeature({\n blocks: [\n CodeBlock({\n languages: codeBlockLanguages,\n defaultLanguage: defaultCodeLanguage,\n }),\n videoBlock,\n ],\n }),\n EXPERIMENTAL_TableFeature(),\n]\n\n/**\n * Shared Lexical editor for every `richText` field.\n *\n * Adds `CodeBlock`, inline `video` block, media upload captions, and\n * `EXPERIMENTAL_TableFeature` on top of Payload defaults.\n */\n// Return type is derived from `lexicalEditor` (a public export) rather than the\n// inferred `LexicalRichTextAdapterProvider` (not re-exported), so the generated\n// declaration stays portable while keeping the narrow Lexical adapter type that\n// consumers like `editorConfigFactory.fromEditor` require.\nexport const richTextEditor = (): ReturnType<typeof lexicalEditor> =>\n lexicalEditor({\n features: richTextFeatures,\n })\n\n/** Resolve Lexical editor config for seed scripts / markdown conversion. */\nexport async function getRichTextEditorConfig(config: SanitizedConfig) {\n return editorConfigFactory.fromFeatures({\n config,\n features: richTextFeatures,\n })\n}\n","import { richTextEditor } from '../lexical/editor.js'\n\nimport type { Block } from 'payload'\n\nexport const richTextBlock: Block = {\n slug: 'rich-text',\n labels: { singular: 'Rich Text', plural: 'Rich Text Blocks' },\n fields: [\n {\n name: 'content',\n type: 'richText',\n localized: true,\n editor: richTextEditor(),\n },\n ],\n}\n","import type { Block } from 'payload'\n\nexport const stepsBlock: Block = {\n slug: 'steps',\n labels: { singular: 'Steps List', plural: 'Steps Lists' },\n fields: [\n {\n name: 'items',\n type: 'array',\n required: true,\n minRows: 1,\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'description',\n type: 'textarea',\n localized: true,\n },\n {\n name: 'avatar',\n type: 'upload',\n relationTo: 'media',\n admin: { description: 'Optional avatar or icon shown next to the step' },\n },\n ],\n },\n ],\n}\n","import { codeBlock } from './code.js'\nimport { codeTabsBlock } from './code-tabs.js'\nimport { downloadCtaBlock } from './download-cta.js'\nimport { imageBlock } from './image.js'\nimport { richTextBlock } from './rich-text.js'\nimport { stepsBlock } from './steps.js'\nimport { videoBlock } from './video.js'\n\nimport type { Block } from 'payload'\n\nexport const leafBlocks: Block[] = [\n richTextBlock,\n codeBlock,\n codeTabsBlock,\n imageBlock,\n videoBlock,\n downloadCtaBlock,\n stepsBlock,\n]\n","import { leafBlocks } from './leaf-blocks.js'\n\nimport type { Block } from 'payload'\n\nexport const accordionBlock: Block = {\n slug: 'accordion',\n labels: { singular: 'Accordion', plural: 'Accordions' },\n fields: [\n {\n name: 'items',\n type: 'array',\n required: true,\n minRows: 1,\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'defaultOpen',\n type: 'checkbox',\n defaultValue: false,\n },\n {\n name: 'content',\n type: 'blocks',\n blocks: leafBlocks,\n localized: true,\n },\n ],\n },\n ],\n}\n","import type { Block } from 'payload'\n\nexport const sectionHeadingBlock: Block = {\n slug: 'section-heading',\n labels: { singular: 'Section Heading', plural: 'Section Headings' },\n fields: [\n {\n name: 'text',\n type: 'text',\n required: true,\n localized: true,\n },\n ],\n}\n","import { accordionBlock } from './accordion.js'\nimport { codeBlock } from './code.js'\nimport { codeTabsBlock } from './code-tabs.js'\nimport { downloadCtaBlock } from './download-cta.js'\nimport { imageBlock } from './image.js'\nimport { richTextBlock } from './rich-text.js'\nimport { sectionHeadingBlock } from './section-heading.js'\nimport { stepsBlock } from './steps.js'\nimport { videoBlock } from './video.js'\n\nimport type { Block } from 'payload'\n\nexport { richTextBlock } from './rich-text.js'\nexport { codeBlock } from './code.js'\nexport { codeTabsBlock } from './code-tabs.js'\nexport { imageBlock } from './image.js'\nexport { videoBlock } from './video.js'\nexport { downloadCtaBlock } from './download-cta.js'\nexport { stepsBlock } from './steps.js'\nexport { accordionBlock } from './accordion.js'\nexport { sectionHeadingBlock } from './section-heading.js'\nexport { leafBlocks } from './leaf-blocks.js'\nexport { languageOptions, codeBlockLanguages, defaultCodeLanguage } from './language-options.js'\n\nexport const blogContentBlocks: Block[] = [\n richTextBlock,\n codeBlock,\n codeTabsBlock,\n imageBlock,\n videoBlock,\n downloadCtaBlock,\n stepsBlock,\n accordionBlock,\n]\n\nexport const pageContentBlocks: Block[] = [\n richTextBlock,\n codeBlock,\n codeTabsBlock,\n imageBlock,\n stepsBlock,\n accordionBlock,\n]\n\nexport const showcaseContentBlocks: Block[] = [\n sectionHeadingBlock,\n richTextBlock,\n codeBlock,\n imageBlock,\n]\n","import type { CollectionAfterReadHook, CollectionBeforeChangeHook } from 'payload'\n\nfunction toCategoryIdList(value: unknown): string[] {\n if (value == null || value === '') return []\n const items = Array.isArray(value) ? value : [value]\n return items\n .map((item) => {\n if (typeof item === 'string' || typeof item === 'number') return String(item)\n if (item && typeof item === 'object' && 'id' in item && item.id != null) {\n return String(item.id)\n }\n return null\n })\n .filter((id): id is string => Boolean(id))\n}\n\n/** Posts saved before `category` became `hasMany` still store a single value. */\nexport const coerceBlogPostCategoriesOnWrite: CollectionBeforeChangeHook = ({ data }) => {\n if (!data || !('category' in data)) return data\n data.category = toCategoryIdList(data.category)\n return data\n}\n\nexport const coerceBlogPostCategoriesOnRead: CollectionAfterReadHook = ({ doc }) => {\n if (!doc) return doc\n if (doc.category == null || doc.category === '') {\n doc.category = []\n return doc\n }\n if (!Array.isArray(doc.category)) {\n doc.category = [doc.category]\n }\n return doc\n}\n","import type { CollectionBeforeChangeHook } from 'payload'\n\nexport const setPublishedAt: CollectionBeforeChangeHook = ({ data }) => {\n if (data && !data.publishedAt && data._status === 'published') {\n data.publishedAt = new Date().toISOString()\n }\n return data\n}\n","import type { CollectionConfig } from 'payload'\n\nexport const draftsWithAutosave: CollectionConfig['versions'] = {\n maxPerDoc: 25,\n drafts: {\n autosave: {\n interval: 800,\n },\n schedulePublish: true,\n },\n}\n","import { blogContentBlocks } from '../blocks/index.js'\nimport {\n coerceBlogPostCategoriesOnRead,\n coerceBlogPostCategoriesOnWrite,\n} from '../hooks/coerce-blog-post-categories.js'\nimport { setPublishedAt } from '../hooks/set-published-at.js'\nimport { slugify } from '../hooks/slugify.js'\nimport { draftsWithAutosave } from '../shared/drafts-with-autosave.js'\nimport { seoFields } from '../shared/seo-fields.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\n/** Stock blog-posts collection (no site revalidation — add via overrides.hooks). */\nexport function createBlogPosts(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'blog-posts',\n defaultSort: '-publishedAt',\n admin: {\n useAsTitle: 'title',\n defaultColumns: ['title', 'slug', 'author', 'publishedAt', '_status'],\n },\n access: {\n read: access.adminOrPublished,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n versions: draftsWithAutosave,\n hooks: {\n beforeChange: [setPublishedAt, coerceBlogPostCategoriesOnWrite],\n afterRead: [coerceBlogPostCategoriesOnRead],\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: {\n position: 'sidebar',\n description: 'URL-friendly identifier. Not localized — one slug per post.',\n },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'coverImage',\n type: 'upload',\n relationTo: 'media',\n },\n {\n name: 'imageAlt',\n type: 'text',\n localized: true,\n admin: {\n description:\n 'Alt text used for the auto-generated social/OG image (`og:image:alt`). Should describe the post for screen readers.',\n },\n },\n {\n name: 'excerpt',\n type: 'textarea',\n localized: true,\n admin: {\n description: 'Short summary shown in listing cards and meta description fallback.',\n },\n },\n {\n name: 'content',\n type: 'blocks',\n localized: true,\n blocks: blogContentBlocks,\n },\n {\n name: 'author',\n type: 'relationship',\n relationTo: 'authors',\n admin: { position: 'sidebar' },\n },\n {\n name: 'category',\n type: 'relationship',\n relationTo: 'categories',\n hasMany: true,\n label: 'Categories',\n admin: { position: 'sidebar' },\n },\n {\n name: 'readingTime',\n type: 'number',\n min: 1,\n admin: {\n position: 'sidebar',\n description: 'Estimated reading time in minutes.',\n },\n },\n {\n name: 'publishedAt',\n type: 'date',\n admin: {\n position: 'sidebar',\n date: { pickerAppearance: 'dayAndTime' },\n description: 'Auto-filled on first publish if left empty.',\n },\n },\n {\n name: 'showLatestNews',\n type: 'checkbox',\n defaultValue: true,\n admin: {\n position: 'sidebar',\n description: 'Show a \"Latest News\" section at the bottom of this post.',\n },\n },\n seoFields,\n ],\n }\n}\n","import { slugify } from '../hooks/slugify.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\nexport function createCategories(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'categories',\n admin: {\n useAsTitle: 'name',\n defaultColumns: ['name', 'slug'],\n },\n access: {\n read: access.publicRead,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: { position: 'sidebar' },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'description',\n type: 'textarea',\n localized: true,\n },\n ],\n }\n}\n","import { slugify } from '../hooks/slugify.js'\nimport { draftsWithAutosave } from '../shared/drafts-with-autosave.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\n/**\n * Stock changelog collection (shared fields only).\n * Site-specific body / GitHub / related-block fields — add via `overrides.fields`.\n * Revalidation — add via `overrides.hooks`.\n */\nexport function createChangelog(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'changelog',\n labels: { singular: 'Changelog', plural: 'Changelog' },\n defaultSort: '-releaseDate',\n admin: {\n useAsTitle: 'title',\n defaultColumns: ['title', 'version', 'versionType', 'tags', 'releaseDate', '_status'],\n },\n access: {\n read: access.adminOrPublished,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n versions: draftsWithAutosave,\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n localized: true,\n admin: {\n description:\n 'Release headline shown on the changelog detail page (e.g. \"Added Solana Support\").',\n },\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: {\n position: 'sidebar',\n description: 'URL-friendly identifier. Not localized — one slug per entry.',\n },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'version',\n type: 'text',\n admin: {\n position: 'sidebar',\n description:\n 'Optional semantic version label shown in the badge, e.g. v1.1.0 or 2.3.0. Omit for non-versioned announcements.',\n },\n },\n {\n name: 'versionType',\n type: 'select',\n options: [\n { label: 'Major', value: 'major' },\n { label: 'Minor', value: 'minor' },\n { label: 'Patch', value: 'patch' },\n ],\n admin: {\n position: 'sidebar',\n description:\n 'Release line for badge styling (major / minor / patch). Editors set this explicitly.',\n },\n },\n {\n name: 'releaseDate',\n type: 'date',\n required: true,\n admin: {\n position: 'sidebar',\n date: { pickerAppearance: 'dayOnly', displayFormat: 'MMM d, yyyy' },\n },\n },\n {\n name: 'tags',\n type: 'relationship',\n relationTo: 'changelog-tags',\n hasMany: true,\n label: 'Tags',\n admin: {\n position: 'sidebar',\n description: 'Editor-managed tags from the Changelog Tags collection.',\n },\n },\n {\n name: 'heroImage',\n type: 'upload',\n relationTo: 'media',\n admin: {\n description: 'Large visual above the article body on the changelog detail page.',\n },\n },\n {\n name: 'summary',\n type: 'textarea',\n localized: true,\n admin: {\n description: 'Short excerpt for listing cards and previews.',\n },\n },\n ],\n }\n}\n","import { slugify } from '../hooks/slugify.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\n/** Stock changelog-tags (no site revalidation — add via overrides.hooks). */\nexport function createChangelogTags(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'changelog-tags',\n defaultSort: 'order',\n admin: {\n useAsTitle: 'name',\n defaultColumns: ['name', 'slug', 'order'],\n description: 'Tags shown on changelog entries.',\n },\n access: {\n read: access.publicRead,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: {\n position: 'sidebar',\n description: 'URL-friendly identifier used by listing filters.',\n },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'order',\n type: 'number',\n defaultValue: 0,\n admin: {\n position: 'sidebar',\n description: 'Display order in admin lists (ascending). Ties broken by name.',\n },\n },\n {\n name: 'description',\n type: 'textarea',\n localized: true,\n admin: { description: 'Optional context shown to editors. Not rendered publicly yet.' },\n },\n ],\n }\n}\n","import { slugify } from '../hooks/slugify.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\n/** Stock event-tags (no site revalidation — add via overrides.hooks). */\nexport function createEventTags(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'event-tags',\n labels: { singular: 'Event Tag', plural: 'Event Tags' },\n defaultSort: 'order',\n admin: {\n useAsTitle: 'name',\n defaultColumns: ['name', 'slug', 'order'],\n description:\n 'Reusable event categories (Meetup, Workshop, Hackathon, …). Editors can add types without code changes. Related from Events.',\n },\n access: {\n read: access.publicRead,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: {\n position: 'sidebar',\n description: 'URL-friendly identifier used by filters and relationships.',\n },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'order',\n type: 'number',\n defaultValue: 0,\n admin: {\n position: 'sidebar',\n description: 'Display order in admin lists (ascending). Ties broken by name.',\n },\n },\n {\n name: 'description',\n type: 'textarea',\n localized: true,\n admin: { description: 'Optional context shown to editors.' },\n },\n ],\n }\n}\n","import { setPublishedAt } from '../hooks/set-published-at.js'\nimport { slugify } from '../hooks/slugify.js'\nimport { richTextEditor } from '../lexical/editor.js'\nimport { draftsWithAutosave } from '../shared/drafts-with-autosave.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig, Validate } from 'payload'\n\n/**\n * Display abbreviations accepted in addition to IANA names (e.g. Europe/Paris).\n * Sites map these to IANA when they need a timezone database identifier.\n */\nconst TIMEZONE_ABBREVIATIONS = new Set([\n 'UTC',\n 'GMT',\n 'CET',\n 'CEST',\n 'WET',\n 'WEST',\n 'EET',\n 'EEST',\n 'BST',\n 'EST',\n 'EDT',\n 'CST',\n 'CDT',\n 'MST',\n 'MDT',\n 'PST',\n 'PDT',\n])\n\nfunction parseDate(value: unknown): Date | null {\n if (value instanceof Date) {\n return Number.isNaN(value.getTime()) ? null : value\n }\n if (typeof value === 'string' && value.trim()) {\n const date = new Date(value)\n return Number.isNaN(date.getTime()) ? null : date\n }\n return null\n}\n\nfunction isValidIanaTimeZone(timeZone: string): boolean {\n try {\n Intl.DateTimeFormat('en-US', { timeZone }).format(new Date())\n return true\n } catch {\n return false\n }\n}\n\nconst validateTimezone: Validate<string | null | undefined> = (value) => {\n if (!value || !value.trim()) return 'Timezone is required.'\n const timeZone = value.trim()\n if (TIMEZONE_ABBREVIATIONS.has(timeZone.toUpperCase())) return true\n if (isValidIanaTimeZone(timeZone)) return true\n return 'Must be a timezone abbreviation (CET, UTC, …) or a valid IANA timezone (e.g. Europe/Paris).'\n}\n\nconst validateExternalUrl: Validate<string | null | undefined> = (value) => {\n if (!value || !value.trim()) return 'External URL is required.'\n try {\n new URL(value)\n return true\n } catch {\n return 'Must be a valid URL (e.g. https://example.com/event).'\n }\n}\n\nconst validateEndsAt: Validate<string | Date | null | undefined> = (value, { siblingData }) => {\n const end = parseDate(value)\n if (!end) return 'End date and time is required.'\n\n const start = parseDate(\n siblingData && typeof siblingData === 'object' && 'startsAt' in siblingData\n ? siblingData.startsAt\n : undefined\n )\n if (start && end.getTime() <= start.getTime()) {\n return 'End date and time must be after the start.'\n }\n\n return true\n}\n\n/**\n * Stock events collection (shared fields only).\n * SEO / site-specific fields — add via `overrides.fields`.\n * Revalidation — add via `overrides.hooks`.\n */\nexport function createEvents(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'events',\n labels: { singular: 'Event', plural: 'Events' },\n defaultSort: 'startsAt',\n admin: {\n useAsTitle: 'title',\n defaultColumns: ['title', 'slug', 'tag', 'startsAt', 'endsAt', '_status'],\n description: 'Reusable events consumed by marketing / community surfaces across sites.',\n },\n access: {\n read: access.adminOrPublished,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n versions: draftsWithAutosave,\n hooks: {\n beforeChange: [setPublishedAt],\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: {\n position: 'sidebar',\n description: 'URL-friendly identifier. Not localized — one slug per event.',\n },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'summary',\n type: 'textarea',\n required: true,\n localized: true,\n admin: {\n description: 'Short description for listings, previews, and calendar bodies.',\n },\n },\n {\n name: 'coverImage',\n type: 'upload',\n relationTo: 'media',\n admin: {\n description: 'Optional cover/hero image for detail or promotional surfaces.',\n },\n },\n {\n name: 'startsAt',\n type: 'date',\n required: true,\n admin: {\n position: 'sidebar',\n date: { pickerAppearance: 'dayAndTime', displayFormat: 'MMM d, yyyy h:mm a' },\n description: 'Event start date and time. Sites derive upcoming vs past from this value.',\n },\n },\n {\n name: 'endsAt',\n type: 'date',\n required: true,\n validate: validateEndsAt,\n admin: {\n position: 'sidebar',\n date: { pickerAppearance: 'dayAndTime', displayFormat: 'MMM d, yyyy h:mm a' },\n description: 'Event end date and time. Must be after the start.',\n },\n },\n {\n name: 'timezone',\n type: 'text',\n required: true,\n validate: validateTimezone,\n admin: {\n position: 'sidebar',\n description:\n 'Display timezone: abbreviation (CET, WET, UTC) or IANA name (Europe/Paris).',\n },\n },\n {\n name: 'location',\n type: 'text',\n required: true,\n localized: true,\n admin: {\n description: 'Venue or platform (e.g. Discord, Online, Lisbon).',\n },\n },\n {\n name: 'tag',\n type: 'relationship',\n relationTo: 'event-tags',\n required: true,\n admin: {\n position: 'sidebar',\n description: 'Primary event category from Event Tags.',\n },\n },\n {\n name: 'ctaKind',\n type: 'select',\n required: true,\n defaultValue: 'link',\n options: [\n { label: 'External link', value: 'link' },\n { label: 'Add to calendar', value: 'calendar' },\n ],\n admin: {\n position: 'sidebar',\n description:\n 'Primary listing action. Link opens the external URL; calendar lets the site offer an add-to-calendar flow.',\n },\n },\n {\n name: 'ctaLabel',\n type: 'text',\n required: true,\n localized: true,\n admin: {\n description: 'Label for the primary listing action (e.g. Register, Watch recording).',\n },\n },\n {\n name: 'ctaUrl',\n type: 'text',\n required: true,\n validate: validateExternalUrl,\n admin: {\n description:\n 'External event URL. Opened for link actions; included in calendar details for calendar actions.',\n },\n },\n {\n name: 'content',\n type: 'richText',\n localized: true,\n editor: richTextEditor(),\n admin: {\n description: 'Optional long-form body for event detail pages.',\n },\n },\n {\n name: 'publishedAt',\n type: 'date',\n admin: {\n position: 'sidebar',\n date: { pickerAppearance: 'dayAndTime' },\n description: 'Auto-filled on first publish if left empty.',\n },\n },\n ],\n }\n}\n","import type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\n/** Stock media upload collection (always publicly readable once uploaded). */\nexport function createMedia(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'media',\n admin: {\n useAsTitle: 'filename',\n defaultColumns: ['filename', 'alt', 'updatedAt'],\n },\n access: {\n read: access.publicRead,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n upload: {\n imageSizes: [\n {\n name: 'thumbnail',\n width: 400,\n height: 300,\n position: 'centre',\n },\n {\n name: 'card',\n width: 768,\n height: 512,\n position: 'centre',\n },\n {\n name: 'tablet',\n width: 1024,\n height: undefined,\n position: 'centre',\n },\n ],\n adminThumbnail: 'thumbnail',\n mimeTypes: ['image/*', 'video/*', 'application/pdf'],\n },\n fields: [\n {\n name: 'alt',\n type: 'text',\n required: true,\n localized: true,\n },\n ],\n }\n}\n","import { pageContentBlocks } from '../blocks/index.js'\nimport { setPublishedAt } from '../hooks/set-published-at.js'\nimport { slugify } from '../hooks/slugify.js'\nimport { draftsWithAutosave } from '../shared/drafts-with-autosave.js'\nimport { seoFields } from '../shared/seo-fields.js'\n\nimport type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\nfunction createContentPageCollection(\n access: AccessHelpers,\n slug: 'pages' | 'legal-pages'\n): CollectionConfig {\n return {\n slug,\n admin: {\n useAsTitle: 'title',\n defaultColumns: ['title', 'slug', 'publishedAt', '_status'],\n },\n access: {\n read: access.adminOrPublished,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n },\n versions: draftsWithAutosave,\n hooks: {\n beforeChange: [setPublishedAt],\n },\n fields: [\n {\n name: 'title',\n type: 'text',\n required: true,\n localized: true,\n },\n {\n name: 'slug',\n type: 'text',\n required: true,\n unique: true,\n admin: {\n position: 'sidebar',\n description: 'URL-friendly identifier. Not localized — one slug per page.',\n },\n hooks: { beforeValidate: [slugify] },\n },\n {\n name: 'content',\n type: 'blocks',\n localized: true,\n blocks: pageContentBlocks,\n },\n {\n name: 'publishedAt',\n type: 'date',\n admin: {\n position: 'sidebar',\n date: { pickerAppearance: 'dayAndTime' },\n description: 'Auto-filled on first publish if left empty.',\n },\n },\n seoFields,\n ],\n }\n}\n\nexport function createPages(access: AccessHelpers): CollectionConfig {\n return createContentPageCollection(access, 'pages')\n}\n\nexport function createLegalPages(access: AccessHelpers): CollectionConfig {\n return createContentPageCollection(access, 'legal-pages')\n}\n","import type { AccessHelpers } from '../shared/access.js'\nimport type { CollectionConfig } from 'payload'\n\nexport function createUsers(access: AccessHelpers): CollectionConfig {\n return {\n slug: 'users',\n admin: {\n useAsTitle: 'email',\n },\n auth: {\n verify: false,\n },\n access: {\n read: access.adminOnly,\n create: access.adminOnly,\n update: access.adminOnly,\n delete: access.adminOnly,\n admin: access.adminOnly,\n },\n fields: [\n {\n name: 'googleId',\n type: 'text',\n unique: true,\n index: true,\n admin: {\n position: 'sidebar',\n readOnly: true,\n description: 'Google OAuth user ID',\n },\n },\n {\n name: 'name',\n type: 'text',\n admin: {\n description: 'Display name from Google',\n },\n },\n {\n name: 'picture',\n type: 'text',\n admin: {\n description: 'Profile picture URL from Google',\n },\n },\n ],\n }\n}\n","import type { AccessHelpers } from '../shared/access.js'\nimport type { GlobalConfig } from 'payload'\n\nexport function createSiteSettings(access: AccessHelpers): GlobalConfig {\n return {\n slug: 'site-settings',\n label: 'Site Settings',\n access: {\n read: access.publicRead,\n update: access.adminOnly,\n },\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n localized: true,\n admin: {\n description: 'Public site name used in titles and structured data.',\n },\n },\n {\n name: 'defaultDescription',\n type: 'textarea',\n required: true,\n localized: true,\n admin: {\n description: 'Fallback meta description when a page does not define its own.',\n },\n },\n {\n name: 'defaultOgImage',\n type: 'upload',\n relationTo: 'media',\n admin: {\n description: 'Default Open Graph image (1200×630 recommended).',\n },\n },\n {\n name: 'organization',\n type: 'group',\n label: 'Organization',\n fields: [\n {\n name: 'name',\n type: 'text',\n required: true,\n },\n {\n name: 'legalName',\n type: 'text',\n },\n {\n name: 'description',\n type: 'textarea',\n localized: true,\n },\n {\n name: 'logo',\n type: 'upload',\n relationTo: 'media',\n },\n {\n name: 'foundingDate',\n type: 'text',\n admin: { description: 'Year or ISO date for schema.org structured data.' },\n },\n ],\n },\n {\n name: 'social',\n type: 'group',\n label: 'Social Profiles',\n fields: [\n { name: 'twitter', type: 'text' },\n { name: 'github', type: 'text' },\n { name: 'linkedin', type: 'text' },\n ],\n },\n ],\n }\n}\n","import type { CollectionConfig, Field, GlobalConfig } from 'payload'\n\ntype OverridableConfig = CollectionConfig | GlobalConfig\n\ntype Override<TConfig extends OverridableConfig> =\n | false\n | {\n fields?: (base: Field[]) => Field[]\n hooks?: Partial<TConfig['hooks']>\n admin?: Partial<TConfig['admin']>\n access?: Partial<TConfig['access']>\n config?: (base: TConfig) => TConfig\n }\n\nexport type CollectionOverride = Override<CollectionConfig>\nexport type GlobalOverride = Override<GlobalConfig>\n\ntype HookArrays = Record<string, unknown[] | undefined>\n\n// Payload collection/global hooks are all arrays of functions, so overrides are\n// appended to the base hooks rather than replacing them.\nfunction mergeHooks(base: HookArrays | undefined, extra: HookArrays | undefined): HookArrays {\n const keys = new Set([...Object.keys(base ?? {}), ...Object.keys(extra ?? {})])\n const merged: HookArrays = {}\n keys.forEach((key) => {\n const combined = [...(base?.[key] ?? []), ...(extra?.[key] ?? [])]\n if (combined.length) merged[key] = combined\n })\n return merged\n}\n\nfunction applyOverride<TConfig extends OverridableConfig>(\n base: TConfig,\n override: Override<TConfig> | undefined\n): TConfig | null {\n if (override === false) return null\n if (!override) return base\n\n const next = {\n ...base,\n ...(override.admin && { admin: { ...base.admin, ...override.admin } }),\n ...(override.access && { access: { ...base.access, ...override.access } }),\n ...(override.fields && { fields: override.fields(base.fields ?? []) }),\n ...(override.hooks && { hooks: mergeHooks(base.hooks, override.hooks as HookArrays) }),\n } as TConfig\n\n return override.config ? override.config(next) : next\n}\n\nexport const applyCollectionOverride = (\n base: CollectionConfig,\n override: CollectionOverride | undefined\n): CollectionConfig | null => applyOverride(base, override)\n\nexport const applyGlobalOverride = (\n base: GlobalConfig,\n override: GlobalOverride | undefined\n): GlobalConfig | null => applyOverride(base, override)\n","import type { CollectionOverride, GlobalOverride } from './applyOverride.js'\n\n/** Slugs of the stock collections shipped by `buildCmsConfig`, in registration order. */\nexport const STOCK_COLLECTION_SLUGS = [\n 'users',\n 'api-tokens',\n 'media',\n 'authors',\n 'categories',\n 'blog-posts',\n 'pages',\n 'legal-pages',\n 'changelog-tags',\n 'changelog',\n 'event-tags',\n 'events',\n] as const\n\nexport type StockCollectionSlug = (typeof STOCK_COLLECTION_SLUGS)[number]\n\n/** Typed map of collection/global overrides for `buildCmsConfig`. */\nexport type Overrides = Partial<Record<StockCollectionSlug, CollectionOverride>> & {\n 'site-settings'?: GlobalOverride\n}\n","import { buildConfig } from 'payload'\n\nimport { createAccessHelpers, type AccessOptions } from './shared/access.js'\nimport { createApiTokens } from './collections/createApiTokens.js'\nimport { createAuthors } from './collections/createAuthors.js'\nimport { createBlogPosts } from './collections/createBlogPosts.js'\nimport { createCategories } from './collections/createCategories.js'\nimport { createChangelog } from './collections/createChangelog.js'\nimport { createChangelogTags } from './collections/createChangelogTags.js'\nimport { createEventTags } from './collections/createEventTags.js'\nimport { createEvents } from './collections/createEvents.js'\nimport { createMedia } from './collections/createMedia.js'\nimport { createLegalPages, createPages } from './collections/createPages.js'\nimport { createUsers } from './collections/createUsers.js'\nimport { createSiteSettings } from './globals/createSiteSettings.js'\nimport { richTextEditor } from './lexical/editor.js'\nimport { applyCollectionOverride, applyGlobalOverride } from './applyOverride.js'\nimport { STOCK_COLLECTION_SLUGS, type Overrides, type StockCollectionSlug } from './overrides.js'\n\nimport type { CollectionConfig, Config, GlobalConfig, Plugin } from 'payload'\n\nexport type BuildCmsConfigOptions<TLocale extends string = string> = {\n secret: string\n // Payload DB adapter instance (e.g. mongooseAdapter({ url }))\n db: Config['db']\n /** Sharp instance from the `sharp` package. */\n sharp?: Config['sharp']\n cors?: Config['cors']\n csrf?: Config['csrf']\n locales: readonly TLocale[]\n /** Must be one of `locales`. */\n defaultLocale: TLocale\n admin?: Config['admin']\n plugins?: Plugin[]\n /** Defaults to the package Lexical editor. */\n editor?: Config['editor']\n access?: AccessOptions\n /** Collection/global slug → override | false. */\n overrides?: Overrides\n extraCollections?: CollectionConfig[]\n extraGlobals?: GlobalConfig[]\n typescript?: Config['typescript']\n /** Extra top-level Payload config keys (e.g. endpoints, graphQL). */\n payload?: Partial<\n Omit<\n Config,\n | 'secret'\n | 'db'\n | 'sharp'\n | 'cors'\n | 'csrf'\n | 'admin'\n | 'plugins'\n | 'editor'\n | 'collections'\n | 'globals'\n | 'localization'\n | 'typescript'\n >\n >\n}\n\n/** Drop keys whose value is `undefined` so they don't clobber Payload defaults. */\nfunction defined<T extends Record<string, unknown>>(obj: T): Partial<T> {\n return Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== undefined)) as Partial<T>\n}\n\n/**\n * Build a Payload config from shared stock collections/globals plus site\n * overrides and extras. Types are still generated in the consuming app.\n */\nexport function buildCmsConfig<const TLocale extends string>(\n options: BuildCmsConfigOptions<TLocale>\n) {\n const overrides = options.overrides ?? {}\n const access = createAccessHelpers({\n ...options.access,\n apiTokens: options.access?.apiTokens ?? overrides['api-tokens'] !== false,\n })\n\n const stock: Record<StockCollectionSlug, CollectionConfig> = {\n 'users': createUsers(access),\n 'api-tokens': createApiTokens(access),\n 'media': createMedia(access),\n 'authors': createAuthors(access),\n 'categories': createCategories(access),\n 'blog-posts': createBlogPosts(access),\n 'pages': createPages(access),\n 'legal-pages': createLegalPages(access),\n 'changelog-tags': createChangelogTags(access),\n 'changelog': createChangelog(access),\n 'event-tags': createEventTags(access),\n 'events': createEvents(access),\n }\n\n const collections = [\n ...STOCK_COLLECTION_SLUGS.map((slug) =>\n applyCollectionOverride(stock[slug], overrides[slug])\n ).filter((c): c is CollectionConfig => c !== null),\n ...(options.extraCollections ?? []),\n ]\n\n const siteSettings = applyGlobalOverride(createSiteSettings(access), overrides['site-settings'])\n const globals = [...(siteSettings ? [siteSettings] : []), ...(options.extraGlobals ?? [])]\n const { jobs: jobsOverride, ...payloadRest } = options.payload ?? {}\n\n return buildConfig({\n ...payloadRest,\n jobs: {\n // In-process cron so Payload `schedulePublish` jobs actually run.\n // Override via `payload.jobs`. Do not use on serverless hosts.\n autoRun: [{ cron: '* * * * *' }],\n ...jobsOverride,\n },\n ...defined({\n sharp: options.sharp,\n cors: options.cors,\n csrf: options.csrf,\n plugins: options.plugins,\n }),\n secret: options.secret,\n db: options.db,\n admin: {\n user: 'users',\n ...options.admin,\n },\n editor: options.editor ?? richTextEditor(),\n collections,\n ...(globals.length ? { globals } : {}),\n localization: {\n locales: options.locales.map((code) => ({\n code,\n label: code.toUpperCase(),\n })),\n defaultLocale: options.defaultLocale,\n fallback: true,\n },\n typescript: options.typescript ?? {\n outputFile: 'src/payload-types.ts',\n },\n })\n}\n","import { createLogger } from '../utils/logger/logger.js'\n\nconst log = createLogger('env')\n\n/**\n * Read a required env var. During Next.js `phase-production-build` and\n * `generate:importmap` (when NEXT_PHASE is unset) returns \"\" instead of throwing,\n * because those phases do not connect to the DB.\n */\nexport function requireEnvAtRuntime(name: string): string {\n const value = process.env[name]\n const isBuildTime = !process.env.NEXT_PHASE || process.env.NEXT_PHASE === 'phase-production-build'\n if (!value && !isBuildTime) {\n log.error(`Missing required environment variable: ${name}`)\n throw new Error(`Missing required environment variable: ${name}`)\n }\n return value ?? ''\n}\n","import { s3Storage } from '@payloadcms/storage-s3'\n\nimport type { Plugin } from 'payload'\n\nexport type CreateS3MediaPluginOptions = {\n /** Defaults to `process.env.AWS_S3_BUCKET`. */\n bucket?: string\n accessKeyId?: string\n secretAccessKey?: string\n region?: string\n /** Custom S3-compatible endpoint (MinIO, etc.). Defaults to `AWS_S3_ENDPOINT`. */\n endpoint?: string\n /** Defaults to `AWS_S3_FORCE_PATH_STYLE === 'true'`. */\n forcePathStyle?: boolean\n /** Collection slug that owns uploads. Defaults to `media`. */\n collection?: string\n}\n\n/** Payload S3 storage plugin wired for the stock `media` collection. */\nexport function createS3MediaPlugin(options: CreateS3MediaPluginOptions = {}): Plugin {\n const bucket = options.bucket ?? process.env.AWS_S3_BUCKET ?? ''\n const endpoint = options.endpoint ?? process.env.AWS_S3_ENDPOINT ?? ''\n const forcePathStyle = options.forcePathStyle ?? process.env.AWS_S3_FORCE_PATH_STYLE === 'true'\n\n return s3Storage({\n enabled: Boolean(bucket),\n collections: {\n [options.collection ?? 'media']: true,\n },\n bucket,\n config: {\n credentials: {\n accessKeyId: options.accessKeyId ?? process.env.AWS_ACCESS_KEY_ID ?? '',\n secretAccessKey: options.secretAccessKey ?? process.env.AWS_SECRET_ACCESS_KEY ?? '',\n },\n region: options.region ?? process.env.AWS_S3_REGION ?? 'us-east-1',\n ...(endpoint ? { endpoint } : {}),\n ...(forcePathStyle ? { forcePathStyle: true } : {}),\n },\n })\n}\n","import type { AccessHelpers } from '../shared/access.js'\nimport type { GlobalConfig, Validate } from 'payload'\n\nconst validateBannerId: Validate<string | null | undefined, { enabled?: boolean | null }> = (\n value,\n { siblingData }\n) => {\n if (siblingData?.enabled && !String(value ?? '').trim()) {\n return 'Banner ID is required when the banner is enabled.'\n }\n return true\n}\n\n/** Announcement banner global (no site revalidation — add via applyGlobalOverride hooks). */\nexport function createAnnouncementBanner(access: AccessHelpers): GlobalConfig {\n return {\n slug: 'announcement-banner',\n label: 'Announcement Banner',\n admin: {\n description:\n 'Sticky site-wide banner shown above the main navigation. Bump Banner ID when replacing content so users who dismissed an older message in the current session see the new one.',\n },\n access: {\n read: access.publicRead,\n update: access.adminOnly,\n },\n fields: [\n {\n name: 'enabled',\n type: 'checkbox',\n defaultValue: false,\n admin: {\n description: 'When off, the banner is hidden on the public site.',\n },\n },\n {\n name: 'bannerId',\n type: 'text',\n admin: {\n description:\n 'Stable identifier for this banner version. Change it when publishing new copy so users who dismissed an older banner in this session see the update.',\n },\n validate: validateBannerId,\n },\n {\n type: 'row',\n fields: [\n {\n name: 'prefix',\n type: 'text',\n localized: true,\n maxLength: 8,\n admin: {\n width: '25%',\n description: 'Accent label (max 8 characters), e.g. \"New:\"',\n },\n },\n {\n name: 'description',\n type: 'text',\n localized: true,\n maxLength: 1000,\n admin: {\n width: '75%',\n description: 'Banner message (max 1000 characters).',\n },\n },\n ],\n },\n {\n type: 'row',\n fields: [\n {\n name: 'ctaLabel',\n type: 'text',\n localized: true,\n maxLength: 18,\n admin: {\n width: '50%',\n description: 'Optional button label (max 18 characters).',\n },\n },\n {\n name: 'ctaHref',\n type: 'text',\n admin: {\n width: '50%',\n description: 'Optional button URL. Relative paths stay in-site.',\n },\n },\n ],\n },\n ],\n }\n}\n"],"mappings":";;;;;AAiBA,MAAM,eAAe,QAAiC,IAAI,MAAM,eAAe;AAE/E,MAAM,sBAAsB,QAC1B,IAAI,MAAM,eAAe,gBAAgB,IAAI,MAAM,YAAY;;;;;AAMjE,SAAgB,oBAAoB,UAAyB,CAAC,GAAkB;CAC9E,MAAM,YAAY,QAAQ,cAAc;CAExC,MAAM,aAAa,EAAE,UAA4C,YAAY,GAAG;CAEhF,MAAM,oBAA4B,EAAE,UAAU;EAC5C,IAAI,YAAY,GAAG,GAAG,OAAO;EAC7B,IAAI,aAAa,mBAAmB,GAAG,GAAG,OAAO;EACjD,OAAO,EAAE,SAAS,EAAE,QAAQ,YAAY,EAAE;CAC5C;CAEA,MAAM,cAAsB,EAAE,UAAU;EACtC,IAAI,aAAa,mBAAmB,GAAG,GAAG,OAAO;EACjD,OAAO;CACT;CAEA,MAAM,kBAA+B,EAAE,UAAU,YAAY,GAAG;CAEhE,OAAO;EAAE;EAAW;EAAkB;EAAY;CAAe;AACnE;;;AC1CA,MAAM,eAAuB,EAAE,UAAU;CACvC,IAAI,IAAI,MAAM,eAAe,SAAS,OAAO;CAC7C,IAAI,IAAI,MAAM,eAAe,cAAc,OAAO,EAAE,IAAI,EAAE,QAAQ,IAAI,KAAK,GAAG,EAAE;CAChF,OAAO;AACT;;;;;AAMA,SAAgB,gBAAgB,QAAyC;CACvE,OAAO;EACL,MAAM;EACN,QAAQ;GACN,UAAU;GACV,QAAQ;EACV;EACA,OAAO;GACL,YAAY;GACZ,gBAAgB;IAAC;IAAQ;IAAe;IAAW;GAAW;GAC9D,aACE;EAEJ;EACA,MAAM;GACJ,WAAW;GACX,sBAAsB;EACxB;EACA,QAAQ;GACN,MAAM;GACN,QAAQ,OAAO;GACf,QAAQ,OAAO;GACf,QAAQ,OAAO;GACf,OAAO,OAAO;EAChB;E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AAa;KACf;IACF,CACF;GACF;EACF;CACF;AACF"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Access, Block, CollectionBeforeChangeHook, CollectionConfig, Config, Field, FieldAccess, FieldHook, GlobalConfig, GroupField, PayloadRequest, Plugin, SanitizedConfig } from "payload";
|
|
1
|
+
import { Access, Block, CollectionAfterReadHook, CollectionBeforeChangeHook, CollectionConfig, Config, Field, FieldAccess, FieldHook, GlobalConfig, GroupField, PayloadRequest, Plugin, SanitizedConfig } from "payload";
|
|
2
2
|
import { lexicalEditor } from "@payloadcms/richtext-lexical";
|
|
3
3
|
//#region src/cms/shared/access.d.ts
|
|
4
4
|
type AccessOptions = {
|
|
@@ -87,6 +87,11 @@ declare const slugify: FieldHook;
|
|
|
87
87
|
//#region src/cms/hooks/set-published-at.d.ts
|
|
88
88
|
declare const setPublishedAt: CollectionBeforeChangeHook;
|
|
89
89
|
//#endregion
|
|
90
|
+
//#region src/cms/hooks/coerce-blog-post-categories.d.ts
|
|
91
|
+
/** Posts saved before `category` became `hasMany` still store a single value. */
|
|
92
|
+
declare const coerceBlogPostCategoriesOnWrite: CollectionBeforeChangeHook;
|
|
93
|
+
declare const coerceBlogPostCategoriesOnRead: CollectionAfterReadHook;
|
|
94
|
+
//#endregion
|
|
90
95
|
//#region src/cms/blocks/rich-text.d.ts
|
|
91
96
|
declare const richTextBlock: Block;
|
|
92
97
|
//#endregion
|
|
@@ -222,5 +227,9 @@ declare function createEvents(access: AccessHelpers): CollectionConfig;
|
|
|
222
227
|
//#region src/cms/globals/createSiteSettings.d.ts
|
|
223
228
|
declare function createSiteSettings(access: AccessHelpers): GlobalConfig;
|
|
224
229
|
//#endregion
|
|
225
|
-
|
|
230
|
+
//#region src/cms/globals/createAnnouncementBanner.d.ts
|
|
231
|
+
/** Announcement banner global (no site revalidation — add via applyGlobalOverride hooks). */
|
|
232
|
+
declare function createAnnouncementBanner(access: AccessHelpers): GlobalConfig;
|
|
233
|
+
//#endregion
|
|
234
|
+
export { createAccessHelpers as $, downloadCtaBlock as A, seoFields as B, codeBlockLanguages as C, sectionHeadingBlock as D, leafBlocks as E, richTextBlock as F, STOCK_COLLECTION_SLUGS as G, BuildCmsConfigOptions as H, coerceBlogPostCategoriesOnRead as I, GlobalOverride as J, StockCollectionSlug as K, coerceBlogPostCategoriesOnWrite as L, imageBlock as M, codeTabsBlock as N, accordionBlock as O, codeBlock as P, AccessOptions as Q, setPublishedAt as R, showcaseContentBlocks as S, languageOptions as T, buildCmsConfig as U, draftsWithAutosave as V, Overrides as W, applyGlobalOverride as X, applyCollectionOverride as Y, AccessHelpers as Z, requireEnvAtRuntime as _, createChangelog as a, blogContentBlocks as b, createPages as c, createAuthors as d, createMedia as f, createS3MediaPlugin as g, CreateS3MediaPluginOptions as h, createEventTags as i, videoBlock as j, stepsBlock as k, createBlogPosts as l, createUsers as m, createSiteSettings as n, createChangelogTags as o, createApiTokens as p, CollectionOverride as q, createEvents as r, createLegalPages as s, createAnnouncementBanner as t, createCategories as u, getRichTextEditorConfig as v, defaultCodeLanguage as w, pageContentBlocks as x, richTextEditor as y, slugify as z };
|
|
226
235
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/cms/shared/access.ts","../src/cms/applyOverride.ts","../src/cms/overrides.ts","../src/cms/buildCmsConfig.ts","../src/cms/shared/drafts-with-autosave.ts","../src/cms/shared/seo-fields.ts","../src/cms/hooks/slugify.ts","../src/cms/hooks/set-published-at.ts","../src/cms/blocks/rich-text.ts","../src/cms/blocks/code.ts","../src/cms/blocks/code-tabs.ts","../src/cms/blocks/image.ts","../src/cms/blocks/video.ts","../src/cms/blocks/download-cta.ts","../src/cms/blocks/steps.ts","../src/cms/blocks/accordion.ts","../src/cms/blocks/section-heading.ts","../src/cms/blocks/leaf-blocks.ts","../src/cms/blocks/language-options.ts","../src/cms/blocks/index.ts","../src/cms/lexical/editor.ts","../src/cms/requireEnv.ts","../src/cms/createS3MediaPlugin.ts","../src/cms/collections/createUsers.ts","../src/cms/collections/createApiTokens.ts","../src/cms/collections/createMedia.ts","../src/cms/collections/createAuthors.ts","../src/cms/collections/createCategories.ts","../src/cms/collections/createBlogPosts.ts","../src/cms/collections/createPages.ts","../src/cms/collections/createChangelogTags.ts","../src/cms/collections/createChangelog.ts","../src/cms/collections/createEventTags.ts","../src/cms/collections/createEvents.ts","../src/cms/globals/createSiteSettings.ts"],"mappings":";;;KAEY;;;;;EAKV;;KAGU;EACV,cAAc;IAAS,KAAK;;EAC5B,kBAAkB;EAClB,YAAY;EACZ,gBAAgB;;;;;;iBAYF,oBAAoB,UAAS,gBAAqB;;;KCxB7D,oBAAoB,mBAAmB;KAEvC,SAAS,gBAAgB;EAGxB,UAAU,MAAM,YAAY;EAC5B,QAAQ,QAAQ;EAChB,QAAQ,QAAQ;EAChB,SAAS,QAAQ;EACjB,UAAU,MAAM,YAAY;;KAGtB,qBAAqB,SAAS;KAC9B,iBAAiB,SAAS;cAkCzB,0BACX,MAAM,kBACN,UAAU,mCACT;cAEU,sBACX,MAAM,cACN,UAAU,+BACT;;;;cCtDU;KAeD,8BAA8B;;KAG9B,YAAY,QAAQ,OAAO,qBAAqB;EAC1D,kBAAkB;;;;KCDR,sBAAsB;EAChC;EAEA,IAAI;;EAEJ,QAAQ;EACR,OAAO;EACP,OAAO;EACP,kBAAkB;;EAElB,eAAe;EACf,QAAQ;EACR,UAAU;;EAEV,SAAS;EACT,SAAS;;EAET,YAAY;EACZ,mBAAmB;EACnB,eAAe;EACf,aAAa;;EAEb,UAAU,QACR,KACE;;;;;;iBA0BU,qBAAqB,wBACnC,SAAS,sBAAsB,WAAQ,0BAAA;;;cCtE5B,oBAAoB;;;cC2BpB,WAAW;;;cC3BX,SAAS;;;cCAT,gBAAgB;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/cms/shared/access.ts","../src/cms/applyOverride.ts","../src/cms/overrides.ts","../src/cms/buildCmsConfig.ts","../src/cms/shared/drafts-with-autosave.ts","../src/cms/shared/seo-fields.ts","../src/cms/hooks/slugify.ts","../src/cms/hooks/set-published-at.ts","../src/cms/hooks/coerce-blog-post-categories.ts","../src/cms/blocks/rich-text.ts","../src/cms/blocks/code.ts","../src/cms/blocks/code-tabs.ts","../src/cms/blocks/image.ts","../src/cms/blocks/video.ts","../src/cms/blocks/download-cta.ts","../src/cms/blocks/steps.ts","../src/cms/blocks/accordion.ts","../src/cms/blocks/section-heading.ts","../src/cms/blocks/leaf-blocks.ts","../src/cms/blocks/language-options.ts","../src/cms/blocks/index.ts","../src/cms/lexical/editor.ts","../src/cms/requireEnv.ts","../src/cms/createS3MediaPlugin.ts","../src/cms/collections/createUsers.ts","../src/cms/collections/createApiTokens.ts","../src/cms/collections/createMedia.ts","../src/cms/collections/createAuthors.ts","../src/cms/collections/createCategories.ts","../src/cms/collections/createBlogPosts.ts","../src/cms/collections/createPages.ts","../src/cms/collections/createChangelogTags.ts","../src/cms/collections/createChangelog.ts","../src/cms/collections/createEventTags.ts","../src/cms/collections/createEvents.ts","../src/cms/globals/createSiteSettings.ts","../src/cms/globals/createAnnouncementBanner.ts"],"mappings":";;;KAEY;;;;;EAKV;;KAGU;EACV,cAAc;IAAS,KAAK;;EAC5B,kBAAkB;EAClB,YAAY;EACZ,gBAAgB;;;;;;iBAYF,oBAAoB,UAAS,gBAAqB;;;KCxB7D,oBAAoB,mBAAmB;KAEvC,SAAS,gBAAgB;EAGxB,UAAU,MAAM,YAAY;EAC5B,QAAQ,QAAQ;EAChB,QAAQ,QAAQ;EAChB,SAAS,QAAQ;EACjB,UAAU,MAAM,YAAY;;KAGtB,qBAAqB,SAAS;KAC9B,iBAAiB,SAAS;cAkCzB,0BACX,MAAM,kBACN,UAAU,mCACT;cAEU,sBACX,MAAM,cACN,UAAU,+BACT;;;;cCtDU;KAeD,8BAA8B;;KAG9B,YA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gB,QAAQ,gBAAgB;;;;;;;;iBCqFxC,aAAa,QAAQ,gBAAgB;;;iBCxFrC,mBAAmB,QAAQ,gBAAgB;;;;iBCW3C,yBAAyB,QAAQ,gBAAgB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as richTextBlock, B as languageOptions, C as blogContentBlocks, D as accordionBlock, E as sectionHeadingBlock, F as downloadCtaBlock, G as createAccessHelpers, H as seoFields, I as codeTabsBlock, L as codeBlock, M as richTextEditor, N as videoBlock, O as leafBlocks, P as imageBlock, R as codeBlockLanguages, S as coerceBlogPostCategoriesOnWrite, T as showcaseContentBlocks, U as slugify, V as createAuthors, W as createApiTokens, _ as createCategories, a as STOCK_COLLECTION_SLUGS, b as setPublishedAt, c as createSiteSettings, d as createPages, f as createMedia, g as createChangelog, h as createChangelogTags, i as buildCmsConfig, j as getRichTextEditorConfig, k as stepsBlock, l as createUsers, m as createEventTags, n as createS3MediaPlugin, o as applyCollectionOverride, p as createEvents, r as requireEnvAtRuntime, s as applyGlobalOverride, t as createAnnouncementBanner, u as createLegalPages, v as createBlogPosts, w as pageContentBlocks, x as coerceBlogPostCategoriesOnRead, y as draftsWithAutosave, z as defaultCodeLanguage } from "./cms.mjs";
|
|
2
2
|
import { t as createLogger } from "./logger.mjs";
|
|
3
3
|
import { n as readPayloadMediaBuffer, t as readPayloadMediaAsDataUrl } from "./readMediaBuffer.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { t as getSiteUrl } from "./site-url.mjs";
|
|
5
|
+
import { n as createMetadataFactory, t as getOgBackgroundDataUrl } from "./seo.mjs";
|
|
5
6
|
import { n as Languages, t as LanguageLabel } from "./i18n.mjs";
|
|
6
7
|
import { n as stripShikiPreBackground, t as toPlainValue } from "./utils.mjs";
|
|
7
|
-
export { LanguageLabel, Languages, STOCK_COLLECTION_SLUGS, accordionBlock, applyCollectionOverride, applyGlobalOverride, blogContentBlocks, buildCmsConfig, codeBlock, codeBlockLanguages, codeTabsBlock, createAccessHelpers, createApiTokens, createAuthors, createBlogPosts, createCategories, createChangelog, createChangelogTags, createEventTags, createEvents, createLegalPages, createLogger, createMedia, createMetadataFactory, createPages, createS3MediaPlugin, createSiteSettings, createUsers, defaultCodeLanguage, downloadCtaBlock, draftsWithAutosave, getOgBackgroundDataUrl, getRichTextEditorConfig, getSiteUrl, imageBlock, languageOptions, leafBlocks, pageContentBlocks, readPayloadMediaAsDataUrl, readPayloadMediaBuffer, requireEnvAtRuntime, richTextBlock, richTextEditor, sectionHeadingBlock, seoFields, setPublishedAt, showcaseContentBlocks, slugify, stepsBlock, stripShikiPreBackground, toPlainValue, videoBlock };
|
|
8
|
+
export { LanguageLabel, Languages, STOCK_COLLECTION_SLUGS, accordionBlock, applyCollectionOverride, applyGlobalOverride, blogContentBlocks, buildCmsConfig, codeBlock, codeBlockLanguages, codeTabsBlock, coerceBlogPostCategoriesOnRead, coerceBlogPostCategoriesOnWrite, createAccessHelpers, createAnnouncementBanner, createApiTokens, createAuthors, createBlogPosts, createCategories, createChangelog, createChangelogTags, createEventTags, createEvents, createLegalPages, createLogger, createMedia, createMetadataFactory, createPages, createS3MediaPlugin, createSiteSettings, createUsers, defaultCodeLanguage, downloadCtaBlock, draftsWithAutosave, getOgBackgroundDataUrl, getRichTextEditorConfig, getSiteUrl, imageBlock, languageOptions, leafBlocks, pageContentBlocks, readPayloadMediaAsDataUrl, readPayloadMediaBuffer, requireEnvAtRuntime, richTextBlock, richTextEditor, sectionHeadingBlock, seoFields, setPublishedAt, showcaseContentBlocks, slugify, stepsBlock, stripShikiPreBackground, toPlainValue, videoBlock };
|
package/dist/index5.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { $ as createAccessHelpers, A as downloadCtaBlock, B as seoFields, C as codeBlockLanguages, D as sectionHeadingBlock, E as leafBlocks, F as richTextBlock, G as STOCK_COLLECTION_SLUGS, H as BuildCmsConfigOptions, I as coerceBlogPostCategoriesOnRead, J as GlobalOverride, K as StockCollectionSlug, L as coerceBlogPostCategoriesOnWrite, M as imageBlock, N as codeTabsBlock, O as accordionBlock, P as codeBlock, Q as AccessOptions, R as setPublishedAt, S as showcaseContentBlocks, T as languageOptions, U as buildCmsConfig, V as draftsWithAutosave, W as Overrides, X as applyGlobalOverride, Y as applyCollectionOverride, Z as AccessHelpers, _ as requireEnvAtRuntime, a as createChangelog, b as blogContentBlocks, c as createPages, d as createAuthors, f as createMedia, g as createS3MediaPlugin, h as CreateS3MediaPluginOptions, i as createEventTags, j as videoBlock, k as stepsBlock, l as createBlogPosts, m as createUsers, n as createSiteSettings, o as createChangelogTags, p as createApiTokens, q as CollectionOverride, r as createEvents, s as createLegalPages, t as createAnnouncementBanner, u as createCategories, v as getRichTextEditorConfig, w as defaultCodeLanguage, x as pageContentBlocks, y as richTextEditor, z as slugify } from "./index.mjs";
|
|
2
2
|
import { n as readPayloadMediaAsDataUrl, r as readPayloadMediaBuffer, t as PayloadMedia } from "./readMediaBuffer.mjs";
|
|
3
3
|
import { n as Languages, t as LanguageLabel } from "./index2.mjs";
|
|
4
4
|
import { a as createMetadataFactory, i as OgImage, n as CreateMetadataFactoryOptions, o as GetSiteUrlOptions, r as CreateMetadataInput, s as getSiteUrl, t as getOgBackgroundDataUrl } from "./index3.mjs";
|
|
5
5
|
import { i as stripShikiPreBackground, n as createLogger, r as toPlainValue, t as Logger } from "./index4.mjs";
|
|
6
|
-
export { type AccessHelpers, type AccessOptions, type BuildCmsConfigOptions, type CollectionOverride, type CreateMetadataFactoryOptions, type CreateMetadataInput, type CreateS3MediaPluginOptions, type GetSiteUrlOptions, type GlobalOverride, LanguageLabel, Languages, type Logger, type OgImage, type Overrides, type PayloadMedia, STOCK_COLLECTION_SLUGS, type StockCollectionSlug, accordionBlock, applyCollectionOverride, applyGlobalOverride, blogContentBlocks, buildCmsConfig, codeBlock, codeBlockLanguages, codeTabsBlock, createAccessHelpers, createApiTokens, createAuthors, createBlogPosts, createCategories, createChangelog, createChangelogTags, createEventTags, createEvents, createLegalPages, createLogger, createMedia, createMetadataFactory, createPages, createS3MediaPlugin, createSiteSettings, createUsers, defaultCodeLanguage, downloadCtaBlock, draftsWithAutosave, getOgBackgroundDataUrl, getRichTextEditorConfig, getSiteUrl, imageBlock, languageOptions, leafBlocks, pageContentBlocks, readPayloadMediaAsDataUrl, readPayloadMediaBuffer, requireEnvAtRuntime, richTextBlock, richTextEditor, sectionHeadingBlock, seoFields, setPublishedAt, showcaseContentBlocks, slugify, stepsBlock, stripShikiPreBackground, toPlainValue, videoBlock };
|
|
6
|
+
export { type AccessHelpers, type AccessOptions, type BuildCmsConfigOptions, type CollectionOverride, type CreateMetadataFactoryOptions, type CreateMetadataInput, type CreateS3MediaPluginOptions, type GetSiteUrlOptions, type GlobalOverride, LanguageLabel, Languages, type Logger, type OgImage, type Overrides, type PayloadMedia, STOCK_COLLECTION_SLUGS, type StockCollectionSlug, accordionBlock, applyCollectionOverride, applyGlobalOverride, blogContentBlocks, buildCmsConfig, codeBlock, codeBlockLanguages, codeTabsBlock, coerceBlogPostCategoriesOnRead, coerceBlogPostCategoriesOnWrite, createAccessHelpers, createAnnouncementBanner, createApiTokens, createAuthors, createBlogPosts, createCategories, createChangelog, createChangelogTags, createEventTags, createEvents, createLegalPages, createLogger, createMedia, createMetadataFactory, createPages, createS3MediaPlugin, createSiteSettings, createUsers, defaultCodeLanguage, downloadCtaBlock, draftsWithAutosave, getOgBackgroundDataUrl, getRichTextEditorConfig, getSiteUrl, imageBlock, languageOptions, leafBlocks, pageContentBlocks, readPayloadMediaAsDataUrl, readPayloadMediaBuffer, requireEnvAtRuntime, richTextBlock, richTextEditor, sectionHeadingBlock, seoFields, setPublishedAt, showcaseContentBlocks, slugify, stepsBlock, stripShikiPreBackground, toPlainValue, videoBlock };
|
package/dist/seo/index.mjs
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as getSiteUrl } from "../site-url.mjs";
|
|
2
|
+
import { n as createMetadataFactory, t as getOgBackgroundDataUrl } from "../seo.mjs";
|
|
2
3
|
export { createMetadataFactory, getOgBackgroundDataUrl, getSiteUrl };
|
package/dist/seo.mjs
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import { t as createLogger } from "./logger.mjs";
|
|
2
2
|
import { t as readPayloadMediaAsDataUrl } from "./readMediaBuffer.mjs";
|
|
3
|
-
|
|
4
|
-
const log$1 = createLogger("siteUrl");
|
|
5
|
-
/** Resolve the public site origin from env (`NEXT_PUBLIC_SITE_URL` / `VERCEL_URL`). */
|
|
6
|
-
function getSiteUrl(options = {}) {
|
|
7
|
-
const fallback = options.fallback ?? "http://localhost:3000";
|
|
8
|
-
const fromEnv = process.env.NEXT_PUBLIC_SITE_URL;
|
|
9
|
-
if (fromEnv) return fromEnv.replace(/\/$/, "");
|
|
10
|
-
if (process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}`.replace(/\/$/, "");
|
|
11
|
-
if (process.env.NODE_ENV === "production") log$1.warn(`NEXT_PUBLIC_SITE_URL and VERCEL_URL are unset — falling back to ${fallback}. Canonical and Open Graph URLs will be incorrect.`);
|
|
12
|
-
return fallback.replace(/\/$/, "");
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
3
|
+
import { t as getSiteUrl } from "./site-url.mjs";
|
|
15
4
|
//#region src/seo/metadata.ts
|
|
16
5
|
const ABSOLUTE_URL_RE = /^https?:\/\//i;
|
|
17
6
|
function toAbsolute(value, base) {
|
|
@@ -119,6 +108,6 @@ async function getOgBackgroundDataUrl(media) {
|
|
|
119
108
|
}
|
|
120
109
|
}
|
|
121
110
|
//#endregion
|
|
122
|
-
export { createMetadataFactory as n,
|
|
111
|
+
export { createMetadataFactory as n, getOgBackgroundDataUrl as t };
|
|
123
112
|
|
|
124
113
|
//# sourceMappingURL=seo.mjs.map
|
package/dist/seo.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seo.mjs","names":[
|
|
1
|
+
{"version":3,"file":"seo.mjs","names":[],"sources":["../src/seo/metadata.ts","../src/seo/og-background.ts"],"sourcesContent":["import { getSiteUrl } from './site-url.js'\n\nimport type { Metadata } from 'next'\n\nexport type OgImage = {\n url: string\n width?: number\n height?: number\n alt?: string\n}\n\nexport type CreateMetadataInput = {\n title: string\n description?: string\n pathname?: string\n canonicalUrl?: string\n noIndex?: boolean\n noFollow?: boolean\n locale?: string\n images?: OgImage[]\n ogType?: 'website' | 'article'\n article?: {\n publishedTime?: string\n modifiedTime?: string\n expirationTime?: string\n section?: string\n tags?: string[]\n authors?: string[]\n }\n twitterCreator?: string\n /** Per-call overrides (e.g. localized site name). */\n siteName?: string\n defaultDescription?: string\n}\n\nexport type CreateMetadataFactoryOptions = {\n siteName: string\n defaultDescription: string\n locales: readonly string[]\n defaultLocale: string\n /** Maps locale → Open Graph locale tag (e.g. `en` → `en_US`). */\n getOpenGraphLocale: (locale: string) => string\n localePrefix?: 'always' | 'as-needed' | 'never'\n getSiteUrl?: () => string\n}\n\nconst ABSOLUTE_URL_RE = /^https?:\\/\\//i\n\nfunction toAbsolute(value: string, base: string): string {\n if (ABSOLUTE_URL_RE.test(value)) return value\n return new URL(value, base).toString()\n}\n\nexport function createMetadataFactory(options: CreateMetadataFactoryOptions) {\n const localePrefix = options.localePrefix ?? 'as-needed'\n const resolveSiteUrl = options.getSiteUrl ?? (() => getSiteUrl())\n\n function createMetadata(input: CreateMetadataInput): Metadata {\n const siteName = input.siteName ?? options.siteName\n const defaultDescription = input.defaultDescription ?? options.defaultDescription\n const description = input.description?.trim() || defaultDescription\n const pathname = input.pathname ?? '/'\n const base = resolveSiteUrl()\n const canonical = input.canonicalUrl\n ? toAbsolute(input.canonicalUrl, base)\n : new URL(pathname, base).toString()\n\n const locale = input.locale ?? options.defaultLocale\n const ogLocale = options.getOpenGraphLocale(locale)\n\n const languages: Record<string, string> = {}\n for (const l of options.locales) {\n const isDefault = l === options.defaultLocale\n const localizedPath =\n localePrefix === 'as-needed' && isDefault ? pathname : `/${l}${pathname}`\n languages[l] = new URL(localizedPath, base).toString()\n }\n languages['x-default'] = new URL(pathname, base).toString()\n\n const images: OgImage[] | undefined = input.images?.map((img) => ({\n ...img,\n url: toAbsolute(img.url, base),\n }))\n\n const ogType = input.ogType ?? 'website'\n\n const robots =\n input.noIndex || input.noFollow\n ? {\n index: !input.noIndex,\n follow: !input.noFollow,\n }\n : undefined\n\n return {\n title: input.title,\n description,\n alternates: {\n canonical,\n languages,\n },\n openGraph: {\n type: ogType,\n title: input.title,\n description,\n url: canonical,\n siteName,\n locale: ogLocale,\n ...(images ? { images } : {}),\n ...(ogType === 'article' && input.article\n ? {\n publishedTime: input.article.publishedTime,\n modifiedTime: input.article.modifiedTime,\n expirationTime: input.article.expirationTime,\n section: input.article.section,\n tags: input.article.tags,\n authors: input.article.authors,\n }\n : {}),\n },\n twitter: {\n card: 'summary_large_image',\n title: input.title,\n description,\n ...(images ? { images: images.map((i) => i.url) } : {}),\n ...(input.twitterCreator ? { creator: input.twitterCreator } : {}),\n },\n ...(robots ? { robots } : {}),\n }\n }\n\n function createRootMetadata(overrides?: {\n siteName?: string\n defaultDescription?: string\n }): Metadata {\n const base = resolveSiteUrl()\n const siteName = overrides?.siteName ?? options.siteName\n const description = overrides?.defaultDescription ?? options.defaultDescription\n return {\n metadataBase: new URL(base),\n title: {\n default: siteName,\n template: `%s | ${siteName}`,\n },\n description,\n }\n }\n\n return { createMetadata, createRootMetadata }\n}\n","/**\n * Resolves a Payload Media document into a base64 data URL for Satori OG images.\n * Server-only — reads via disk/S3, not the public HTTP media URL.\n */\n\nimport { createLogger } from '../utils/logger/logger.js'\nimport { readPayloadMediaAsDataUrl } from '../cms/payload/readMediaBuffer.js'\n\nimport type { PayloadMedia } from '../cms/payload/readMediaBuffer.js'\n\nconst log = createLogger('ogBackground')\n\nexport async function getOgBackgroundDataUrl(\n media: PayloadMedia | null | undefined\n): Promise<string | undefined> {\n if (!media || !media.filename) return undefined\n try {\n return await readPayloadMediaAsDataUrl({\n filename: media.filename,\n mimeType: media.mimeType,\n })\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error)\n log.warn(`Failed to load OG background for media ${media.filename}: ${reason}`)\n return undefined\n }\n}\n"],"mappings":";;;;AA8CA,MAAM,kBAAkB;AAExB,SAAS,WAAW,OAAe,MAAsB;CACvD,IAAI,gBAAgB,KAAK,KAAK,GAAG,OAAO;CACxC,OAAO,IAAI,IAAI,OAAO,IAAI,CAAC,CAAC,SAAS;AACvC;AAEA,SAAgB,sBAAsB,SAAuC;CAC3E,MAAM,eAAe,QAAQ,gBAAgB;CAC7C,MAAM,iBAAiB,QAAQ,qBAAqB,WAAW;CAE/D,SAAS,eAAe,OAAsC;EAC5D,MAAM,WAAW,MAAM,YAAY,QAAQ;EAC3C,MAAM,qBAAqB,MAAM,sBAAsB,QAAQ;EAC/D,MAAM,cAAc,MAAM,aAAa,KAAK,KAAK;EACjD,MAAM,WAAW,MAAM,YAAY;EACnC,MAAM,OAAO,eAAe;EAC5B,MAAM,YAAY,MAAM,eACpB,WAAW,MAAM,cAAc,IAAI,IACnC,IAAI,IAAI,UAAU,IAAI,CAAC,CAAC,SAAS;EAErC,MAAM,SAAS,MAAM,UAAU,QAAQ;EACvC,MAAM,WAAW,QAAQ,mBAAmB,MAAM;EAElD,MAAM,YAAoC,CAAC;EAC3C,KAAK,MAAM,KAAK,QAAQ,SAAS;GAC/B,MAAM,YAAY,MAAM,QAAQ;GAChC,MAAM,gBACJ,iBAAiB,eAAe,YAAY,WAAW,IAAI,IAAI;GACjE,UAAU,KAAK,IAAI,IAAI,eAAe,IAAI,CAAC,CAAC,SAAS;EACvD;EACA,UAAU,eAAe,IAAI,IAAI,UAAU,IAAI,CAAC,CAAC,SAAS;EAE1D,MAAM,SAAgC,MAAM,QAAQ,KAAK,SAAS;GAChE,GAAG;GACH,KAAK,WAAW,IAAI,KAAK,IAAI;EAC/B,E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