templates: bump for v3.4.0 (#9765)
Automated bump of templates for v3.4.0 Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
97d3bb1c11
commit
97aca5fde7
6333
templates/website/pnpm-lock.yaml
generated
6333
templates/website/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -22,26 +22,43 @@ import { default as default_1a7510af427896d367a49dbf838d2de6 } from '@/component
|
|||||||
import { default as default_8a7ab0eb7ab5c511aba12e68480bfe5e } from '@/components/BeforeLogin'
|
import { default as default_8a7ab0eb7ab5c511aba12e68480bfe5e } from '@/components/BeforeLogin'
|
||||||
|
|
||||||
export const importMap = {
|
export const importMap = {
|
||||||
"@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell": RscEntryLexicalCell_44fe37237e0ebf4470c9990d8cb7b07e,
|
'@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell':
|
||||||
"@payloadcms/richtext-lexical/rsc#RscEntryLexicalField": RscEntryLexicalField_44fe37237e0ebf4470c9990d8cb7b07e,
|
RscEntryLexicalCell_44fe37237e0ebf4470c9990d8cb7b07e,
|
||||||
"@payloadcms/richtext-lexical/client#InlineToolbarFeatureClient": InlineToolbarFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
'@payloadcms/richtext-lexical/rsc#RscEntryLexicalField':
|
||||||
"@payloadcms/richtext-lexical/client#FixedToolbarFeatureClient": FixedToolbarFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
RscEntryLexicalField_44fe37237e0ebf4470c9990d8cb7b07e,
|
||||||
"@payloadcms/richtext-lexical/client#HeadingFeatureClient": HeadingFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
'@payloadcms/richtext-lexical/client#InlineToolbarFeatureClient':
|
||||||
"@payloadcms/richtext-lexical/client#ParagraphFeatureClient": ParagraphFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
InlineToolbarFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/richtext-lexical/client#UnderlineFeatureClient": UnderlineFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
'@payloadcms/richtext-lexical/client#FixedToolbarFeatureClient':
|
||||||
"@payloadcms/richtext-lexical/client#BoldFeatureClient": BoldFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
FixedToolbarFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/richtext-lexical/client#ItalicFeatureClient": ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
'@payloadcms/richtext-lexical/client#HeadingFeatureClient':
|
||||||
"@payloadcms/richtext-lexical/client#LinkFeatureClient": LinkFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
HeadingFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/plugin-seo/client#OverviewComponent": OverviewComponent_a8a977ebc872c5d5ea7ee689724c0860,
|
'@payloadcms/richtext-lexical/client#ParagraphFeatureClient':
|
||||||
"@payloadcms/plugin-seo/client#MetaTitleComponent": MetaTitleComponent_a8a977ebc872c5d5ea7ee689724c0860,
|
ParagraphFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/plugin-seo/client#MetaImageComponent": MetaImageComponent_a8a977ebc872c5d5ea7ee689724c0860,
|
'@payloadcms/richtext-lexical/client#UnderlineFeatureClient':
|
||||||
"@payloadcms/plugin-seo/client#MetaDescriptionComponent": MetaDescriptionComponent_a8a977ebc872c5d5ea7ee689724c0860,
|
UnderlineFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/plugin-seo/client#PreviewComponent": PreviewComponent_a8a977ebc872c5d5ea7ee689724c0860,
|
'@payloadcms/richtext-lexical/client#BoldFeatureClient':
|
||||||
"@/fields/slug/SlugComponent#SlugComponent": SlugComponent_92cc057d0a2abb4f6cf0307edf59f986,
|
BoldFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/richtext-lexical/client#HorizontalRuleFeatureClient": HorizontalRuleFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
'@payloadcms/richtext-lexical/client#ItalicFeatureClient':
|
||||||
"@payloadcms/richtext-lexical/client#BlocksFeatureClient": BlocksFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@payloadcms/plugin-search/client#LinkToDoc": LinkToDoc_aead06e4cbf6b2620c5c51c9ab283634,
|
'@payloadcms/richtext-lexical/client#LinkFeatureClient':
|
||||||
"@payloadcms/plugin-search/client#ReindexButton": ReindexButton_aead06e4cbf6b2620c5c51c9ab283634,
|
LinkFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
"@/components/BeforeDashboard#default": default_1a7510af427896d367a49dbf838d2de6,
|
'@payloadcms/plugin-seo/client#OverviewComponent':
|
||||||
"@/components/BeforeLogin#default": default_8a7ab0eb7ab5c511aba12e68480bfe5e
|
OverviewComponent_a8a977ebc872c5d5ea7ee689724c0860,
|
||||||
|
'@payloadcms/plugin-seo/client#MetaTitleComponent':
|
||||||
|
MetaTitleComponent_a8a977ebc872c5d5ea7ee689724c0860,
|
||||||
|
'@payloadcms/plugin-seo/client#MetaImageComponent':
|
||||||
|
MetaImageComponent_a8a977ebc872c5d5ea7ee689724c0860,
|
||||||
|
'@payloadcms/plugin-seo/client#MetaDescriptionComponent':
|
||||||
|
MetaDescriptionComponent_a8a977ebc872c5d5ea7ee689724c0860,
|
||||||
|
'@payloadcms/plugin-seo/client#PreviewComponent':
|
||||||
|
PreviewComponent_a8a977ebc872c5d5ea7ee689724c0860,
|
||||||
|
'@/fields/slug/SlugComponent#SlugComponent': SlugComponent_92cc057d0a2abb4f6cf0307edf59f986,
|
||||||
|
'@payloadcms/richtext-lexical/client#HorizontalRuleFeatureClient':
|
||||||
|
HorizontalRuleFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
|
'@payloadcms/richtext-lexical/client#BlocksFeatureClient':
|
||||||
|
BlocksFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||||
|
'@payloadcms/plugin-search/client#LinkToDoc': LinkToDoc_aead06e4cbf6b2620c5c51c9ab283634,
|
||||||
|
'@payloadcms/plugin-search/client#ReindexButton': ReindexButton_aead06e4cbf6b2620c5c51c9ab283634,
|
||||||
|
'@/components/BeforeDashboard#default': default_1a7510af427896d367a49dbf838d2de6,
|
||||||
|
'@/components/BeforeLogin#default': default_8a7ab0eb7ab5c511aba12e68480bfe5e,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"id": "a621cec0-90cd-4514-bf1a-f98a91b06006",
|
"id": "6ff63df3-bd96-4bc0-8d4b-1b0e6cc63711",
|
||||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||||
"version": "7",
|
"version": "7",
|
||||||
"dialect": "postgresql",
|
"dialect": "postgresql",
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import * as migration_20241204_184308_initial from './20241204_184308_initial'
|
import * as migration_20241205_040211_initial from './20241205_040211_initial'
|
||||||
|
|
||||||
export const migrations = [
|
export const migrations = [
|
||||||
{
|
{
|
||||||
up: migration_20241204_184308_initial.up,
|
up: migration_20241205_040211_initial.up,
|
||||||
down: migration_20241204_184308_initial.down,
|
down: migration_20241205_040211_initial.down,
|
||||||
name: '20241204_184308_initial',
|
name: '20241205_040211_initial',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"id": "9c8b4aed-7504-439b-a8cd-1911cd4da6d1",
|
"id": "3b1d2937-d942-42f0-9738-5e8c48c205de",
|
||||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||||
"version": "7",
|
"version": "7",
|
||||||
"dialect": "postgresql",
|
"dialect": "postgresql",
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import * as migration_20241204_184240_initial from './20241204_184240_initial'
|
import * as migration_20241205_040146_initial from './20241205_040146_initial'
|
||||||
|
|
||||||
export const migrations = [
|
export const migrations = [
|
||||||
{
|
{
|
||||||
up: migration_20241204_184240_initial.up,
|
up: migration_20241205_040146_initial.up,
|
||||||
down: migration_20241204_184240_initial.down,
|
down: migration_20241205_040146_initial.down,
|
||||||
name: '20241204_184240_initial',
|
name: '20241205_040146_initial',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,14 +1,20 @@
|
|||||||
/** @type {import('next-sitemap').IConfig} */
|
|
||||||
const SITE_URL =
|
const SITE_URL =
|
||||||
process.env.NEXT_PUBLIC_SERVER_URL ||
|
process.env.NEXT_PUBLIC_SERVER_URL ||
|
||||||
process.env.VERCEL_PROJECT_PRODUCTION_URL ||
|
process.env.VERCEL_PROJECT_PRODUCTION_URL ||
|
||||||
'https://example.com'
|
'https://example.com'
|
||||||
|
|
||||||
|
/** @type {import('next-sitemap').IConfig} */
|
||||||
module.exports = {
|
module.exports = {
|
||||||
siteUrl: SITE_URL,
|
siteUrl: SITE_URL,
|
||||||
generateRobotsTxt: true,
|
generateRobotsTxt: true,
|
||||||
exclude: ['/posts-sitemap.xml', '/pages-sitemap.xml', '/*', '/posts/*'],
|
exclude: ['/posts-sitemap.xml', '/pages-sitemap.xml', '/*', '/posts/*'],
|
||||||
robotsTxtOptions: {
|
robotsTxtOptions: {
|
||||||
|
policies: [
|
||||||
|
{
|
||||||
|
userAgent: '*',
|
||||||
|
disallow: '/admin/*',
|
||||||
|
},
|
||||||
|
],
|
||||||
additionalSitemaps: [`${SITE_URL}/pages-sitemap.xml`, `${SITE_URL}/posts-sitemap.xml`],
|
additionalSitemaps: [`${SITE_URL}/pages-sitemap.xml`, `${SITE_URL}/posts-sitemap.xml`],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export default async function Post({ params: paramsPromise }: Args) {
|
|||||||
|
|
||||||
<div className="flex flex-col items-center gap-4 pt-8">
|
<div className="flex flex-col items-center gap-4 pt-8">
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<RichText className="max-w-[48rem] mx-auto" content={post.content} enableGutter={false} />
|
<RichText className="max-w-[48rem] mx-auto" data={post.content} enableGutter={false} />
|
||||||
{post.relatedPosts && post.relatedPosts.length > 0 && (
|
{post.relatedPosts && post.relatedPosts.length > 0 && (
|
||||||
<RelatedPosts
|
<RelatedPosts
|
||||||
className="mt-12 max-w-[52rem] lg:grid lg:grid-cols-subgrid col-start-1 col-span-3 grid-rows-[2fr]"
|
className="mt-12 max-w-[52rem] lg:grid lg:grid-cols-subgrid col-start-1 col-span-3 grid-rows-[2fr]"
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export const ArchiveBlock: React.FC<
|
|||||||
<div className="my-16" id={`block-${id}`}>
|
<div className="my-16" id={`block-${id}`}>
|
||||||
{introContent && (
|
{introContent && (
|
||||||
<div className="container mb-16">
|
<div className="container mb-16">
|
||||||
<RichText className="ml-0 max-w-[48rem]" content={introContent} enableGutter={false} />
|
<RichText className="ml-0 max-w-[48rem]" data={introContent} enableGutter={false} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<CollectionArchive posts={posts} />
|
<CollectionArchive posts={posts} />
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export const BannerBlock: React.FC<Props> = ({ className, content, style }) => {
|
|||||||
'border-warning bg-warning/30': style === 'warning',
|
'border-warning bg-warning/30': style === 'warning',
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<RichText content={content} enableGutter={false} enableProse={false} />
|
<RichText data={content} enableGutter={false} enableProse={false} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export const CallToActionBlock: React.FC<CTABlockProps> = ({ links, richText })
|
|||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="bg-card rounded border-border border p-4 flex flex-col gap-8 md:flex-row md:justify-between md:items-center">
|
<div className="bg-card rounded border-border border p-4 flex flex-col gap-8 md:flex-row md:justify-between md:items-center">
|
||||||
<div className="max-w-[48rem] flex items-center">
|
<div className="max-w-[48rem] flex items-center">
|
||||||
{richText && <RichText className="mb-0" content={richText} enableGutter={false} />}
|
{richText && <RichText className="mb-0" data={richText} enableGutter={false} />}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col gap-8">
|
<div className="flex flex-col gap-8">
|
||||||
{(links || []).map(({ link }, i) => {
|
{(links || []).map(({ link }, i) => {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export const ContentBlock: React.FC<ContentBlockProps> = (props) => {
|
|||||||
})}
|
})}
|
||||||
key={index}
|
key={index}
|
||||||
>
|
>
|
||||||
{richText && <RichText content={richText} enableGutter={false} />}
|
{richText && <RichText data={richText} enableGutter={false} />}
|
||||||
|
|
||||||
{enableLink && <CMSLink {...link} />}
|
{enableLink && <CMSLink {...link} />}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import React, { useCallback, useState } from 'react'
|
|||||||
import { useForm, FormProvider } from 'react-hook-form'
|
import { useForm, FormProvider } from 'react-hook-form'
|
||||||
import RichText from '@/components/RichText'
|
import RichText from '@/components/RichText'
|
||||||
import { Button } from '@/components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
|
import type { SerializedEditorState } from '@payloadcms/richtext-lexical/lexical'
|
||||||
|
|
||||||
import { buildInitialFormState } from './buildInitialFormState'
|
import { buildInitialFormState } from './buildInitialFormState'
|
||||||
import { fields } from './fields'
|
import { fields } from './fields'
|
||||||
@@ -26,9 +27,7 @@ export type FormBlockType = {
|
|||||||
blockType?: 'formBlock'
|
blockType?: 'formBlock'
|
||||||
enableIntro: boolean
|
enableIntro: boolean
|
||||||
form: FormType
|
form: FormType
|
||||||
introContent?: {
|
introContent?: SerializedEditorState
|
||||||
[k: string]: unknown
|
|
||||||
}[]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const FormBlock: React.FC<
|
export const FormBlock: React.FC<
|
||||||
@@ -128,12 +127,12 @@ export const FormBlock: React.FC<
|
|||||||
return (
|
return (
|
||||||
<div className="container lg:max-w-[48rem]">
|
<div className="container lg:max-w-[48rem]">
|
||||||
{enableIntro && introContent && !hasSubmitted && (
|
{enableIntro && introContent && !hasSubmitted && (
|
||||||
<RichText className="mb-8 lg:mb-12" content={introContent} enableGutter={false} />
|
<RichText className="mb-8 lg:mb-12" data={introContent} enableGutter={false} />
|
||||||
)}
|
)}
|
||||||
<div className="p-4 lg:p-6 border border-border rounded-[0.8rem]">
|
<div className="p-4 lg:p-6 border border-border rounded-[0.8rem]">
|
||||||
<FormProvider {...formMethods}>
|
<FormProvider {...formMethods}>
|
||||||
{!isLoading && hasSubmitted && confirmationType === 'message' && (
|
{!isLoading && hasSubmitted && confirmationType === 'message' && (
|
||||||
<RichText content={confirmationMessage} />
|
<RichText data={confirmationMessage} />
|
||||||
)}
|
)}
|
||||||
{isLoading && !hasSubmitted && <p>Loading, please wait...</p>}
|
{isLoading && !hasSubmitted && <p>Loading, please wait...</p>}
|
||||||
{error && <div>{`${error.status || '500'}: ${error.message || ''}`}</div>}
|
{error && <div>{`${error.status || '500'}: ${error.message || ''}`}</div>}
|
||||||
|
|||||||
@@ -2,11 +2,12 @@ import RichText from '@/components/RichText'
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import { Width } from '../Width'
|
import { Width } from '../Width'
|
||||||
|
import { SerializedEditorState } from '@payloadcms/richtext-lexical/lexical'
|
||||||
|
|
||||||
export const Message: React.FC = ({ message }: { message: Record<string, any> }) => {
|
export const Message: React.FC = ({ message }: { message: SerializedEditorState }) => {
|
||||||
return (
|
return (
|
||||||
<Width className="my-12" width="100">
|
<Width className="my-12" width="100">
|
||||||
{message && <RichText content={message} />}
|
{message && <RichText data={message} />}
|
||||||
</Width>
|
</Width>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export const MediaBlock: React.FC<Props> = (props) => {
|
|||||||
captionClassName,
|
captionClassName,
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<RichText content={caption} enableGutter={false} />
|
<RichText data={caption} enableGutter={false} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export const RelatedPosts: React.FC<RelatedPostsProps> = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={clsx('container', className)}>
|
<div className={clsx('container', className)}>
|
||||||
{introContent && <RichText content={introContent} enableGutter={false} />}
|
{introContent && <RichText data={introContent} enableGutter={false} />}
|
||||||
|
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-8 items-stretch">
|
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 md:gap-8 items-stretch">
|
||||||
{docs?.map((doc, index) => {
|
{docs?.map((doc, index) => {
|
||||||
|
|||||||
@@ -1,27 +1,56 @@
|
|||||||
import { cn } from '@/utilities/cn'
|
import { MediaBlock } from '@/blocks/MediaBlock/Component'
|
||||||
import React from 'react'
|
import { DefaultNodeTypes, SerializedBlockNode } from '@payloadcms/richtext-lexical'
|
||||||
|
import { SerializedEditorState } from '@payloadcms/richtext-lexical/lexical'
|
||||||
|
import {
|
||||||
|
JSXConvertersFunction,
|
||||||
|
RichText as RichTextWithoutBlocks,
|
||||||
|
} from '@payloadcms/richtext-lexical/react'
|
||||||
|
|
||||||
import { serializeLexical } from './serialize'
|
import { CodeBlock, CodeBlockProps } from '@/blocks/Code/Component'
|
||||||
|
|
||||||
|
import type {
|
||||||
|
BannerBlock as BannerBlockProps,
|
||||||
|
CallToActionBlock as CTABlockProps,
|
||||||
|
MediaBlock as MediaBlockProps,
|
||||||
|
} from '@/payload-types'
|
||||||
|
import { BannerBlock } from '@/blocks/Banner/Component'
|
||||||
|
import { CallToActionBlock } from '@/blocks/CallToAction/Component'
|
||||||
|
import { cn } from '@/utilities/cn'
|
||||||
|
|
||||||
|
type NodeTypes =
|
||||||
|
| DefaultNodeTypes
|
||||||
|
| SerializedBlockNode<CTABlockProps | MediaBlockProps | BannerBlockProps | CodeBlockProps>
|
||||||
|
|
||||||
|
const jsxConverters: JSXConvertersFunction<NodeTypes> = ({ defaultConverters }) => ({
|
||||||
|
...defaultConverters,
|
||||||
|
blocks: {
|
||||||
|
banner: ({ node }) => <BannerBlock className="col-start-2 mb-4" {...node.fields} />,
|
||||||
|
mediaBlock: ({ node }) => (
|
||||||
|
<MediaBlock
|
||||||
|
className="col-start-1 col-span-3"
|
||||||
|
imgClassName="m-0"
|
||||||
|
{...node.fields}
|
||||||
|
captionClassName="mx-auto max-w-[48rem]"
|
||||||
|
enableGutter={false}
|
||||||
|
disableInnerContainer={true}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
code: ({ node }) => <CodeBlock className="col-start-2" {...node.fields} />,
|
||||||
|
cta: ({ node }) => <CallToActionBlock {...node.fields} />,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
className?: string
|
data: SerializedEditorState
|
||||||
content: Record<string, any>
|
|
||||||
enableGutter?: boolean
|
enableGutter?: boolean
|
||||||
enableProse?: boolean
|
enableProse?: boolean
|
||||||
}
|
} & React.HTMLAttributes<HTMLDivElement>
|
||||||
|
|
||||||
const RichText: React.FC<Props> = ({
|
|
||||||
className,
|
|
||||||
content,
|
|
||||||
enableGutter = true,
|
|
||||||
enableProse = true,
|
|
||||||
}) => {
|
|
||||||
if (!content) {
|
|
||||||
return null
|
|
||||||
}
|
|
||||||
|
|
||||||
|
export default function RichText(props: Props) {
|
||||||
|
const { className, enableProse = true, enableGutter = true, ...rest } = props
|
||||||
return (
|
return (
|
||||||
<div
|
<RichTextWithoutBlocks
|
||||||
|
converters={jsxConverters}
|
||||||
className={cn(
|
className={cn(
|
||||||
{
|
{
|
||||||
'container ': enableGutter,
|
'container ': enableGutter,
|
||||||
@@ -30,14 +59,7 @@ const RichText: React.FC<Props> = ({
|
|||||||
},
|
},
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
>
|
{...rest}
|
||||||
{content &&
|
/>
|
||||||
!Array.isArray(content) &&
|
|
||||||
typeof content === 'object' &&
|
|
||||||
'root' in content &&
|
|
||||||
serializeLexical({ nodes: content?.root?.children })}
|
|
||||||
</div>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export default RichText
|
|
||||||
|
|||||||
@@ -37,10 +37,7 @@ export const seed = async ({
|
|||||||
// as well as the collections and globals
|
// as well as the collections and globals
|
||||||
// this is because while `yarn seed` drops the database
|
// this is because while `yarn seed` drops the database
|
||||||
// the custom `/api/seed` endpoint does not
|
// the custom `/api/seed` endpoint does not
|
||||||
|
|
||||||
payload.logger.info(`— Clearing media...`)
|
|
||||||
payload.logger.info(`— Clearing collections and globals...`)
|
payload.logger.info(`— Clearing collections and globals...`)
|
||||||
|
|
||||||
// clear the database
|
// clear the database
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
globals.map((global) =>
|
globals.map((global) =>
|
||||||
@@ -57,31 +54,16 @@ export const seed = async ({
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
await Promise.all(
|
for (const collection of collections) {
|
||||||
collections.map((collection) =>
|
await payload.delete({
|
||||||
payload.delete({
|
collection: collection,
|
||||||
collection: collection,
|
where: {},
|
||||||
where: {
|
depth: 0,
|
||||||
id: {
|
context: {
|
||||||
exists: true,
|
disableRevalidate: true,
|
||||||
},
|
},
|
||||||
},
|
})
|
||||||
depth: 0,
|
}
|
||||||
context: {
|
|
||||||
disableRevalidate: true,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
const pages = await payload.delete({
|
|
||||||
collection: 'pages',
|
|
||||||
where: {},
|
|
||||||
context: {
|
|
||||||
disableRevalidate: true,
|
|
||||||
},
|
|
||||||
depth: 0,
|
|
||||||
})
|
|
||||||
|
|
||||||
payload.logger.info(`— Seeding demo author and user...`)
|
payload.logger.info(`— Seeding demo author and user...`)
|
||||||
|
|
||||||
@@ -217,7 +199,6 @@ export const seed = async ({
|
|||||||
context: {
|
context: {
|
||||||
disableRevalidate: true,
|
disableRevalidate: true,
|
||||||
},
|
},
|
||||||
select: { content: false },
|
|
||||||
data: JSON.parse(
|
data: JSON.parse(
|
||||||
JSON.stringify({ ...post1, categories: [technologyCategory.id] })
|
JSON.stringify({ ...post1, categories: [technologyCategory.id] })
|
||||||
.replace(/"\{\{IMAGE_1\}\}"/g, String(image1ID))
|
.replace(/"\{\{IMAGE_1\}\}"/g, String(image1ID))
|
||||||
@@ -232,7 +213,6 @@ export const seed = async ({
|
|||||||
context: {
|
context: {
|
||||||
disableRevalidate: true,
|
disableRevalidate: true,
|
||||||
},
|
},
|
||||||
select: { content: false },
|
|
||||||
data: JSON.parse(
|
data: JSON.parse(
|
||||||
JSON.stringify({ ...post2, categories: [newsCategory.id] })
|
JSON.stringify({ ...post2, categories: [newsCategory.id] })
|
||||||
.replace(/"\{\{IMAGE_1\}\}"/g, String(image2ID))
|
.replace(/"\{\{IMAGE_1\}\}"/g, String(image2ID))
|
||||||
@@ -247,7 +227,6 @@ export const seed = async ({
|
|||||||
context: {
|
context: {
|
||||||
disableRevalidate: true,
|
disableRevalidate: true,
|
||||||
},
|
},
|
||||||
select: { content: false },
|
|
||||||
data: JSON.parse(
|
data: JSON.parse(
|
||||||
JSON.stringify({ ...post3, categories: [financeCategory.id] })
|
JSON.stringify({ ...post3, categories: [financeCategory.id] })
|
||||||
.replace(/"\{\{IMAGE_1\}\}"/g, String(image3ID))
|
.replace(/"\{\{IMAGE_1\}\}"/g, String(image3ID))
|
||||||
@@ -284,7 +263,6 @@ export const seed = async ({
|
|||||||
const contactForm = await payload.create({
|
const contactForm = await payload.create({
|
||||||
collection: 'forms',
|
collection: 'forms',
|
||||||
depth: 0,
|
depth: 0,
|
||||||
select: { title: true },
|
|
||||||
data: JSON.parse(JSON.stringify(contactFormData)),
|
data: JSON.parse(JSON.stringify(contactFormData)),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export const HighImpactHero: React.FC<Page['hero']> = ({ links, media, richText
|
|||||||
>
|
>
|
||||||
<div className="container mb-8 z-10 relative flex items-center justify-center">
|
<div className="container mb-8 z-10 relative flex items-center justify-center">
|
||||||
<div className="max-w-[36.5rem] text-center">
|
<div className="max-w-[36.5rem] text-center">
|
||||||
{richText && <RichText className="mb-6" content={richText} enableGutter={false} />}
|
{richText && <RichText className="mb-6" data={richText} enableGutter={false} />}
|
||||||
{Array.isArray(links) && links.length > 0 && (
|
{Array.isArray(links) && links.length > 0 && (
|
||||||
<ul className="flex justify-center gap-4">
|
<ul className="flex justify-center gap-4">
|
||||||
{links.map(({ link }, i) => {
|
{links.map(({ link }, i) => {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const LowImpactHero: React.FC<LowImpactHeroType> = ({ children, richText
|
|||||||
return (
|
return (
|
||||||
<div className="container mt-16">
|
<div className="container mt-16">
|
||||||
<div className="max-w-[48rem]">
|
<div className="max-w-[48rem]">
|
||||||
{children || (richText && <RichText content={richText} enableGutter={false} />)}
|
{children || (richText && <RichText data={richText} enableGutter={false} />)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export const MediumImpactHero: React.FC<Page['hero']> = ({ links, media, richTex
|
|||||||
return (
|
return (
|
||||||
<div className="">
|
<div className="">
|
||||||
<div className="container mb-8">
|
<div className="container mb-8">
|
||||||
{richText && <RichText className="mb-6" content={richText} enableGutter={false} />}
|
{richText && <RichText className="mb-6" data={richText} enableGutter={false} />}
|
||||||
|
|
||||||
{Array.isArray(links) && links.length > 0 && (
|
{Array.isArray(links) && links.length > 0 && (
|
||||||
<ul className="flex gap-4">
|
<ul className="flex gap-4">
|
||||||
@@ -36,7 +36,7 @@ export const MediumImpactHero: React.FC<Page['hero']> = ({ links, media, richTex
|
|||||||
/>
|
/>
|
||||||
{media?.caption && (
|
{media?.caption && (
|
||||||
<div className="mt-3">
|
<div className="mt-3">
|
||||||
<RichText content={media.caption} enableGutter={false} />
|
<RichText data={media.caption} enableGutter={false} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"id": "18b0f107-11d7-4757-8aaa-9a5183c37960",
|
"id": "391f6437-f7f5-4001-88f4-714288dfa4c9",
|
||||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||||
"version": "7",
|
"version": "7",
|
||||||
"dialect": "postgresql",
|
"dialect": "postgresql",
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import * as migration_20241204_184256_initial from './20241204_184256_initial'
|
import * as migration_20241205_040201_initial from './20241205_040201_initial'
|
||||||
|
|
||||||
export const migrations = [
|
export const migrations = [
|
||||||
{
|
{
|
||||||
up: migration_20241204_184256_initial.up,
|
up: migration_20241205_040201_initial.up,
|
||||||
down: migration_20241204_184256_initial.down,
|
down: migration_20241205_040201_initial.down,
|
||||||
name: '20241204_184256_initial',
|
name: '20241205_040201_initial',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user