feat(templates): update website src directory structure (#7971)
This commit is contained in:
@@ -18,16 +18,16 @@
|
|||||||
"start": "cross-env NODE_OPTIONS=--no-deprecation next start"
|
"start": "cross-env NODE_OPTIONS=--no-deprecation next start"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@payloadcms/db-mongodb": "3.0.0-beta.91",
|
"@payloadcms/db-mongodb": "3.0.0-beta.96",
|
||||||
"@payloadcms/live-preview-react": "3.0.0-beta.91",
|
"@payloadcms/live-preview-react": "3.0.0-beta.96",
|
||||||
"@payloadcms/next": "3.0.0-beta.91",
|
"@payloadcms/next": "3.0.0-beta.96",
|
||||||
"@payloadcms/plugin-cloud": "3.0.0-beta.91",
|
"@payloadcms/plugin-cloud": "3.0.0-beta.96",
|
||||||
"@payloadcms/plugin-form-builder": "3.0.0-beta.91",
|
"@payloadcms/plugin-form-builder": "3.0.0-beta.96",
|
||||||
"@payloadcms/plugin-nested-docs": "3.0.0-beta.91",
|
"@payloadcms/plugin-nested-docs": "3.0.0-beta.96",
|
||||||
"@payloadcms/plugin-redirects": "3.0.0-beta.91",
|
"@payloadcms/plugin-redirects": "3.0.0-beta.96",
|
||||||
"@payloadcms/plugin-seo": "3.0.0-beta.91",
|
"@payloadcms/plugin-seo": "3.0.0-beta.96",
|
||||||
"@payloadcms/richtext-lexical": "3.0.0-beta.91",
|
"@payloadcms/richtext-lexical": "3.0.0-beta.96",
|
||||||
"@payloadcms/ui": "3.0.0-beta.91",
|
"@payloadcms/ui": "3.0.0-beta.96",
|
||||||
"@radix-ui/react-checkbox": "^1.0.4",
|
"@radix-ui/react-checkbox": "^1.0.4",
|
||||||
"@radix-ui/react-label": "^2.0.2",
|
"@radix-ui/react-label": "^2.0.2",
|
||||||
"@radix-ui/react-select": "^2.0.0",
|
"@radix-ui/react-select": "^2.0.0",
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"lexical": "0.17.0",
|
"lexical": "0.17.0",
|
||||||
"lucide-react": "^0.378.0",
|
"lucide-react": "^0.378.0",
|
||||||
"next": "15.0.0-canary.104",
|
"next": "15.0.0-canary.104",
|
||||||
"payload": "3.0.0-beta.91",
|
"payload": "3.0.0-beta.96",
|
||||||
"payload-admin-bar": "^1.0.6",
|
"payload-admin-bar": "^1.0.6",
|
||||||
"prism-react-renderer": "^2.3.1",
|
"prism-react-renderer": "^2.3.1",
|
||||||
"react": "19.0.0-rc-06d0b89e-20240801",
|
"react": "19.0.0-rc-06d0b89e-20240801",
|
||||||
|
|||||||
6623
templates/website/pnpm-lock.yaml
generated
6623
templates/website/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -2,10 +2,10 @@ import { getCachedGlobal } from '@/utilities/getGlobals'
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import type { Footer } from '../../../payload-types'
|
import type { Footer } from '@/payload-types'
|
||||||
|
|
||||||
import { ThemeSelector } from '../../providers/Theme/ThemeSelector'
|
import { ThemeSelector } from '@/providers/Theme/ThemeSelector'
|
||||||
import { CMSLink } from '../Link'
|
import { CMSLink } from '@/components/Link'
|
||||||
|
|
||||||
export async function Footer() {
|
export async function Footer() {
|
||||||
const footer: Footer = await getCachedGlobal('footer')()
|
const footer: Footer = await getCachedGlobal('footer')()
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { GlobalConfig } from 'payload'
|
import type { GlobalConfig } from 'payload'
|
||||||
|
|
||||||
import { link } from '../../fields/link'
|
import { link } from '@/fields/link'
|
||||||
import { revalidateFooter } from './hooks/revalidateFooter'
|
import { revalidateFooter } from './hooks/revalidateFooter'
|
||||||
|
|
||||||
export const Footer: GlobalConfig = {
|
export const Footer: GlobalConfig = {
|
||||||
@@ -4,9 +4,9 @@ import Link from 'next/link'
|
|||||||
import { usePathname } from 'next/navigation'
|
import { usePathname } from 'next/navigation'
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
|
|
||||||
import type { Header } from '../../../payload-types'
|
import type { Header } from '@/payload-types'
|
||||||
|
|
||||||
import { Logo } from '../Logo/Logo'
|
import { Logo } from '@/components/Logo/Logo'
|
||||||
import { HeaderNav } from './Nav'
|
import { HeaderNav } from './Nav'
|
||||||
|
|
||||||
interface HeaderClientProps {
|
interface HeaderClientProps {
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { HeaderClient } from '@/components/Header/index.client'
|
import { HeaderClient } from './Component.client'
|
||||||
import { getCachedGlobal } from '@/utilities/getGlobals'
|
import { getCachedGlobal } from '@/utilities/getGlobals'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import type { Header } from '../../../payload-types'
|
import type { Header } from '@/payload-types'
|
||||||
|
|
||||||
export async function Header() {
|
export async function Header() {
|
||||||
const header: Header = await getCachedGlobal('header', 1)()
|
const header: Header = await getCachedGlobal('header', 1)()
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import type { Header as HeaderType } from '../../../../payload-types'
|
import type { Header as HeaderType } from '@/payload-types'
|
||||||
|
|
||||||
import { CMSLink } from '../../Link'
|
import { CMSLink } from '@/components/Link'
|
||||||
|
|
||||||
export const HeaderNav: React.FC<{ header: HeaderType }> = ({ header }) => {
|
export const HeaderNav: React.FC<{ header: HeaderType }> = ({ header }) => {
|
||||||
const navItems = header?.navItems || []
|
const navItems = header?.navItems || []
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { GlobalConfig } from 'payload'
|
import type { GlobalConfig } from 'payload'
|
||||||
|
|
||||||
import { link } from '../../fields/link'
|
import { link } from '@/fields/link'
|
||||||
import { revalidateHeader } from './hooks/revalidateHeader'
|
import { revalidateHeader } from './hooks/revalidateHeader'
|
||||||
|
|
||||||
export const Header: GlobalConfig = {
|
export const Header: GlobalConfig = {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { AccessArgs } from 'payload'
|
import type { AccessArgs } from 'payload'
|
||||||
|
|
||||||
import type { User } from '../../payload-types'
|
import type { User } from '@/payload-types'
|
||||||
|
|
||||||
type isAuthenticated = (args: AccessArgs<User>) => boolean
|
type isAuthenticated = (args: AccessArgs<User>) => boolean
|
||||||
|
|
||||||
@@ -3,15 +3,15 @@ import type { Metadata } from 'next'
|
|||||||
import { PayloadRedirects } from '@/components/PayloadRedirects'
|
import { PayloadRedirects } from '@/components/PayloadRedirects'
|
||||||
import configPromise from '@payload-config'
|
import configPromise from '@payload-config'
|
||||||
import { getPayloadHMR } from '@payloadcms/next/utilities'
|
import { getPayloadHMR } from '@payloadcms/next/utilities'
|
||||||
import { draftMode, headers } from 'next/headers'
|
import { draftMode } from 'next/headers'
|
||||||
import React, { cache } from 'react'
|
import React, { cache } from 'react'
|
||||||
import { homeStatic } from 'src/payload/seed/home-static'
|
import { homeStatic } from '@/seed/home-static'
|
||||||
|
|
||||||
import type { Page as PageType } from '../../../payload-types'
|
import type { Page as PageType } from '@/payload-types'
|
||||||
|
|
||||||
import { Blocks } from '../../components/Blocks'
|
import { RenderBlocks } from '@/blocks/RenderBlocks'
|
||||||
import { Hero } from '../../components/Hero'
|
import { RenderHero } from '@/heros/RenderHero'
|
||||||
import { generateMeta } from '../../utilities/generateMeta'
|
import { generateMeta } from '@/utilities/generateMeta'
|
||||||
|
|
||||||
export async function generateStaticParams() {
|
export async function generateStaticParams() {
|
||||||
const payload = await getPayloadHMR({ config: configPromise })
|
const payload = await getPayloadHMR({ config: configPromise })
|
||||||
@@ -54,8 +54,8 @@ export default async function Page({ params: { slug = 'home' } }) {
|
|||||||
{/* Allows redirects for valid pages too */}
|
{/* Allows redirects for valid pages too */}
|
||||||
<PayloadRedirects disableNotFound url={url} />
|
<PayloadRedirects disableNotFound url={url} />
|
||||||
|
|
||||||
<Hero {...hero} />
|
<RenderHero {...hero} />
|
||||||
<Blocks blocks={layout} />
|
<RenderBlocks blocks={layout} />
|
||||||
</article>
|
</article>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
import type { Metadata } from 'next'
|
import type { Metadata } from 'next'
|
||||||
|
|
||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import { GeistMono } from 'geist/font/mono'
|
import { GeistMono } from 'geist/font/mono'
|
||||||
import { GeistSans } from 'geist/font/sans'
|
import { GeistSans } from 'geist/font/sans'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import { AdminBar } from '../components/AdminBar'
|
import { AdminBar } from '@/components/AdminBar'
|
||||||
import { Footer } from '../components/Footer'
|
import { Footer } from '@/Footer/Component'
|
||||||
import { Header } from '../components/Header'
|
import { Header } from '@/Header/Component'
|
||||||
import { LivePreviewListener } from '../components/LivePreviewListener'
|
import { LivePreviewListener } from '@/components/LivePreviewListener'
|
||||||
import { Providers } from '../providers'
|
import { Providers } from '@/providers'
|
||||||
import { InitTheme } from '../providers/Theme/InitTheme'
|
import { InitTheme } from '@/providers/Theme/InitTheme'
|
||||||
import { mergeOpenGraph } from '../utilities/mergeOpenGraph'
|
import { mergeOpenGraph } from '@/utilities/mergeOpenGraph'
|
||||||
import './globals.css'
|
import './globals.css'
|
||||||
|
|
||||||
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
export default async function RootLayout({ children }: { children: React.ReactNode }) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import { Button } from '../components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
|
|
||||||
export default function NotFound() {
|
export default function NotFound() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
import type { Metadata } from 'next'
|
import type { Metadata } from 'next'
|
||||||
|
|
||||||
import { RelatedPosts } from '@/blocks/RelatedPosts'
|
import { RelatedPosts } from '@/blocks/RelatedPosts/Component'
|
||||||
import { PayloadRedirects } from '@/components/PayloadRedirects'
|
import { PayloadRedirects } from '@/components/PayloadRedirects'
|
||||||
import configPromise from '@payload-config'
|
import configPromise from '@payload-config'
|
||||||
import { getPayloadHMR } from '@payloadcms/next/utilities'
|
import { getPayloadHMR } from '@payloadcms/next/utilities'
|
||||||
import { draftMode, headers } from 'next/headers'
|
import { draftMode, headers } from 'next/headers'
|
||||||
import React, { cache } from 'react'
|
import React, { cache } from 'react'
|
||||||
import RichText from 'src/app/components/RichText'
|
import RichText from '@/components/RichText'
|
||||||
|
|
||||||
import type { Post } from '../../../../payload-types'
|
import type { Post } from '@/payload-types'
|
||||||
|
|
||||||
import { PostHero } from '../../../heros/PostHero'
|
import { PostHero } from '@/heros/PostHero'
|
||||||
import { generateMeta } from '../../../utilities/generateMeta'
|
import { generateMeta } from '@/utilities/generateMeta'
|
||||||
import PageClient from './page.client'
|
import PageClient from './page.client'
|
||||||
|
|
||||||
export async function generateStaticParams() {
|
export async function generateStaticParams() {
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ import { MetaTitleComponent as MetaTitleComponent_11 } from '@payloadcms/plugin-
|
|||||||
import { MetaImageComponent as MetaImageComponent_12 } from '@payloadcms/plugin-seo/client'
|
import { MetaImageComponent as MetaImageComponent_12 } from '@payloadcms/plugin-seo/client'
|
||||||
import { MetaDescriptionComponent as MetaDescriptionComponent_13 } from '@payloadcms/plugin-seo/client'
|
import { MetaDescriptionComponent as MetaDescriptionComponent_13 } from '@payloadcms/plugin-seo/client'
|
||||||
import { PreviewComponent as PreviewComponent_14 } from '@payloadcms/plugin-seo/client'
|
import { PreviewComponent as PreviewComponent_14 } from '@payloadcms/plugin-seo/client'
|
||||||
import { SlugComponent as SlugComponent_15 } from '@/payload/fields/slug/SlugComponent'
|
import { SlugComponent as SlugComponent_15 } from '@/fields/slug/SlugComponent'
|
||||||
import { HorizontalRuleFeatureClient as HorizontalRuleFeatureClient_16 } from '@payloadcms/richtext-lexical/client'
|
import { HorizontalRuleFeatureClient as HorizontalRuleFeatureClient_16 } from '@payloadcms/richtext-lexical/client'
|
||||||
import { BlocksFeatureClient as BlocksFeatureClient_17 } from '@payloadcms/richtext-lexical/client'
|
import { BlocksFeatureClient as BlocksFeatureClient_17 } from '@payloadcms/richtext-lexical/client'
|
||||||
import { default as default_18 } from 'src/payload/components/BeforeDashboard'
|
import { default as default_18 } from '@/components/BeforeDashboard'
|
||||||
import { default as default_19 } from 'src/payload/components/BeforeLogin'
|
import { default as default_19 } from '@/components/BeforeLogin'
|
||||||
|
|
||||||
export const importMap = {
|
export const importMap = {
|
||||||
'@payloadcms/richtext-lexical/client#RichTextCell': RichTextCell_0,
|
'@payloadcms/richtext-lexical/client#RichTextCell': RichTextCell_0,
|
||||||
@@ -36,9 +36,9 @@ export const importMap = {
|
|||||||
'@payloadcms/plugin-seo/client#MetaImageComponent': MetaImageComponent_12,
|
'@payloadcms/plugin-seo/client#MetaImageComponent': MetaImageComponent_12,
|
||||||
'@payloadcms/plugin-seo/client#MetaDescriptionComponent': MetaDescriptionComponent_13,
|
'@payloadcms/plugin-seo/client#MetaDescriptionComponent': MetaDescriptionComponent_13,
|
||||||
'@payloadcms/plugin-seo/client#PreviewComponent': PreviewComponent_14,
|
'@payloadcms/plugin-seo/client#PreviewComponent': PreviewComponent_14,
|
||||||
'@/payload/fields/slug/SlugComponent#SlugComponent': SlugComponent_15,
|
'@/fields/slug/SlugComponent#SlugComponent': SlugComponent_15,
|
||||||
'@payloadcms/richtext-lexical/client#HorizontalRuleFeatureClient': HorizontalRuleFeatureClient_16,
|
'@payloadcms/richtext-lexical/client#HorizontalRuleFeatureClient': HorizontalRuleFeatureClient_16,
|
||||||
'@payloadcms/richtext-lexical/client#BlocksFeatureClient': BlocksFeatureClient_17,
|
'@payloadcms/richtext-lexical/client#BlocksFeatureClient': BlocksFeatureClient_17,
|
||||||
'/payload/components/BeforeDashboard#default': default_18,
|
'@/components/BeforeDashboard#default': default_18,
|
||||||
'/payload/components/BeforeLogin#default': default_19,
|
'@/components/BeforeLogin#default': default_19,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import type { Post } from 'src/payload-types'
|
|||||||
import configPromise from '@payload-config'
|
import configPromise from '@payload-config'
|
||||||
import { getPayloadHMR } from '@payloadcms/next/utilities'
|
import { getPayloadHMR } from '@payloadcms/next/utilities'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import RichText from 'src/app/components/RichText'
|
import RichText from '@/components/RichText'
|
||||||
|
|
||||||
import type { ArchiveBlockProps } from './types'
|
import type { ArchiveBlockProps } from './types'
|
||||||
|
|
||||||
import { CollectionArchive } from '../../components/CollectionArchive'
|
import { CollectionArchive } from '@/components/CollectionArchive'
|
||||||
|
|
||||||
export const ArchiveBlock: React.FC<
|
export const ArchiveBlock: React.FC<
|
||||||
ArchiveBlockProps & {
|
ArchiveBlockProps & {
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
import type { Page } from '../../../payload-types'
|
import type { Page } from '@/payload-types'
|
||||||
|
|
||||||
export type ArchiveBlockProps = Extract<Page['layout'][0], { blockType: 'archive' }>
|
export type ArchiveBlockProps = Extract<Page['layout'][0], { blockType: 'archive' }>
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import type { BannerBlock as BannerBlockProps } from 'src/payload-types'
|
import type { BannerBlock as BannerBlockProps } from 'src/payload-types'
|
||||||
|
|
||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import RichText from 'src/app/components/RichText'
|
import RichText from '@/components/RichText'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
className?: string
|
className?: string
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import RichText from 'src/app/components/RichText'
|
|
||||||
|
|
||||||
import type { Page } from '../../../payload-types'
|
import type { Page } from '@/payload-types'
|
||||||
|
|
||||||
import { CMSLink } from '../../components/Link'
|
import RichText from '@/components/RichText'
|
||||||
|
import { CMSLink } from '@/components/Link'
|
||||||
|
|
||||||
type Props = Extract<Page['layout'][0], { blockType: 'cta' }>
|
type Props = Extract<Page['layout'][0], { blockType: 'cta' }>
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import { Code } from './Code.client'
|
import { Code } from './Component.client'
|
||||||
|
|
||||||
export type CodeBlockProps = {
|
export type CodeBlockProps = {
|
||||||
code: string
|
code: string
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import RichText from 'src/app/components/RichText'
|
import RichText from '@/components/RichText'
|
||||||
|
|
||||||
import type { Page } from '../../../payload-types'
|
import type { Page } from '@/payload-types'
|
||||||
|
|
||||||
import { CMSLink } from '../../components/Link'
|
import { CMSLink } from '../../components/Link'
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
lexicalEditor,
|
lexicalEditor,
|
||||||
} from '@payloadcms/richtext-lexical'
|
} from '@payloadcms/richtext-lexical'
|
||||||
|
|
||||||
import { link } from '../../fields/link'
|
import { link } from '@/fields/link'
|
||||||
|
|
||||||
const columnFields: Field[] = [
|
const columnFields: Field[] = [
|
||||||
{
|
{
|
||||||
@@ -4,8 +4,8 @@ import type { Form as FormType } from '@payloadcms/plugin-form-builder/types'
|
|||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import React, { useCallback, useState } from 'react'
|
import React, { useCallback, useState } from 'react'
|
||||||
import { useForm, FormProvider } from 'react-hook-form'
|
import { useForm, FormProvider } from 'react-hook-form'
|
||||||
import RichText from 'src/app/components/RichText'
|
import RichText from '@/components/RichText'
|
||||||
import { Button } from 'src/app/components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
|
|
||||||
import { buildInitialFormState } from './buildInitialFormState'
|
import { buildInitialFormState } from './buildInitialFormState'
|
||||||
import { fields } from './fields'
|
import { fields } from './fields'
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import type { StaticImageData } from 'next/image'
|
import type { StaticImageData } from 'next/image'
|
||||||
|
|
||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import RichText from 'src/app/components/RichText'
|
import RichText from '@/components/RichText'
|
||||||
|
|
||||||
import type { Page } from '../../../payload-types'
|
import type { Page } from '@/payload-types'
|
||||||
|
|
||||||
import { Media } from '../../components/Media'
|
import { Media } from '../../components/Media'
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import RichText from 'src/app/components/RichText'
|
import RichText from '@/components/RichText'
|
||||||
|
|
||||||
import type { Post } from '../../../payload-types'
|
import type { Post } from '@/payload-types'
|
||||||
|
|
||||||
import { Card } from '../../components/Card'
|
import { Card } from '../../components/Card'
|
||||||
|
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
|
|
||||||
import type { Page } from '../../../payload-types'
|
import type { Page } from '@/payload-types'
|
||||||
|
|
||||||
import { ArchiveBlock } from '../../blocks/ArchiveBlock'
|
import { ArchiveBlock } from '@/blocks/ArchiveBlock/Component'
|
||||||
import { CallToActionBlock } from '../../blocks/CallToAction'
|
import { CallToActionBlock } from '@/blocks/CallToAction/Component'
|
||||||
import { ContentBlock } from '../../blocks/Content'
|
import { ContentBlock } from '@/blocks/Content/Component'
|
||||||
import { FormBlock } from '../../blocks/Form'
|
import { FormBlock } from '@/blocks/Form/Component'
|
||||||
import { MediaBlock } from '../../blocks/MediaBlock'
|
import { MediaBlock } from '@/blocks/MediaBlock/Component'
|
||||||
import { toKebabCase } from '../../utilities/toKebabCase'
|
|
||||||
|
|
||||||
const blockComponents = {
|
const blockComponents = {
|
||||||
archive: ArchiveBlock,
|
archive: ArchiveBlock,
|
||||||
@@ -18,7 +17,7 @@ const blockComponents = {
|
|||||||
mediaBlock: MediaBlock,
|
mediaBlock: MediaBlock,
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Blocks: React.FC<{
|
export const RenderBlocks: React.FC<{
|
||||||
blocks: Page['layout'][0][]
|
blocks: Page['layout'][0][]
|
||||||
}> = (props) => {
|
}> = (props) => {
|
||||||
const { blocks } = props
|
const { blocks } = props
|
||||||
@@ -2,7 +2,7 @@ import type { CollectionAfterChangeHook } from 'payload'
|
|||||||
|
|
||||||
import { revalidatePath } from 'next/cache'
|
import { revalidatePath } from 'next/cache'
|
||||||
|
|
||||||
import type { Page } from '../../../../payload-types'
|
import type { Page } from '../../../payload-types'
|
||||||
|
|
||||||
export const revalidatePage: CollectionAfterChangeHook<Page> = ({
|
export const revalidatePage: CollectionAfterChangeHook<Page> = ({
|
||||||
doc,
|
doc,
|
||||||
@@ -2,13 +2,13 @@ import type { CollectionConfig } from 'payload'
|
|||||||
|
|
||||||
import { authenticated } from '../../access/authenticated'
|
import { authenticated } from '../../access/authenticated'
|
||||||
import { authenticatedOrPublished } from '../../access/authenticatedOrPublished'
|
import { authenticatedOrPublished } from '../../access/authenticatedOrPublished'
|
||||||
import { Archive } from '../../blocks/ArchiveBlock'
|
import { Archive } from '../../blocks/ArchiveBlock/config'
|
||||||
import { CallToAction } from '../../blocks/CallToAction'
|
import { CallToAction } from '../../blocks/CallToAction/config'
|
||||||
import { Content } from '../../blocks/Content'
|
import { Content } from '../../blocks/Content/config'
|
||||||
import { FormBlock } from '../../blocks/Form'
|
import { FormBlock } from '../../blocks/Form/config'
|
||||||
import { MediaBlock } from '../../blocks/MediaBlock'
|
import { MediaBlock } from '../../blocks/MediaBlock/config'
|
||||||
import { hero } from '../../fields/hero'
|
import { hero } from '@/heros/config'
|
||||||
import { slugField } from '../../fields/slug'
|
import { slugField } from '@/fields/slug'
|
||||||
import { populatePublishedAt } from '../../hooks/populatePublishedAt'
|
import { populatePublishedAt } from '../../hooks/populatePublishedAt'
|
||||||
import { generatePreviewPath } from '../../utilities/generatePreviewPath'
|
import { generatePreviewPath } from '../../utilities/generatePreviewPath'
|
||||||
import { revalidatePage } from './hooks/revalidatePage'
|
import { revalidatePage } from './hooks/revalidatePage'
|
||||||
@@ -2,7 +2,7 @@ import type { CollectionAfterChangeHook } from 'payload'
|
|||||||
|
|
||||||
import { revalidatePath } from 'next/cache'
|
import { revalidatePath } from 'next/cache'
|
||||||
|
|
||||||
import type { Post } from '../../../../payload-types'
|
import type { Post } from '../../../payload-types'
|
||||||
|
|
||||||
export const revalidatePost: CollectionAfterChangeHook<Post> = ({
|
export const revalidatePost: CollectionAfterChangeHook<Post> = ({
|
||||||
doc,
|
doc,
|
||||||
@@ -11,9 +11,9 @@ import {
|
|||||||
|
|
||||||
import { authenticated } from '../../access/authenticated'
|
import { authenticated } from '../../access/authenticated'
|
||||||
import { authenticatedOrPublished } from '../../access/authenticatedOrPublished'
|
import { authenticatedOrPublished } from '../../access/authenticatedOrPublished'
|
||||||
import { Banner } from '../../blocks/Banner'
|
import { Banner } from '../../blocks/Banner/config'
|
||||||
import { Code } from '../../blocks/Code'
|
import { Code } from '../../blocks/Code/config'
|
||||||
import { MediaBlock } from '../../blocks/MediaBlock'
|
import { MediaBlock } from '../../blocks/MediaBlock/config'
|
||||||
import { generatePreviewPath } from '../../utilities/generatePreviewPath'
|
import { generatePreviewPath } from '../../utilities/generatePreviewPath'
|
||||||
import { populateAuthors } from './hooks/populateAuthors'
|
import { populateAuthors } from './hooks/populateAuthors'
|
||||||
import { revalidatePost } from './hooks/revalidatePost'
|
import { revalidatePost } from './hooks/revalidatePost'
|
||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
OverviewField,
|
OverviewField,
|
||||||
PreviewField,
|
PreviewField,
|
||||||
} from '@payloadcms/plugin-seo/fields'
|
} from '@payloadcms/plugin-seo/fields'
|
||||||
import { slugField } from '@/payload/fields/slug'
|
import { slugField } from '@/fields/slug'
|
||||||
|
|
||||||
export const Posts: CollectionConfig = {
|
export const Posts: CollectionConfig = {
|
||||||
slug: 'posts',
|
slug: 'posts',
|
||||||
@@ -4,9 +4,9 @@ import useClickableCard from '@/utilities/useClickableCard'
|
|||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
|
|
||||||
import type { Post } from '../../../payload-types'
|
import type { Post } from '@/payload-types'
|
||||||
|
|
||||||
import { Media } from '../Media'
|
import { Media } from '@/components/Media'
|
||||||
|
|
||||||
export const Card: React.FC<{
|
export const Card: React.FC<{
|
||||||
alignItems?: 'center'
|
alignItems?: 'center'
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import type { Post } from '../../../payload-types'
|
import type { Post } from '@/payload-types'
|
||||||
|
|
||||||
import { Card } from '../Card'
|
import { Card } from '@/components/Card'
|
||||||
|
|
||||||
export type Props = {
|
export type Props = {
|
||||||
posts: Post[]
|
posts: Post[]
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Button, type ButtonProps } from '@/components/ui/button'
|
import { Button, type ButtonProps } from '@/components/ui/button'
|
||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import type { Page, Post } from '../../../payload-types'
|
import type { Page, Post } from '@/payload-types'
|
||||||
|
|
||||||
type CMSLinkType = {
|
type CMSLinkType = {
|
||||||
appearance?: 'inline' | ButtonProps['variant']
|
appearance?: 'inline' | ButtonProps['variant']
|
||||||
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
import type { StaticImageData } from 'next/image'
|
import type { StaticImageData } from 'next/image'
|
||||||
|
|
||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import NextImage from 'next/image'
|
import NextImage from 'next/image'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import type { Props as MediaProps } from '../types'
|
import type { Props as MediaProps } from '../types'
|
||||||
|
|
||||||
import cssVariables from '../../../cssVariables'
|
import cssVariables from '@/cssVariables'
|
||||||
|
|
||||||
const { breakpoints } = cssVariables
|
const { breakpoints } = cssVariables
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import React, { useEffect, useRef } from 'react'
|
import React, { useEffect, useRef } from 'react'
|
||||||
|
|
||||||
import type { Props as MediaProps } from '../types'
|
import type { Props as MediaProps } from '../types'
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { StaticImageData } from 'next/image'
|
import type { StaticImageData } from 'next/image'
|
||||||
import type { ElementType, Ref } from 'react'
|
import type { ElementType, Ref } from 'react'
|
||||||
|
|
||||||
import type { Media as MediaType } from '../../../payload-types'
|
import type { Media as MediaType } from '@/payload-types'
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
alt?: string
|
alt?: string
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import type React from 'react'
|
import type React from 'react'
|
||||||
import type { Page, Post } from 'src/payload-types'
|
import type { Page, Post } from '@/payload-types'
|
||||||
|
|
||||||
import { getCachedDocument } from '@/utilities/getDocument'
|
import { getCachedDocument } from '@/utilities/getDocument'
|
||||||
import { getCachedRedirects } from '@/utilities/getRedirects'
|
import { getCachedRedirects } from '@/utilities/getRedirects'
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import { BannerBlock } from '@/blocks/Banner'
|
import { BannerBlock } from '@/blocks/Banner/Component'
|
||||||
import { CallToActionBlock } from '@/blocks/CallToAction'
|
import { CallToActionBlock } from '@/blocks/CallToAction/Component'
|
||||||
import { CodeBlock, CodeBlockProps } from '@/blocks/Code'
|
import { CodeBlock, CodeBlockProps } from '@/blocks/Code/Component'
|
||||||
import { MediaBlock } from '@/blocks/MediaBlock'
|
import { MediaBlock } from '@/blocks/MediaBlock/Component'
|
||||||
import React, { Fragment, JSX } from 'react'
|
import React, { Fragment, JSX } from 'react'
|
||||||
import { CMSLink } from 'src/app/components/Link'
|
import { CMSLink } from '@/components/Link'
|
||||||
import { DefaultNodeTypes, SerializedBlockNode } from '@payloadcms/richtext-lexical'
|
import { DefaultNodeTypes, SerializedBlockNode } from '@payloadcms/richtext-lexical'
|
||||||
import type { BannerBlock as BannerBlockProps } from 'src/payload-types'
|
import type { BannerBlock as BannerBlockProps } from '@/payload-types'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
IS_BOLD,
|
IS_BOLD,
|
||||||
@@ -16,7 +16,7 @@ import {
|
|||||||
IS_SUPERSCRIPT,
|
IS_SUPERSCRIPT,
|
||||||
IS_UNDERLINE,
|
IS_UNDERLINE,
|
||||||
} from './nodeFormat'
|
} from './nodeFormat'
|
||||||
import type { Page } from '../../../payload-types'
|
import type { Page } from '@/payload-types'
|
||||||
|
|
||||||
export type NodeTypes =
|
export type NodeTypes =
|
||||||
| DefaultNodeTypes
|
| DefaultNodeTypes
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import { Slot } from '@radix-ui/react-slot'
|
import { Slot } from '@radix-ui/react-slot'
|
||||||
import { type VariantProps, cva } from 'class-variance-authority'
|
import { type VariantProps, cva } from 'class-variance-authority'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable jsx-a11y/heading-has-content */
|
/* eslint-disable jsx-a11y/heading-has-content */
|
||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
|
||||||
import { Check } from 'lucide-react'
|
import { Check } from 'lucide-react'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {}
|
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import * as LabelPrimitive from '@radix-ui/react-label'
|
import * as LabelPrimitive from '@radix-ui/react-label'
|
||||||
import { type VariantProps, cva } from 'class-variance-authority'
|
import { type VariantProps, cva } from 'class-variance-authority'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
import type { ButtonProps } from '@/components/ui/button'
|
import type { ButtonProps } from '@/components/ui/button'
|
||||||
|
|
||||||
import { buttonVariants } from '@/components/ui/button'
|
import { buttonVariants } from '@/components/ui/button'
|
||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react'
|
import { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import * as SelectPrimitive from '@radix-ui/react-select'
|
import * as SelectPrimitive from '@radix-ui/react-select'
|
||||||
import { Check, ChevronDown, ChevronUp } from 'lucide-react'
|
import { Check, ChevronDown, ChevronUp } from 'lucide-react'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { cn } from '@/utilities/cn'
|
import { cn } from 'src/utilities/cn'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { type PayloadHandler, commitTransaction, initTransaction } from 'payload'
|
import { type PayloadHandler, commitTransaction, initTransaction } from 'payload'
|
||||||
|
|
||||||
import { seed as seedScript } from '../seed'
|
import { seed as seedScript } from '@/seed'
|
||||||
|
|
||||||
export const seed: PayloadHandler = async (req): Promise<Response> => {
|
export const seed: PayloadHandler = async (req): Promise<Response> => {
|
||||||
const { payload, user } = req
|
const { payload, user } = req
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { Field } from 'payload'
|
import type { Field } from 'payload'
|
||||||
|
|
||||||
import deepMerge from '../utilities/deepMerge'
|
import deepMerge from '@/utilities/deepMerge'
|
||||||
|
|
||||||
export type LinkAppearances = 'default' | 'outline'
|
export type LinkAppearances = 'default' | 'outline'
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@ import type { ArrayField, Field } from 'payload'
|
|||||||
|
|
||||||
import type { LinkAppearances } from './link'
|
import type { LinkAppearances } from './link'
|
||||||
|
|
||||||
import deepMerge from '../utilities/deepMerge'
|
import deepMerge from '@/utilities/deepMerge'
|
||||||
import { link } from './link'
|
import { link } from './link'
|
||||||
|
|
||||||
type LinkGroupType = (options?: {
|
type LinkGroupType = (options?: {
|
||||||
@@ -43,8 +43,16 @@ export const SlugComponent: React.FC<SlugComponentProps> = ({
|
|||||||
})
|
})
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (checkboxValue) setValue(formatSlug(fieldToUseValue))
|
if (checkboxValue) {
|
||||||
}, [fieldToUseValue, checkboxValue])
|
if (fieldToUseValue) {
|
||||||
|
const formattedSlug = formatSlug(fieldToUseValue)
|
||||||
|
|
||||||
|
if (value !== formattedSlug) setValue(formattedSlug)
|
||||||
|
} else {
|
||||||
|
if (value !== '') setValue('')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [fieldToUseValue, checkboxValue, setValue, value])
|
||||||
|
|
||||||
const handleLock = useCallback(
|
const handleLock = useCallback(
|
||||||
(e) => {
|
(e) => {
|
||||||
@@ -40,7 +40,7 @@ export const slugField: Slug = (fieldToUse = 'title', overrides = {}) => {
|
|||||||
...(slugOverrides?.admin || {}),
|
...(slugOverrides?.admin || {}),
|
||||||
components: {
|
components: {
|
||||||
Field: {
|
Field: {
|
||||||
path: '@/payload/fields/slug/SlugComponent#SlugComponent',
|
path: '@/fields/slug/SlugComponent#SlugComponent',
|
||||||
clientProps: {
|
clientProps: {
|
||||||
fieldToUse,
|
fieldToUse,
|
||||||
checkboxFieldPath: checkBoxField.name,
|
checkboxFieldPath: checkBoxField.name,
|
||||||
@@ -2,11 +2,11 @@
|
|||||||
import { useHeaderTheme } from '@/providers/HeaderTheme'
|
import { useHeaderTheme } from '@/providers/HeaderTheme'
|
||||||
import React, { useEffect } from 'react'
|
import React, { useEffect } from 'react'
|
||||||
|
|
||||||
import type { Page } from '../../../payload-types'
|
import type { Page } from '@/payload-types'
|
||||||
|
|
||||||
import { CMSLink } from '../../components/Link'
|
import { CMSLink } from '@/components/Link'
|
||||||
import { Media } from '../../components/Media'
|
import { Media } from '@/components/Media'
|
||||||
import RichText from '../../components/RichText'
|
import RichText from '@/components/RichText'
|
||||||
|
|
||||||
export const HighImpactHero: React.FC<Page['hero']> = ({ links, media, richText }) => {
|
export const HighImpactHero: React.FC<Page['hero']> = ({ links, media, richText }) => {
|
||||||
const { setHeaderTheme } = useHeaderTheme()
|
const { setHeaderTheme } = useHeaderTheme()
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import type { Page } from '../../../payload-types'
|
import type { Page } from '@/payload-types'
|
||||||
|
|
||||||
import RichText from '../../components/RichText'
|
import RichText from '@/components/RichText'
|
||||||
|
|
||||||
type LowImpactHeroType =
|
type LowImpactHeroType =
|
||||||
| {
|
| {
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user