From 8997ad9f06c78676b493e51afe634849041936f5 Mon Sep 17 00:00:00 2001 From: rakia Date: Sat, 30 Aug 2025 13:43:22 +0300 Subject: [PATCH 1/2] Add CMS setup, update frontend pages and layouts, and modify json configs --- next-env.d.ts | 3 +- next.config.mjs | 3 +- package.json | 13 +- src/app/(frontend)/[not-found]/page.jsx | 2 +- src/app/(frontend)/{page.jsx => home.jsx} | 0 src/app/(frontend)/layout.tsx | 48 +++ .../(frontend)/{layout.jsx => mslayout.jsx} | 0 src/app/(frontend)/page.tsx | 64 ++++ src/app/(frontend)/styles.css | 164 ++++++++++ src/app/my-route/route.ts | 12 + src/collections/Media.ts | 16 + src/collections/Users.ts | 13 + src/components/pages/common/breadcrumb.jsx | 73 +++-- src/components/pages/common/skill-bar.jsx | 76 +++-- src/components/pages/error/index.jsx | 6 +- src/payload-types.ts | 299 ++++++++++++++++++ src/payload.config.ts | 37 +++ tsconfig.json | 15 +- 18 files changed, 786 insertions(+), 58 deletions(-) rename src/app/(frontend)/{page.jsx => home.jsx} (100%) create mode 100644 src/app/(frontend)/layout.tsx rename src/app/(frontend)/{layout.jsx => mslayout.jsx} (100%) create mode 100644 src/app/(frontend)/page.tsx create mode 100644 src/app/(frontend)/styles.css create mode 100644 src/app/my-route/route.ts create mode 100644 src/collections/Media.ts create mode 100644 src/collections/Users.ts create mode 100644 src/payload-types.ts create mode 100644 src/payload.config.ts diff --git a/next-env.d.ts b/next-env.d.ts index 4f11a03..830fb59 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -1,5 +1,6 @@ /// /// +/// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/next.config.mjs b/next.config.mjs index 4678774..9b7ea54 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,4 +1,5 @@ +import { withPayload } from "@payloadcms/next/withPayload"; /** @type {import('next').NextConfig} */ const nextConfig = {}; -export default nextConfig; +export default withPayload(nextConfig); diff --git a/package.json b/package.json index 8742ae0..7c901cb 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,19 @@ "lint": "next lint" }, "dependencies": { + "@payloadcms/db-mongodb": "^3.54.0", + "@payloadcms/next": "^3.54.0", + "@payloadcms/payload-cloud": "^3.54.0", + "@payloadcms/richtext-lexical": "^3.54.0", "bootstrap": "^5.3.3", - "next": "14.1.4", - "react": "^18", + "graphql": "^16.11.0", + "next": "15.5.2", + "payload": "^3.54.0", + "react": "^18.3.1", "react-countup": "^6.5.2", - "react-dom": "^18", + "react-dom": "^18.3.1", "react-icons": "^5.5.0", + "react-intersection-observer": "^9.16.0", "react-modal-video": "^2.0.1", "react-scroll-trigger": "^0.6.14", "react-skillbars": "^2.2.0", diff --git a/src/app/(frontend)/[not-found]/page.jsx b/src/app/(frontend)/[not-found]/page.jsx index 01e49ec..2cf5f48 100644 --- a/src/app/(frontend)/[not-found]/page.jsx +++ b/src/app/(frontend)/[not-found]/page.jsx @@ -1,4 +1,4 @@ -import ErrorPage from '@/src/components/pages/error'; +import ErrorPage from '@/components/pages/error'; import React from 'react'; const NotFound = () => { diff --git a/src/app/(frontend)/page.jsx b/src/app/(frontend)/home.jsx similarity index 100% rename from src/app/(frontend)/page.jsx rename to src/app/(frontend)/home.jsx diff --git a/src/app/(frontend)/layout.tsx b/src/app/(frontend)/layout.tsx new file mode 100644 index 0000000..ed00cb0 --- /dev/null +++ b/src/app/(frontend)/layout.tsx @@ -0,0 +1,48 @@ +// import React from 'react' +// import './styles.css' + +// export const metadata = { +// description: 'A blank template using Payload in a Next.js app.', +// title: 'Payload Blank Template', +// } + +// export default async function RootLayout(props: { children: React.ReactNode }) { +// const { children } = props + +// return ( +// +// +//
{children}
+// +// +// ) +// } + + +"use client" +import { useEffect } from 'react'; +import "./globals.css"; +import SwitchTab from '@/components/pages/common/dark-light'; +//import SwitchTab from '../../pages/common/dark-light'; +//import SwitchTab from '@/src/components/pages/common/dark-light'; + +//import SwitchTab from '@/src/components/pages/common/dark-light'; + + +export default function RootLayout({ children }) { + useEffect(() => { + require('bootstrap/dist/js/bootstrap.min.js'); + }, []); + + return ( + + + + + + + {children} + + + ); +} diff --git a/src/app/(frontend)/layout.jsx b/src/app/(frontend)/mslayout.jsx similarity index 100% rename from src/app/(frontend)/layout.jsx rename to src/app/(frontend)/mslayout.jsx diff --git a/src/app/(frontend)/page.tsx b/src/app/(frontend)/page.tsx new file mode 100644 index 0000000..47ff87c --- /dev/null +++ b/src/app/(frontend)/page.tsx @@ -0,0 +1,64 @@ +import { headers as getHeaders } from 'next/headers.js' +import Image from 'next/image' +import { getPayload } from 'payload' +import React from 'react' +import { fileURLToPath } from 'url' + +import config from '@/payload.config' +import './styles.css' + +import HomeOne from "@/components/pages/homes/home"; + +export default async function HomePage() { + const headers = await getHeaders() + const payloadConfig = await config + const payload = await getPayload({ config: payloadConfig }) + const { user } = await payload.auth({ headers }) + + const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}` + + return ( + //
+ //
+ // + // + // Payload Logo + // + // {!user &&

Welcome to your new project.

} + // {user &&

Welcome back, {user.email}

} + // + //
+ //
+ //

Update this page by editing

+ // + // app/(frontend)/page.tsx + // + //
+ //
+ <> + + + ) +} diff --git a/src/app/(frontend)/styles.css b/src/app/(frontend)/styles.css new file mode 100644 index 0000000..d1fb941 --- /dev/null +++ b/src/app/(frontend)/styles.css @@ -0,0 +1,164 @@ +:root { + --font-mono: 'Roboto Mono', monospace; +} + +* { + box-sizing: border-box; +} + +html { + font-size: 18px; + line-height: 32px; + + background: rgb(0, 0, 0); + -webkit-font-smoothing: antialiased; +} + +html, +body, +#app { + height: 100%; +} + +body { + font-family: system-ui; + font-size: 18px; + line-height: 32px; + + margin: 0; + color: rgb(1000, 1000, 1000); + + @media (max-width: 1024px) { + font-size: 15px; + line-height: 24px; + } +} + +img { + max-width: 100%; + height: auto; + display: block; +} + +h1 { + margin: 40px 0; + font-size: 64px; + line-height: 70px; + font-weight: bold; + + @media (max-width: 1024px) { + margin: 24px 0; + font-size: 42px; + line-height: 42px; + } + + @media (max-width: 768px) { + font-size: 38px; + line-height: 38px; + } + + @media (max-width: 400px) { + font-size: 32px; + line-height: 32px; + } +} + +p { + margin: 24px 0; + + @media (max-width: 1024px) { + margin: calc(var(--base) * 0.75) 0; + } +} + +a { + color: currentColor; + + &:focus { + opacity: 0.8; + outline: none; + } + + &:active { + opacity: 0.7; + outline: none; + } +} + +svg { + vertical-align: middle; +} + +.home { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + height: 100vh; + padding: 45px; + max-width: 1024px; + margin: 0 auto; + overflow: hidden; + + @media (max-width: 400px) { + padding: 24px; + } + + .content { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + flex-grow: 1; + + h1 { + text-align: center; + } + } + + .links { + display: flex; + align-items: center; + gap: 12px; + + a { + text-decoration: none; + padding: 0.25rem 0.5rem; + border-radius: 4px; + } + + .admin { + color: rgb(0, 0, 0); + background: rgb(1000, 1000, 1000); + border: 1px solid rgb(0, 0, 0); + } + + .docs { + color: rgb(1000, 1000, 1000); + background: rgb(0, 0, 0); + border: 1px solid rgb(1000, 1000, 1000); + } + } + + .footer { + display: flex; + align-items: center; + gap: 8px; + + @media (max-width: 1024px) { + flex-direction: column; + gap: 6px; + } + + p { + margin: 0; + } + + .codeLink { + text-decoration: none; + padding: 0 0.5rem; + background: rgb(60, 60, 60); + border-radius: 4px; + } + } +} diff --git a/src/app/my-route/route.ts b/src/app/my-route/route.ts new file mode 100644 index 0000000..0755886 --- /dev/null +++ b/src/app/my-route/route.ts @@ -0,0 +1,12 @@ +import configPromise from '@payload-config' +import { getPayload } from 'payload' + +export const GET = async (request: Request) => { + const payload = await getPayload({ + config: configPromise, + }) + + return Response.json({ + message: 'This is an example of a custom route.', + }) +} diff --git a/src/collections/Media.ts b/src/collections/Media.ts new file mode 100644 index 0000000..568cf42 --- /dev/null +++ b/src/collections/Media.ts @@ -0,0 +1,16 @@ +import type { CollectionConfig } from 'payload' + +export const Media: CollectionConfig = { + slug: 'media', + access: { + read: () => true, + }, + fields: [ + { + name: 'alt', + type: 'text', + required: true, + }, + ], + upload: true, +} diff --git a/src/collections/Users.ts b/src/collections/Users.ts new file mode 100644 index 0000000..c683d0e --- /dev/null +++ b/src/collections/Users.ts @@ -0,0 +1,13 @@ +import type { CollectionConfig } from 'payload' + +export const Users: CollectionConfig = { + slug: 'users', + admin: { + useAsTitle: 'email', + }, + auth: true, + fields: [ + // Email added by default + // Add more fields as needed + ], +} diff --git a/src/components/pages/common/breadcrumb.jsx b/src/components/pages/common/breadcrumb.jsx index 9983345..99e83ce 100644 --- a/src/components/pages/common/breadcrumb.jsx +++ b/src/components/pages/common/breadcrumb.jsx @@ -1,26 +1,57 @@ -import Link from 'next/link'; -import breadCrumbBg from "../../../public/assets/img/pages/page-banner.jpg"; +// import Link from 'next/link'; +// import breadCrumbBg from "../../../public/assets/img/pages/page-banner.jpg"; -const BreadCrumb = ({title, innerTitle}) => { - const firstThreeWords = title?.split(' ').slice(0, 1); - return ( -
-
-
-
-
- {firstThreeWords} -
    -
  • Home|
  • -
  • {innerTitle}
  • -
-

{title}

-
-
-
+// const BreadCrumb = ({title, innerTitle}) => { +// const firstThreeWords = title?.split(' ').slice(0, 1); +// return ( +//
+//
+//
+//
+//
+// {firstThreeWords} +//
    +//
  • Home|
  • +//
  • {innerTitle}
  • +//
+//

{title}

+//
+//
+//
+//
+//
+// ); +// }; + +// export default BreadCrumb; + + +const BreadCrumb = ({ title, innerTitle }) => { + const firstThreeWords = title?.split(' ').slice(0, 1); + return ( +
+
+
+
+
+ {firstThreeWords} +
    +
  • + Home + | +
  • +
  • {innerTitle}
  • +
+

{title}

+
- ); +
+
+ ); }; -export default BreadCrumb; \ No newline at end of file +export default BreadCrumb; diff --git a/src/components/pages/common/skill-bar.jsx b/src/components/pages/common/skill-bar.jsx index da5ddf6..140136b 100644 --- a/src/components/pages/common/skill-bar.jsx +++ b/src/components/pages/common/skill-bar.jsx @@ -1,25 +1,57 @@ -import { useState } from "react"; -import CountUp from 'react-countup'; -import ScrollTrigger from "react-scroll-trigger"; -import ReactSkillBar from 'react-skillbars'; +// import { useState } from "react"; +// import CountUp from 'react-countup'; +// import ScrollTrigger from "react-scroll-trigger"; +// import ReactSkillBar from 'react-skillbars'; -const SkillBarItem = ({countUp}) => { - const [skillBar, setSkillBar] = useState(false); - const skillLevel = [ - { type: 'one', level: countUp } - ]; - return ( - <> - setSkillBar(true)} onExit={()=> setSkillBar(false)}> -
- {skillBar && } - - {skillBar && }% - -
-
- - ); +// const SkillBarItem = ({countUp}) => { +// const [skillBar, setSkillBar] = useState(false); +// const skillLevel = [ +// { type: 'one', level: countUp } +// ]; +// return ( +// <> +// setSkillBar(true)} onExit={()=> setSkillBar(false)}> +//
+// {skillBar && } +// +// {skillBar && }% +// +//
+//
+// +// ); +// }; + +// export default SkillBarItem; + + +import { useState, useEffect } from "react"; +import CountUp from "react-countup"; +import { useInView } from "react-intersection-observer"; +import ReactSkillBar from "react-skillbars"; + +const SkillBarItem = ({ countUp }) => { + const [skillBar, setSkillBar] = useState(false); + const { ref, inView } = useInView({ triggerOnce: true }); + const skillLevel = [{ type: "one", level: countUp }]; + + useEffect(() => { + if (inView) setSkillBar(true); + }, [inView]); + + return ( +
+ {skillBar && ( + + )} + + + {skillBar && } + + % + +
+ ); }; -export default SkillBarItem; \ No newline at end of file +export default SkillBarItem; diff --git a/src/components/pages/error/index.jsx b/src/components/pages/error/index.jsx index e25f458..1aa5de6 100644 --- a/src/components/pages/error/index.jsx +++ b/src/components/pages/error/index.jsx @@ -1,9 +1,9 @@ "use client"; -import SEO from '@/src/components/data/seo'; -import HeaderThree from '@/src/components/layout/header/header-three'; +import SEO from '@/components/data/seo'; +import HeaderThree from '@/components/layout/header/header-three'; import BreadCrumb from '../common/breadcrumb'; import Error from './error'; -import FooterThree from '@/src/components/layout/footer/footer-three'; +import FooterThree from '@/components/layout/footer/footer-three'; import ScrollToTop from '../common/scroll/scroll-to-top'; const ErrorPage = () => { diff --git a/src/payload-types.ts b/src/payload-types.ts new file mode 100644 index 0000000..a9606af --- /dev/null +++ b/src/payload-types.ts @@ -0,0 +1,299 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * This file was automatically generated by Payload. + * DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config, + * and re-run `payload generate:types` to regenerate this file. + */ + +/** + * Supported timezones in IANA format. + * + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "supportedTimezones". + */ +export type SupportedTimezones = + | 'Pacific/Midway' + | 'Pacific/Niue' + | 'Pacific/Honolulu' + | 'Pacific/Rarotonga' + | 'America/Anchorage' + | 'Pacific/Gambier' + | 'America/Los_Angeles' + | 'America/Tijuana' + | 'America/Denver' + | 'America/Phoenix' + | 'America/Chicago' + | 'America/Guatemala' + | 'America/New_York' + | 'America/Bogota' + | 'America/Caracas' + | 'America/Santiago' + | 'America/Buenos_Aires' + | 'America/Sao_Paulo' + | 'Atlantic/South_Georgia' + | 'Atlantic/Azores' + | 'Atlantic/Cape_Verde' + | 'Europe/London' + | 'Europe/Berlin' + | 'Africa/Lagos' + | 'Europe/Athens' + | 'Africa/Cairo' + | 'Europe/Moscow' + | 'Asia/Riyadh' + | 'Asia/Dubai' + | 'Asia/Baku' + | 'Asia/Karachi' + | 'Asia/Tashkent' + | 'Asia/Calcutta' + | 'Asia/Dhaka' + | 'Asia/Almaty' + | 'Asia/Jakarta' + | 'Asia/Bangkok' + | 'Asia/Shanghai' + | 'Asia/Singapore' + | 'Asia/Tokyo' + | 'Asia/Seoul' + | 'Australia/Brisbane' + | 'Australia/Sydney' + | 'Pacific/Guam' + | 'Pacific/Noumea' + | 'Pacific/Auckland' + | 'Pacific/Fiji'; + +export interface Config { + auth: { + users: UserAuthOperations; + }; + blocks: {}; + collections: { + users: User; + media: Media; + 'payload-locked-documents': PayloadLockedDocument; + 'payload-preferences': PayloadPreference; + 'payload-migrations': PayloadMigration; + }; + collectionsJoins: {}; + collectionsSelect: { + users: UsersSelect | UsersSelect; + media: MediaSelect | MediaSelect; + 'payload-locked-documents': PayloadLockedDocumentsSelect | PayloadLockedDocumentsSelect; + 'payload-preferences': PayloadPreferencesSelect | PayloadPreferencesSelect; + 'payload-migrations': PayloadMigrationsSelect | PayloadMigrationsSelect; + }; + db: { + defaultIDType: string; + }; + globals: {}; + globalsSelect: {}; + locale: null; + user: User & { + collection: 'users'; + }; + jobs: { + tasks: unknown; + workflows: unknown; + }; +} +export interface UserAuthOperations { + forgotPassword: { + email: string; + password: string; + }; + login: { + email: string; + password: string; + }; + registerFirstUser: { + email: string; + password: string; + }; + unlock: { + email: string; + password: string; + }; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "users". + */ +export interface User { + id: string; + updatedAt: string; + createdAt: string; + email: string; + resetPasswordToken?: string | null; + resetPasswordExpiration?: string | null; + salt?: string | null; + hash?: string | null; + loginAttempts?: number | null; + lockUntil?: string | null; + sessions?: + | { + id: string; + createdAt?: string | null; + expiresAt: string; + }[] + | null; + password?: string | null; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "media". + */ +export interface Media { + id: string; + alt: string; + updatedAt: string; + createdAt: string; + url?: string | null; + thumbnailURL?: string | null; + filename?: string | null; + mimeType?: string | null; + filesize?: number | null; + width?: number | null; + height?: number | null; + focalX?: number | null; + focalY?: number | null; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "payload-locked-documents". + */ +export interface PayloadLockedDocument { + id: string; + document?: + | ({ + relationTo: 'users'; + value: string | User; + } | null) + | ({ + relationTo: 'media'; + value: string | Media; + } | null); + globalSlug?: string | null; + user: { + relationTo: 'users'; + value: string | User; + }; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "payload-preferences". + */ +export interface PayloadPreference { + id: string; + user: { + relationTo: 'users'; + value: string | User; + }; + key?: string | null; + value?: + | { + [k: string]: unknown; + } + | unknown[] + | string + | number + | boolean + | null; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "payload-migrations". + */ +export interface PayloadMigration { + id: string; + name?: string | null; + batch?: number | null; + updatedAt: string; + createdAt: string; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "users_select". + */ +export interface UsersSelect { + updatedAt?: T; + createdAt?: T; + email?: T; + resetPasswordToken?: T; + resetPasswordExpiration?: T; + salt?: T; + hash?: T; + loginAttempts?: T; + lockUntil?: T; + sessions?: + | T + | { + id?: T; + createdAt?: T; + expiresAt?: T; + }; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "media_select". + */ +export interface MediaSelect { + alt?: T; + updatedAt?: T; + createdAt?: T; + url?: T; + thumbnailURL?: T; + filename?: T; + mimeType?: T; + filesize?: T; + width?: T; + height?: T; + focalX?: T; + focalY?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "payload-locked-documents_select". + */ +export interface PayloadLockedDocumentsSelect { + document?: T; + globalSlug?: T; + user?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "payload-preferences_select". + */ +export interface PayloadPreferencesSelect { + user?: T; + key?: T; + value?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "payload-migrations_select". + */ +export interface PayloadMigrationsSelect { + name?: T; + batch?: T; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "auth". + */ +export interface Auth { + [k: string]: unknown; +} + + +declare module 'payload' { + export interface GeneratedTypes extends Config {} +} \ No newline at end of file diff --git a/src/payload.config.ts b/src/payload.config.ts new file mode 100644 index 0000000..0bc1ea5 --- /dev/null +++ b/src/payload.config.ts @@ -0,0 +1,37 @@ +// storage-adapter-import-placeholder +import { mongooseAdapter } from '@payloadcms/db-mongodb' +import { payloadCloudPlugin } from '@payloadcms/payload-cloud' +import { lexicalEditor } from '@payloadcms/richtext-lexical' +import path from 'path' +import { buildConfig } from 'payload' +import { fileURLToPath } from 'url' +import sharp from 'sharp' + +import { Users } from './collections/Users' +import { Media } from './collections/Media' + +const filename = fileURLToPath(import.meta.url) +const dirname = path.dirname(filename) + +export default buildConfig({ + admin: { + user: Users.slug, + importMap: { + baseDir: path.resolve(dirname), + }, + }, + collections: [Users, Media], + editor: lexicalEditor(), + secret: process.env.PAYLOAD_SECRET || '', + typescript: { + outputFile: path.resolve(dirname, 'payload-types.ts'), + }, + db: mongooseAdapter({ + url: process.env.DATABASE_URI || '', + }), + sharp, + plugins: [ + payloadCloudPlugin(), + // storage-adapter-placeholder + ], +}) diff --git a/tsconfig.json b/tsconfig.json index c04b195..ea2ccec 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -32,13 +32,16 @@ // "node_modules" // ] // } - - { "compilerOptions": { "baseUrl": ".", "paths": { - "@/*": ["src/*"] + "@/*": [ + "src/*" + ], + "@payload-config": [ + "./src/payload.config.ts" + ] }, "lib": [ "dom", @@ -60,7 +63,8 @@ { "name": "next" } - ] + ], + "target": "ES2017" }, "include": [ "next-env.d.ts", @@ -71,5 +75,4 @@ "exclude": [ "node_modules" ] -} - +} \ No newline at end of file -- 2.49.0 From a99200b581179e0657720a77f83096ce6f604438 Mon Sep 17 00:00:00 2001 From: rakia Date: Sun, 31 Aug 2025 11:50:16 +0300 Subject: [PATCH 2/2] Created empty files & folders for CMS blocks, updated the RootLayout --- next.config.mjs | 23 +- package.json | 4 +- .../(frontend)/{mslayout.jsx => mmlayout.jsx} | 0 src/blocks/ArchiveBlock/Component.tsx | 0 src/blocks/ArchiveBlock/config.ts | 1 + src/blocks/Banner/Component.tsx | 0 src/blocks/Banner/config.ts | 0 src/blocks/CallToAction/Component.tsx | 23 + src/blocks/CallToAction/config.ts | 42 + src/blocks/Code/Component.client.tsx | 1 + src/blocks/Code/Component.tsx | 21 + src/blocks/Code/CopyButton.tsx | 0 src/blocks/Code/config.ts | 33 + src/blocks/Content/Component.tsx | 0 src/blocks/Content/config.ts | 82 + src/blocks/Form/Checkbox/index.tsx | 45 + src/blocks/Form/Component.tsx | 163 ++ src/blocks/Form/Country/index.tsx | 65 + src/blocks/Form/Country/options.ts | 982 ++++++++++ src/blocks/Form/Email/index.tsx | 38 + src/blocks/Form/Error/index.tsx | 15 + src/blocks/Form/Message/index.tsx | 13 + src/blocks/Form/Number/index.tsx | 36 + src/blocks/Form/Select/index.tsx | 63 + src/blocks/Form/State/index.tsx | 64 + src/blocks/Form/State/options.ts | 52 + src/blocks/Form/Text/index.tsx | 32 + src/blocks/Form/Textarea/index.tsx | 40 + src/blocks/Form/Width/index.tsx | 13 + src/blocks/Form/config.ts | 51 + src/blocks/Form/fields.tsx | 21 + src/blocks/MediaBlock/Component.tsx | 1 + src/blocks/MediaBlock/config.ts | 14 + src/blocks/RelatedPosts/Component.tsx | 32 + src/blocks/RenderBlocks.ts | 0 src/collections/Categories.ts | 26 + src/collections/Pages/hooks/revalidatePage.ts | 0 src/collections/Pages/indext.ts | 0 .../posts/hooks/populateAuthors.ts | 0 src/collections/posts/hooks/revalidatePost.ts | 0 src/collections/posts/index.ts | 0 src/payload.config.ts | 1741 +++++++++++++++++ 42 files changed, 3732 insertions(+), 5 deletions(-) rename src/app/(frontend)/{mslayout.jsx => mmlayout.jsx} (100%) create mode 100644 src/blocks/ArchiveBlock/Component.tsx create mode 100644 src/blocks/ArchiveBlock/config.ts create mode 100644 src/blocks/Banner/Component.tsx create mode 100644 src/blocks/Banner/config.ts create mode 100644 src/blocks/CallToAction/Component.tsx create mode 100644 src/blocks/CallToAction/config.ts create mode 100644 src/blocks/Code/Component.client.tsx create mode 100644 src/blocks/Code/Component.tsx create mode 100644 src/blocks/Code/CopyButton.tsx create mode 100644 src/blocks/Code/config.ts create mode 100644 src/blocks/Content/Component.tsx create mode 100644 src/blocks/Content/config.ts create mode 100644 src/blocks/Form/Checkbox/index.tsx create mode 100644 src/blocks/Form/Component.tsx create mode 100644 src/blocks/Form/Country/index.tsx create mode 100644 src/blocks/Form/Country/options.ts create mode 100644 src/blocks/Form/Email/index.tsx create mode 100644 src/blocks/Form/Error/index.tsx create mode 100644 src/blocks/Form/Message/index.tsx create mode 100644 src/blocks/Form/Number/index.tsx create mode 100644 src/blocks/Form/Select/index.tsx create mode 100644 src/blocks/Form/State/index.tsx create mode 100644 src/blocks/Form/State/options.ts create mode 100644 src/blocks/Form/Text/index.tsx create mode 100644 src/blocks/Form/Textarea/index.tsx create mode 100644 src/blocks/Form/Width/index.tsx create mode 100644 src/blocks/Form/config.ts create mode 100644 src/blocks/Form/fields.tsx create mode 100644 src/blocks/MediaBlock/Component.tsx create mode 100644 src/blocks/MediaBlock/config.ts create mode 100644 src/blocks/RelatedPosts/Component.tsx create mode 100644 src/blocks/RenderBlocks.ts create mode 100644 src/collections/Categories.ts create mode 100644 src/collections/Pages/hooks/revalidatePage.ts create mode 100644 src/collections/Pages/indext.ts create mode 100644 src/collections/posts/hooks/populateAuthors.ts create mode 100644 src/collections/posts/hooks/revalidatePost.ts create mode 100644 src/collections/posts/index.ts diff --git a/next.config.mjs b/next.config.mjs index 9b7ea54..aee52ee 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,5 +1,20 @@ -import { withPayload } from "@payloadcms/next/withPayload"; -/** @type {import('next').NextConfig} */ -const nextConfig = {}; +// import { withPayload } from "@payloadcms/next/withPayload"; +// /** @type {import('next').NextConfig} */ +// const nextConfig = {}; -export default withPayload(nextConfig); +// export default withPayload(nextConfig); + + +import { withPayload } from '@payloadcms/next/withPayload' + +/** @type {import('next').NextConfig} */ +const nextConfig = { + // Your Next.js config here + experimental: { + reactCompiler: false, + }, +} + +// Make sure you wrap your `nextConfig` +// with the `withPayload` plugin +export default withPayload(nextConfig) \ No newline at end of file diff --git a/package.json b/package.json index 7c901cb..0f6f5f6 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,12 @@ "react-modal-video": "^2.0.1", "react-scroll-trigger": "^0.6.14", "react-skillbars": "^2.2.0", + "sharp": "^0.34.3", "swiper": "^11.0.7" }, "devDependencies": { "@types/node": "24.3.0", "typescript": "5.9.2" - } + }, + "type": "module" } diff --git a/src/app/(frontend)/mslayout.jsx b/src/app/(frontend)/mmlayout.jsx similarity index 100% rename from src/app/(frontend)/mslayout.jsx rename to src/app/(frontend)/mmlayout.jsx diff --git a/src/blocks/ArchiveBlock/Component.tsx b/src/blocks/ArchiveBlock/Component.tsx new file mode 100644 index 0000000..e69de29 diff --git a/src/blocks/ArchiveBlock/config.ts b/src/blocks/ArchiveBlock/config.ts new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/blocks/ArchiveBlock/config.ts @@ -0,0 +1 @@ + diff --git a/src/blocks/Banner/Component.tsx b/src/blocks/Banner/Component.tsx new file mode 100644 index 0000000..e69de29 diff --git a/src/blocks/Banner/config.ts b/src/blocks/Banner/config.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/blocks/CallToAction/Component.tsx b/src/blocks/CallToAction/Component.tsx new file mode 100644 index 0000000..6b3771c --- /dev/null +++ b/src/blocks/CallToAction/Component.tsx @@ -0,0 +1,23 @@ +import React from 'react' + +import type { CallToActionBlock as CTABlockProps } from '@/payload-types' + +import RichText from '@/components/RichText' +import { CMSLink } from '@/components/Link' + +export const CallToActionBlock: React.FC = ({ links, richText }) => { + return ( +
+
+
+ {richText && } +
+
+ {(links || []).map(({ link }, i) => { + return + })} +
+
+
+ ) +} diff --git a/src/blocks/CallToAction/config.ts b/src/blocks/CallToAction/config.ts new file mode 100644 index 0000000..f4ffa77 --- /dev/null +++ b/src/blocks/CallToAction/config.ts @@ -0,0 +1,42 @@ +import type { Block } from 'payload' + +import { + FixedToolbarFeature, + HeadingFeature, + InlineToolbarFeature, + lexicalEditor, +} from '@payloadcms/richtext-lexical' + +import { linkGroup } from '../../fields/linkGroup' + +export const CallToAction: Block = { + slug: 'cta', + interfaceName: 'CallToActionBlock', + fields: [ + { + name: 'richText', + type: 'richText', + editor: lexicalEditor({ + features: ({ rootFeatures }) => { + return [ + ...rootFeatures, + HeadingFeature({ enabledHeadingSizes: ['h1', 'h2', 'h3', 'h4'] }), + FixedToolbarFeature(), + InlineToolbarFeature(), + ] + }, + }), + label: false, + }, + linkGroup({ + appearances: ['default', 'outline'], + overrides: { + maxRows: 2, + }, + }), + ], + labels: { + plural: 'Calls to Action', + singular: 'Call to Action', + }, +} diff --git a/src/blocks/Code/Component.client.tsx b/src/blocks/Code/Component.client.tsx new file mode 100644 index 0000000..078426a --- /dev/null +++ b/src/blocks/Code/Component.client.tsx @@ -0,0 +1 @@ +// \ No newline at end of file diff --git a/src/blocks/Code/Component.tsx b/src/blocks/Code/Component.tsx new file mode 100644 index 0000000..130274a --- /dev/null +++ b/src/blocks/Code/Component.tsx @@ -0,0 +1,21 @@ +// import React from 'react' + +// import { Code } from './Component.client' + +// export type CodeBlockProps = { +// code: string +// language?: string +// blockType: 'code' +// } + +// type Props = CodeBlockProps & { +// className?: string +// } + +// export const CodeBlock: React.FC = ({ className, code, language }) => { +// return ( +//
+// +//
+// ) +// } diff --git a/src/blocks/Code/CopyButton.tsx b/src/blocks/Code/CopyButton.tsx new file mode 100644 index 0000000..e69de29 diff --git a/src/blocks/Code/config.ts b/src/blocks/Code/config.ts new file mode 100644 index 0000000..7b26f80 --- /dev/null +++ b/src/blocks/Code/config.ts @@ -0,0 +1,33 @@ +import type { Block } from 'payload' + +export const Code: Block = { + slug: 'code', + interfaceName: 'CodeBlock', + fields: [ + { + name: 'language', + type: 'select', + defaultValue: 'typescript', + options: [ + { + label: 'Typescript', + value: 'typescript', + }, + { + label: 'Javascript', + value: 'javascript', + }, + { + label: 'CSS', + value: 'css', + }, + ], + }, + { + name: 'code', + type: 'code', + label: false, + required: true, + }, + ], +} diff --git a/src/blocks/Content/Component.tsx b/src/blocks/Content/Component.tsx new file mode 100644 index 0000000..e69de29 diff --git a/src/blocks/Content/config.ts b/src/blocks/Content/config.ts new file mode 100644 index 0000000..d181890 --- /dev/null +++ b/src/blocks/Content/config.ts @@ -0,0 +1,82 @@ +// import type { Block, Field } from 'payload' + +// import { +// FixedToolbarFeature, +// HeadingFeature, +// InlineToolbarFeature, +// lexicalEditor, +// } from '@payloadcms/richtext-lexical' + +// import { link } from '@/fields/link' + +// const columnFields: Field[] = [ +// { +// name: 'size', +// type: 'select', +// defaultValue: 'oneThird', +// options: [ +// { +// label: 'One Third', +// value: 'oneThird', +// }, +// { +// label: 'Half', +// value: 'half', +// }, +// { +// label: 'Two Thirds', +// value: 'twoThirds', +// }, +// { +// label: 'Full', +// value: 'full', +// }, +// ], +// }, +// { +// name: 'richText', +// type: 'richText', +// editor: lexicalEditor({ +// features: ({ rootFeatures }) => { +// return [ +// ...rootFeatures, +// HeadingFeature({ enabledHeadingSizes: ['h2', 'h3', 'h4'] }), +// FixedToolbarFeature(), +// InlineToolbarFeature(), +// ] +// }, +// }), +// label: false, +// }, +// { +// name: 'enableLink', +// type: 'checkbox', +// }, +// link({ +// overrides: { +// admin: { +// condition: (_data, siblingData) => { +// return Boolean(siblingData?.enableLink) +// }, +// }, +// }, +// }), +// ] + +// export const Content: Block = { +// slug: 'content', +// interfaceName: 'ContentBlock', +// fields: [ +// { +// name: 'columns', +// type: 'array', +// admin: { +// initCollapsed: true, +// }, +// fields: columnFields, +// }, +// ], +// } + + + diff --git a/src/blocks/Form/Checkbox/index.tsx b/src/blocks/Form/Checkbox/index.tsx new file mode 100644 index 0000000..633d5db --- /dev/null +++ b/src/blocks/Form/Checkbox/index.tsx @@ -0,0 +1,45 @@ +import type { CheckboxField } from '@payloadcms/plugin-form-builder/types' +import type { FieldErrorsImpl, FieldValues, UseFormRegister } from 'react-hook-form' + +import { useFormContext } from 'react-hook-form' + +import { Checkbox as CheckboxUi } from '@/components/ui/checkbox' +import { Label } from '@/components/ui/label' +import React from 'react' + +import { Error } from '../Error' +import { Width } from '../Width' + +export const Checkbox: React.FC< + CheckboxField & { + errors: Partial + register: UseFormRegister + } +> = ({ name, defaultValue, errors, label, register, required, width }) => { + const props = register(name, { required: required }) + const { setValue } = useFormContext() + + return ( + +
+ { + setValue(props.name, checked) + }} + /> + +
+ {errors[name] && } +
+ ) +} diff --git a/src/blocks/Form/Component.tsx b/src/blocks/Form/Component.tsx new file mode 100644 index 0000000..b0b5d38 --- /dev/null +++ b/src/blocks/Form/Component.tsx @@ -0,0 +1,163 @@ +'use client' +import type { FormFieldBlock, Form as FormType } from '@payloadcms/plugin-form-builder/types' + +import { useRouter } from 'next/navigation' +import React, { useCallback, useState } from 'react' +import { useForm, FormProvider } from 'react-hook-form' +import RichText from '@/components/RichText' +import { Button } from '@/components/ui/button' +import type { SerializedEditorState } from '@payloadcms/richtext-lexical/lexical' + +import { fields } from './fields' +import { getClientSideURL } from '@/utilities/getURL' + +export type FormBlockType = { + blockName?: string + blockType?: 'formBlock' + enableIntro: boolean + form: FormType + introContent?: SerializedEditorState +} + +export const FormBlock: React.FC< + { + id?: string + } & FormBlockType +> = (props) => { + const { + enableIntro, + form: formFromProps, + form: { id: formID, confirmationMessage, confirmationType, redirect, submitButtonLabel } = {}, + introContent, + } = props + + const formMethods = useForm({ + defaultValues: formFromProps.fields, + }) + const { + control, + formState: { errors }, + handleSubmit, + register, + } = formMethods + + const [isLoading, setIsLoading] = useState(false) + const [hasSubmitted, setHasSubmitted] = useState() + const [error, setError] = useState<{ message: string; status?: string } | undefined>() + const router = useRouter() + + const onSubmit = useCallback( + (data: FormFieldBlock[]) => { + let loadingTimerID: ReturnType + const submitForm = async () => { + setError(undefined) + + const dataToSend = Object.entries(data).map(([name, value]) => ({ + field: name, + value, + })) + + // delay loading indicator by 1s + loadingTimerID = setTimeout(() => { + setIsLoading(true) + }, 1000) + + try { + const req = await fetch(`${getClientSideURL()}/api/form-submissions`, { + body: JSON.stringify({ + form: formID, + submissionData: dataToSend, + }), + headers: { + 'Content-Type': 'application/json', + }, + method: 'POST', + }) + + const res = await req.json() + + clearTimeout(loadingTimerID) + + if (req.status >= 400) { + setIsLoading(false) + + setError({ + message: res.errors?.[0]?.message || 'Internal Server Error', + status: res.status, + }) + + return + } + + setIsLoading(false) + setHasSubmitted(true) + + if (confirmationType === 'redirect' && redirect) { + const { url } = redirect + + const redirectUrl = url + + if (redirectUrl) router.push(redirectUrl) + } + } catch (err) { + console.warn(err) + setIsLoading(false) + setError({ + message: 'Something went wrong.', + }) + } + } + + void submitForm() + }, + [router, formID, redirect, confirmationType], + ) + + return ( +
+ {enableIntro && introContent && !hasSubmitted && ( + + )} +
+ + {!isLoading && hasSubmitted && confirmationType === 'message' && ( + + )} + {isLoading && !hasSubmitted &&

Loading, please wait...

} + {error &&
{`${error.status || '500'}: ${error.message || ''}`}
} + {!hasSubmitted && ( +
+
+ {formFromProps && + formFromProps.fields && + formFromProps.fields?.map((field, index) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const Field: React.FC = fields?.[field.blockType as keyof typeof fields] + if (Field) { + return ( +
+ +
+ ) + } + return null + })} +
+ + +
+ )} +
+
+
+ ) +} diff --git a/src/blocks/Form/Country/index.tsx b/src/blocks/Form/Country/index.tsx new file mode 100644 index 0000000..9c85b75 --- /dev/null +++ b/src/blocks/Form/Country/index.tsx @@ -0,0 +1,65 @@ +import type { CountryField } from '@payloadcms/plugin-form-builder/types' +import type { Control, FieldErrorsImpl } from 'react-hook-form' + +import { Label } from '@/components/ui/label' +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@/components/ui/select' +import React from 'react' +import { Controller } from 'react-hook-form' + +import { Error } from '../Error' +import { Width } from '../Width' +import { countryOptions } from './options' + +export const Country: React.FC< + CountryField & { + control: Control + errors: Partial + } +> = ({ name, control, errors, label, required, width }) => { + return ( + + + { + const controlledValue = countryOptions.find((t) => t.value === value) + + return ( + + ) + }} + rules={{ required }} + /> + {errors[name] && } + + ) +} diff --git a/src/blocks/Form/Country/options.ts b/src/blocks/Form/Country/options.ts new file mode 100644 index 0000000..f952c1d --- /dev/null +++ b/src/blocks/Form/Country/options.ts @@ -0,0 +1,982 @@ +export const countryOptions = [ + { + label: 'Afghanistan', + value: 'AF', + }, + { + label: 'Ă…land Islands', + value: 'AX', + }, + { + label: 'Albania', + value: 'AL', + }, + { + label: 'Algeria', + value: 'DZ', + }, + { + label: 'American Samoa', + value: 'AS', + }, + { + label: 'Andorra', + value: 'AD', + }, + { + label: 'Angola', + value: 'AO', + }, + { + label: 'Anguilla', + value: 'AI', + }, + { + label: 'Antarctica', + value: 'AQ', + }, + { + label: 'Antigua and Barbuda', + value: 'AG', + }, + { + label: 'Argentina', + value: 'AR', + }, + { + label: 'Armenia', + value: 'AM', + }, + { + label: 'Aruba', + value: 'AW', + }, + { + label: 'Australia', + value: 'AU', + }, + { + label: 'Austria', + value: 'AT', + }, + { + label: 'Azerbaijan', + value: 'AZ', + }, + { + label: 'Bahamas', + value: 'BS', + }, + { + label: 'Bahrain', + value: 'BH', + }, + { + label: 'Bangladesh', + value: 'BD', + }, + { + label: 'Barbados', + value: 'BB', + }, + { + label: 'Belarus', + value: 'BY', + }, + { + label: 'Belgium', + value: 'BE', + }, + { + label: 'Belize', + value: 'BZ', + }, + { + label: 'Benin', + value: 'BJ', + }, + { + label: 'Bermuda', + value: 'BM', + }, + { + label: 'Bhutan', + value: 'BT', + }, + { + label: 'Bolivia', + value: 'BO', + }, + { + label: 'Bosnia and Herzegovina', + value: 'BA', + }, + { + label: 'Botswana', + value: 'BW', + }, + { + label: 'Bouvet Island', + value: 'BV', + }, + { + label: 'Brazil', + value: 'BR', + }, + { + label: 'British Indian Ocean Territory', + value: 'IO', + }, + { + label: 'Brunei Darussalam', + value: 'BN', + }, + { + label: 'Bulgaria', + value: 'BG', + }, + { + label: 'Burkina Faso', + value: 'BF', + }, + { + label: 'Burundi', + value: 'BI', + }, + { + label: 'Cambodia', + value: 'KH', + }, + { + label: 'Cameroon', + value: 'CM', + }, + { + label: 'Canada', + value: 'CA', + }, + { + label: 'Cape Verde', + value: 'CV', + }, + { + label: 'Cayman Islands', + value: 'KY', + }, + { + label: 'Central African Republic', + value: 'CF', + }, + { + label: 'Chad', + value: 'TD', + }, + { + label: 'Chile', + value: 'CL', + }, + { + label: 'China', + value: 'CN', + }, + { + label: 'Christmas Island', + value: 'CX', + }, + { + label: 'Cocos (Keeling) Islands', + value: 'CC', + }, + { + label: 'Colombia', + value: 'CO', + }, + { + label: 'Comoros', + value: 'KM', + }, + { + label: 'Congo', + value: 'CG', + }, + { + label: 'Congo, The Democratic Republic of the', + value: 'CD', + }, + { + label: 'Cook Islands', + value: 'CK', + }, + { + label: 'Costa Rica', + value: 'CR', + }, + { + label: "Cote D'Ivoire", + value: 'CI', + }, + { + label: 'Croatia', + value: 'HR', + }, + { + label: 'Cuba', + value: 'CU', + }, + { + label: 'Cyprus', + value: 'CY', + }, + { + label: 'Czech Republic', + value: 'CZ', + }, + { + label: 'Denmark', + value: 'DK', + }, + { + label: 'Djibouti', + value: 'DJ', + }, + { + label: 'Dominica', + value: 'DM', + }, + { + label: 'Dominican Republic', + value: 'DO', + }, + { + label: 'Ecuador', + value: 'EC', + }, + { + label: 'Egypt', + value: 'EG', + }, + { + label: 'El Salvador', + value: 'SV', + }, + { + label: 'Equatorial Guinea', + value: 'GQ', + }, + { + label: 'Eritrea', + value: 'ER', + }, + { + label: 'Estonia', + value: 'EE', + }, + { + label: 'Ethiopia', + value: 'ET', + }, + { + label: 'Falkland Islands (Malvinas)', + value: 'FK', + }, + { + label: 'Faroe Islands', + value: 'FO', + }, + { + label: 'Fiji', + value: 'FJ', + }, + { + label: 'Finland', + value: 'FI', + }, + { + label: 'France', + value: 'FR', + }, + { + label: 'French Guiana', + value: 'GF', + }, + { + label: 'French Polynesia', + value: 'PF', + }, + { + label: 'French Southern Territories', + value: 'TF', + }, + { + label: 'Gabon', + value: 'GA', + }, + { + label: 'Gambia', + value: 'GM', + }, + { + label: 'Georgia', + value: 'GE', + }, + { + label: 'Germany', + value: 'DE', + }, + { + label: 'Ghana', + value: 'GH', + }, + { + label: 'Gibraltar', + value: 'GI', + }, + { + label: 'Greece', + value: 'GR', + }, + { + label: 'Greenland', + value: 'GL', + }, + { + label: 'Grenada', + value: 'GD', + }, + { + label: 'Guadeloupe', + value: 'GP', + }, + { + label: 'Guam', + value: 'GU', + }, + { + label: 'Guatemala', + value: 'GT', + }, + { + label: 'Guernsey', + value: 'GG', + }, + { + label: 'Guinea', + value: 'GN', + }, + { + label: 'Guinea-Bissau', + value: 'GW', + }, + { + label: 'Guyana', + value: 'GY', + }, + { + label: 'Haiti', + value: 'HT', + }, + { + label: 'Heard Island and Mcdonald Islands', + value: 'HM', + }, + { + label: 'Holy See (Vatican City State)', + value: 'VA', + }, + { + label: 'Honduras', + value: 'HN', + }, + { + label: 'Hong Kong', + value: 'HK', + }, + { + label: 'Hungary', + value: 'HU', + }, + { + label: 'Iceland', + value: 'IS', + }, + { + label: 'India', + value: 'IN', + }, + { + label: 'Indonesia', + value: 'ID', + }, + { + label: 'Iran, Islamic Republic Of', + value: 'IR', + }, + { + label: 'Iraq', + value: 'IQ', + }, + { + label: 'Ireland', + value: 'IE', + }, + { + label: 'Isle of Man', + value: 'IM', + }, + { + label: 'Israel', + value: 'IL', + }, + { + label: 'Italy', + value: 'IT', + }, + { + label: 'Jamaica', + value: 'JM', + }, + { + label: 'Japan', + value: 'JP', + }, + { + label: 'Jersey', + value: 'JE', + }, + { + label: 'Jordan', + value: 'JO', + }, + { + label: 'Kazakhstan', + value: 'KZ', + }, + { + label: 'Kenya', + value: 'KE', + }, + { + label: 'Kiribati', + value: 'KI', + }, + { + label: "Democratic People's Republic of Korea", + value: 'KP', + }, + { + label: 'Korea, Republic of', + value: 'KR', + }, + { + label: 'Kosovo', + value: 'XK', + }, + { + label: 'Kuwait', + value: 'KW', + }, + { + label: 'Kyrgyzstan', + value: 'KG', + }, + { + label: "Lao People's Democratic Republic", + value: 'LA', + }, + { + label: 'Latvia', + value: 'LV', + }, + { + label: 'Lebanon', + value: 'LB', + }, + { + label: 'Lesotho', + value: 'LS', + }, + { + label: 'Liberia', + value: 'LR', + }, + { + label: 'Libyan Arab Jamahiriya', + value: 'LY', + }, + { + label: 'Liechtenstein', + value: 'LI', + }, + { + label: 'Lithuania', + value: 'LT', + }, + { + label: 'Luxembourg', + value: 'LU', + }, + { + label: 'Macao', + value: 'MO', + }, + { + label: 'Macedonia, The Former Yugoslav Republic of', + value: 'MK', + }, + { + label: 'Madagascar', + value: 'MG', + }, + { + label: 'Malawi', + value: 'MW', + }, + { + label: 'Malaysia', + value: 'MY', + }, + { + label: 'Maldives', + value: 'MV', + }, + { + label: 'Mali', + value: 'ML', + }, + { + label: 'Malta', + value: 'MT', + }, + { + label: 'Marshall Islands', + value: 'MH', + }, + { + label: 'Martinique', + value: 'MQ', + }, + { + label: 'Mauritania', + value: 'MR', + }, + { + label: 'Mauritius', + value: 'MU', + }, + { + label: 'Mayotte', + value: 'YT', + }, + { + label: 'Mexico', + value: 'MX', + }, + { + label: 'Micronesia, Federated States of', + value: 'FM', + }, + { + label: 'Moldova, Republic of', + value: 'MD', + }, + { + label: 'Monaco', + value: 'MC', + }, + { + label: 'Mongolia', + value: 'MN', + }, + { + label: 'Montenegro', + value: 'ME', + }, + { + label: 'Montserrat', + value: 'MS', + }, + { + label: 'Morocco', + value: 'MA', + }, + { + label: 'Mozambique', + value: 'MZ', + }, + { + label: 'Myanmar', + value: 'MM', + }, + { + label: 'Namibia', + value: 'NA', + }, + { + label: 'Nauru', + value: 'NR', + }, + { + label: 'Nepal', + value: 'NP', + }, + { + label: 'Netherlands', + value: 'NL', + }, + { + label: 'Netherlands Antilles', + value: 'AN', + }, + { + label: 'New Caledonia', + value: 'NC', + }, + { + label: 'New Zealand', + value: 'NZ', + }, + { + label: 'Nicaragua', + value: 'NI', + }, + { + label: 'Niger', + value: 'NE', + }, + { + label: 'Nigeria', + value: 'NG', + }, + { + label: 'Niue', + value: 'NU', + }, + { + label: 'Norfolk Island', + value: 'NF', + }, + { + label: 'Northern Mariana Islands', + value: 'MP', + }, + { + label: 'Norway', + value: 'NO', + }, + { + label: 'Oman', + value: 'OM', + }, + { + label: 'Pakistan', + value: 'PK', + }, + { + label: 'Palau', + value: 'PW', + }, + { + label: 'Palestinian Territory, Occupied', + value: 'PS', + }, + { + label: 'Panama', + value: 'PA', + }, + { + label: 'Papua New Guinea', + value: 'PG', + }, + { + label: 'Paraguay', + value: 'PY', + }, + { + label: 'Peru', + value: 'PE', + }, + { + label: 'Philippines', + value: 'PH', + }, + { + label: 'Pitcairn', + value: 'PN', + }, + { + label: 'Poland', + value: 'PL', + }, + { + label: 'Portugal', + value: 'PT', + }, + { + label: 'Puerto Rico', + value: 'PR', + }, + { + label: 'Qatar', + value: 'QA', + }, + { + label: 'Reunion', + value: 'RE', + }, + { + label: 'Romania', + value: 'RO', + }, + { + label: 'Russian Federation', + value: 'RU', + }, + { + label: 'Rwanda', + value: 'RW', + }, + { + label: 'Saint Helena', + value: 'SH', + }, + { + label: 'Saint Kitts and Nevis', + value: 'KN', + }, + { + label: 'Saint Lucia', + value: 'LC', + }, + { + label: 'Saint Pierre and Miquelon', + value: 'PM', + }, + { + label: 'Saint Vincent and the Grenadines', + value: 'VC', + }, + { + label: 'Samoa', + value: 'WS', + }, + { + label: 'San Marino', + value: 'SM', + }, + { + label: 'Sao Tome and Principe', + value: 'ST', + }, + { + label: 'Saudi Arabia', + value: 'SA', + }, + { + label: 'Senegal', + value: 'SN', + }, + { + label: 'Serbia', + value: 'RS', + }, + { + label: 'Seychelles', + value: 'SC', + }, + { + label: 'Sierra Leone', + value: 'SL', + }, + { + label: 'Singapore', + value: 'SG', + }, + { + label: 'Slovakia', + value: 'SK', + }, + { + label: 'Slovenia', + value: 'SI', + }, + { + label: 'Solomon Islands', + value: 'SB', + }, + { + label: 'Somalia', + value: 'SO', + }, + { + label: 'South Africa', + value: 'ZA', + }, + { + label: 'South Georgia and the South Sandwich Islands', + value: 'GS', + }, + { + label: 'Spain', + value: 'ES', + }, + { + label: 'Sri Lanka', + value: 'LK', + }, + { + label: 'Sudan', + value: 'SD', + }, + { + label: 'Suriname', + value: 'SR', + }, + { + label: 'Svalbard and Jan Mayen', + value: 'SJ', + }, + { + label: 'Swaziland', + value: 'SZ', + }, + { + label: 'Sweden', + value: 'SE', + }, + { + label: 'Switzerland', + value: 'CH', + }, + { + label: 'Syrian Arab Republic', + value: 'SY', + }, + { + label: 'Taiwan', + value: 'TW', + }, + { + label: 'Tajikistan', + value: 'TJ', + }, + { + label: 'Tanzania, United Republic of', + value: 'TZ', + }, + { + label: 'Thailand', + value: 'TH', + }, + { + label: 'Timor-Leste', + value: 'TL', + }, + { + label: 'Togo', + value: 'TG', + }, + { + label: 'Tokelau', + value: 'TK', + }, + { + label: 'Tonga', + value: 'TO', + }, + { + label: 'Trinidad and Tobago', + value: 'TT', + }, + { + label: 'Tunisia', + value: 'TN', + }, + { + label: 'Turkey', + value: 'TR', + }, + { + label: 'Turkmenistan', + value: 'TM', + }, + { + label: 'Turks and Caicos Islands', + value: 'TC', + }, + { + label: 'Tuvalu', + value: 'TV', + }, + { + label: 'Uganda', + value: 'UG', + }, + { + label: 'Ukraine', + value: 'UA', + }, + { + label: 'United Arab Emirates', + value: 'AE', + }, + { + label: 'United Kingdom', + value: 'GB', + }, + { + label: 'United States', + value: 'US', + }, + { + label: 'United States Minor Outlying Islands', + value: 'UM', + }, + { + label: 'Uruguay', + value: 'UY', + }, + { + label: 'Uzbekistan', + value: 'UZ', + }, + { + label: 'Vanuatu', + value: 'VU', + }, + { + label: 'Venezuela', + value: 'VE', + }, + { + label: 'Viet Nam', + value: 'VN', + }, + { + label: 'Virgin Islands, British', + value: 'VG', + }, + { + label: 'Virgin Islands, U.S.', + value: 'VI', + }, + { + label: 'Wallis and Futuna', + value: 'WF', + }, + { + label: 'Western Sahara', + value: 'EH', + }, + { + label: 'Yemen', + value: 'YE', + }, + { + label: 'Zambia', + value: 'ZM', + }, + { + label: 'Zimbabwe', + value: 'ZW', + }, +] diff --git a/src/blocks/Form/Email/index.tsx b/src/blocks/Form/Email/index.tsx new file mode 100644 index 0000000..fc9fd28 --- /dev/null +++ b/src/blocks/Form/Email/index.tsx @@ -0,0 +1,38 @@ +import type { EmailField } from '@payloadcms/plugin-form-builder/types' +import type { FieldErrorsImpl, FieldValues, UseFormRegister } from 'react-hook-form' + +import { Input } from '@/components/ui/input' +import { Label } from '@/components/ui/label' +import React from 'react' + +import { Error } from '../Error' +import { Width } from '../Width' + +export const Email: React.FC< + EmailField & { + errors: Partial + register: UseFormRegister + } +> = ({ name, defaultValue, errors, label, register, required, width }) => { + return ( + + + + + {errors[name] && } + + ) +} diff --git a/src/blocks/Form/Error/index.tsx b/src/blocks/Form/Error/index.tsx new file mode 100644 index 0000000..a7b9e47 --- /dev/null +++ b/src/blocks/Form/Error/index.tsx @@ -0,0 +1,15 @@ +'use client' + +import * as React from 'react' +import { useFormContext } from 'react-hook-form' + +export const Error = ({ name }: { name: string }) => { + const { + formState: { errors }, + } = useFormContext() + return ( +
+ {(errors[name]?.message as string) || 'This field is required'} +
+ ) +} diff --git a/src/blocks/Form/Message/index.tsx b/src/blocks/Form/Message/index.tsx new file mode 100644 index 0000000..5924cf9 --- /dev/null +++ b/src/blocks/Form/Message/index.tsx @@ -0,0 +1,13 @@ +import RichText from '@/components/RichText' +import React from 'react' + +import { Width } from '../Width' +import { SerializedEditorState } from '@payloadcms/richtext-lexical/lexical' + +export const Message: React.FC<{ message: SerializedEditorState }> = ({ message }) => { + return ( + + {message && } + + ) +} diff --git a/src/blocks/Form/Number/index.tsx b/src/blocks/Form/Number/index.tsx new file mode 100644 index 0000000..f26e54a --- /dev/null +++ b/src/blocks/Form/Number/index.tsx @@ -0,0 +1,36 @@ +import type { TextField } from '@payloadcms/plugin-form-builder/types' +import type { FieldErrorsImpl, FieldValues, UseFormRegister } from 'react-hook-form' + +import { Input } from '@/components/ui/input' +import { Label } from '@/components/ui/label' +import React from 'react' + +import { Error } from '../Error' +import { Width } from '../Width' +export const Number: React.FC< + TextField & { + errors: Partial + register: UseFormRegister + } +> = ({ name, defaultValue, errors, label, register, required, width }) => { + return ( + + + + {errors[name] && } + + ) +} diff --git a/src/blocks/Form/Select/index.tsx b/src/blocks/Form/Select/index.tsx new file mode 100644 index 0000000..30c0e83 --- /dev/null +++ b/src/blocks/Form/Select/index.tsx @@ -0,0 +1,63 @@ +import type { SelectField } from '@payloadcms/plugin-form-builder/types' +import type { Control, FieldErrorsImpl } from 'react-hook-form' + +import { Label } from '@/components/ui/label' +import { + Select as SelectComponent, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@/components/ui/select' +import React from 'react' +import { Controller } from 'react-hook-form' + +import { Error } from '../Error' +import { Width } from '../Width' + +export const Select: React.FC< + SelectField & { + control: Control + errors: Partial + } +> = ({ name, control, errors, label, options, required, width, defaultValue }) => { + return ( + + + { + const controlledValue = options.find((t) => t.value === value) + + return ( + onChange(val)} value={controlledValue?.value}> + + + + + {options.map(({ label, value }) => { + return ( + + {label} + + ) + })} + + + ) + }} + rules={{ required }} + /> + {errors[name] && } + + ) +} diff --git a/src/blocks/Form/State/index.tsx b/src/blocks/Form/State/index.tsx new file mode 100644 index 0000000..29e49ca --- /dev/null +++ b/src/blocks/Form/State/index.tsx @@ -0,0 +1,64 @@ +import type { StateField } from '@payloadcms/plugin-form-builder/types' +import type { Control, FieldErrorsImpl } from 'react-hook-form' + +import { Label } from '@/components/ui/label' +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@/components/ui/select' +import React from 'react' +import { Controller } from 'react-hook-form' + +import { Error } from '../Error' +import { Width } from '../Width' +import { stateOptions } from './options' + +export const State: React.FC< + StateField & { + control: Control + errors: Partial + } +> = ({ name, control, errors, label, required, width }) => { + return ( + + + { + const controlledValue = stateOptions.find((t) => t.value === value) + + return ( + + ) + }} + rules={{ required }} + /> + {errors[name] && } + + ) +} diff --git a/src/blocks/Form/State/options.ts b/src/blocks/Form/State/options.ts new file mode 100644 index 0000000..8dff991 --- /dev/null +++ b/src/blocks/Form/State/options.ts @@ -0,0 +1,52 @@ +export const stateOptions = [ + { label: 'Alabama', value: 'AL' }, + { label: 'Alaska', value: 'AK' }, + { label: 'Arizona', value: 'AZ' }, + { label: 'Arkansas', value: 'AR' }, + { label: 'California', value: 'CA' }, + { label: 'Colorado', value: 'CO' }, + { label: 'Connecticut', value: 'CT' }, + { label: 'Delaware', value: 'DE' }, + { label: 'Florida', value: 'FL' }, + { label: 'Georgia', value: 'GA' }, + { label: 'Hawaii', value: 'HI' }, + { label: 'Idaho', value: 'ID' }, + { label: 'Illinois', value: 'IL' }, + { label: 'Indiana', value: 'IN' }, + { label: 'Iowa', value: 'IA' }, + { label: 'Kansas', value: 'KS' }, + { label: 'Kentucky', value: 'KY' }, + { label: 'Louisiana', value: 'LA' }, + { label: 'Maine', value: 'ME' }, + { label: 'Maryland', value: 'MD' }, + { label: 'Massachusetts', value: 'MA' }, + { label: 'Michigan', value: 'MI' }, + { label: 'Minnesota', value: 'MN' }, + { label: 'Mississippi', value: 'MS' }, + { label: 'Missouri', value: 'MO' }, + { label: 'Montana', value: 'MT' }, + { label: 'Nebraska', value: 'NE' }, + { label: 'Nevada', value: 'NV' }, + { label: 'New Hampshire', value: 'NH' }, + { label: 'New Jersey', value: 'NJ' }, + { label: 'New Mexico', value: 'NM' }, + { label: 'New York', value: 'NY' }, + { label: 'North Carolina', value: 'NC' }, + { label: 'North Dakota', value: 'ND' }, + { label: 'Ohio', value: 'OH' }, + { label: 'Oklahoma', value: 'OK' }, + { label: 'Oregon', value: 'OR' }, + { label: 'Pennsylvania', value: 'PA' }, + { label: 'Rhode Island', value: 'RI' }, + { label: 'South Carolina', value: 'SC' }, + { label: 'South Dakota', value: 'SD' }, + { label: 'Tennessee', value: 'TN' }, + { label: 'Texas', value: 'TX' }, + { label: 'Utah', value: 'UT' }, + { label: 'Vermont', value: 'VT' }, + { label: 'Virginia', value: 'VA' }, + { label: 'Washington', value: 'WA' }, + { label: 'West Virginia', value: 'WV' }, + { label: 'Wisconsin', value: 'WI' }, + { label: 'Wyoming', value: 'WY' }, +] diff --git a/src/blocks/Form/Text/index.tsx b/src/blocks/Form/Text/index.tsx new file mode 100644 index 0000000..be1e0ff --- /dev/null +++ b/src/blocks/Form/Text/index.tsx @@ -0,0 +1,32 @@ +import type { TextField } from '@payloadcms/plugin-form-builder/types' +import type { FieldErrorsImpl, FieldValues, UseFormRegister } from 'react-hook-form' + +import { Input } from '@/components/ui/input' +import { Label } from '@/components/ui/label' +import React from 'react' + +import { Error } from '../Error' +import { Width } from '../Width' + +export const Text: React.FC< + TextField & { + errors: Partial + register: UseFormRegister + } +> = ({ name, defaultValue, errors, label, register, required, width }) => { + return ( + + + + {errors[name] && } + + ) +} diff --git a/src/blocks/Form/Textarea/index.tsx b/src/blocks/Form/Textarea/index.tsx new file mode 100644 index 0000000..ecb6e21 --- /dev/null +++ b/src/blocks/Form/Textarea/index.tsx @@ -0,0 +1,40 @@ +import type { TextField } from '@payloadcms/plugin-form-builder/types' +import type { FieldErrorsImpl, FieldValues, UseFormRegister } from 'react-hook-form' + +import { Label } from '@/components/ui/label' +import { Textarea as TextAreaComponent } from '@/components/ui/textarea' +import React from 'react' + +import { Error } from '../Error' +import { Width } from '../Width' + +export const Textarea: React.FC< + TextField & { + errors: Partial + register: UseFormRegister + rows?: number + } +> = ({ name, defaultValue, errors, label, register, required, rows = 3, width }) => { + return ( + + + + + + {errors[name] && } + + ) +} diff --git a/src/blocks/Form/Width/index.tsx b/src/blocks/Form/Width/index.tsx new file mode 100644 index 0000000..bcc51a3 --- /dev/null +++ b/src/blocks/Form/Width/index.tsx @@ -0,0 +1,13 @@ +import * as React from 'react' + +export const Width: React.FC<{ + children: React.ReactNode + className?: string + width?: number | string +}> = ({ children, className, width }) => { + return ( +
+ {children} +
+ ) +} diff --git a/src/blocks/Form/config.ts b/src/blocks/Form/config.ts new file mode 100644 index 0000000..5334289 --- /dev/null +++ b/src/blocks/Form/config.ts @@ -0,0 +1,51 @@ +import type { Block } from 'payload' + +import { + FixedToolbarFeature, + HeadingFeature, + InlineToolbarFeature, + lexicalEditor, +} from '@payloadcms/richtext-lexical' + +export const FormBlock: Block = { + slug: 'formBlock', + interfaceName: 'FormBlock', + fields: [ + { + name: 'form', + type: 'relationship', + relationTo: 'forms', + required: true, + }, + { + name: 'enableIntro', + type: 'checkbox', + label: 'Enable Intro Content', + }, + { + name: 'introContent', + type: 'richText', + admin: { + condition: (_, { enableIntro }) => Boolean(enableIntro), + }, + editor: lexicalEditor({ + features: ({ rootFeatures }) => { + return [ + ...rootFeatures, + HeadingFeature({ enabledHeadingSizes: ['h1', 'h2', 'h3', 'h4'] }), + FixedToolbarFeature(), + InlineToolbarFeature(), + ] + }, + }), + label: 'Intro Content', + }, + ], + graphQL: { + singularName: 'FormBlock', + }, + labels: { + plural: 'Form Blocks', + singular: 'Form Block', + }, +} diff --git a/src/blocks/Form/fields.tsx b/src/blocks/Form/fields.tsx new file mode 100644 index 0000000..fa660f7 --- /dev/null +++ b/src/blocks/Form/fields.tsx @@ -0,0 +1,21 @@ +import { Checkbox } from './Checkbox' +import { Country } from './Country' +import { Email } from './Email' +import { Message } from './Message' +import { Number } from './Number' +import { Select } from './Select' +import { State } from './State' +import { Text } from './Text' +import { Textarea } from './Textarea' + +export const fields = { + checkbox: Checkbox, + country: Country, + email: Email, + message: Message, + number: Number, + select: Select, + state: State, + text: Text, + textarea: Textarea, +} diff --git a/src/blocks/MediaBlock/Component.tsx b/src/blocks/MediaBlock/Component.tsx new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/src/blocks/MediaBlock/Component.tsx @@ -0,0 +1 @@ + diff --git a/src/blocks/MediaBlock/config.ts b/src/blocks/MediaBlock/config.ts new file mode 100644 index 0000000..7beb79b --- /dev/null +++ b/src/blocks/MediaBlock/config.ts @@ -0,0 +1,14 @@ +import type { Block } from 'payload' + +export const MediaBlock: Block = { + slug: 'mediaBlock', + interfaceName: 'MediaBlock', + fields: [ + { + name: 'media', + type: 'upload', + relationTo: 'media', + required: true, + }, + ], +} diff --git a/src/blocks/RelatedPosts/Component.tsx b/src/blocks/RelatedPosts/Component.tsx new file mode 100644 index 0000000..0fde781 --- /dev/null +++ b/src/blocks/RelatedPosts/Component.tsx @@ -0,0 +1,32 @@ +// import clsx from 'clsx' +// import React from 'react' +// import RichText from '@/components/RichText' + +// import type { Post } from '@/payload-types' + +// import { Card } from '../../components/Card' +// import { SerializedEditorState } from '@payloadcms/richtext-lexical/lexical' + +// export type RelatedPostsProps = { +// className?: string +// docs?: Post[] +// introContent?: SerializedEditorState +// } + +// export const RelatedPosts: React.FC = (props) => { +// const { className, docs, introContent } = props + +// return ( +//
+// {introContent && } + +//
+// {docs?.map((doc, index) => { +// if (typeof doc === 'string') return null + +// return +// })} +//
+//
+// ) +// } diff --git a/src/blocks/RenderBlocks.ts b/src/blocks/RenderBlocks.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/collections/Categories.ts b/src/collections/Categories.ts new file mode 100644 index 0000000..a21b119 --- /dev/null +++ b/src/collections/Categories.ts @@ -0,0 +1,26 @@ +// import type { CollectionConfig } from 'payload' + +// import { anyone } from '../access/anyone' +// import { authenticated } from '../access/authenticated' +// import { slugField } from '@/fields/slug' + +// export const Categories: CollectionConfig = { +// slug: 'categories', +// access: { +// create: authenticated, +// delete: authenticated, +// read: anyone, +// update: authenticated, +// }, +// admin: { +// useAsTitle: 'title', +// }, +// fields: [ +// { +// name: 'title', +// type: 'text', +// required: true, +// }, +// ...slugField(), +// ], +// } diff --git a/src/collections/Pages/hooks/revalidatePage.ts b/src/collections/Pages/hooks/revalidatePage.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/collections/Pages/indext.ts b/src/collections/Pages/indext.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/collections/posts/hooks/populateAuthors.ts b/src/collections/posts/hooks/populateAuthors.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/collections/posts/hooks/revalidatePost.ts b/src/collections/posts/hooks/revalidatePost.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/collections/posts/index.ts b/src/collections/posts/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/payload.config.ts b/src/payload.config.ts index 0bc1ea5..ced4bac 100644 --- a/src/payload.config.ts +++ b/src/payload.config.ts @@ -21,6 +21,21 @@ export default buildConfig({ }, }, collections: [Users, Media], + // collections: { + // pages: Page; + // posts: Post; + // media: Media; + // categories: Category; + // users: User; + // redirects: Redirect; + // forms: Form; + // 'form-submissions': FormSubmission; + // search: Search; + // 'payload-jobs': PayloadJob; + // 'payload-locked-documents': PayloadLockedDocument; + // 'payload-preferences': PayloadPreference; + // 'payload-migrations': PayloadMigration; + // }; editor: lexicalEditor(), secret: process.env.PAYLOAD_SECRET || '', typescript: { @@ -35,3 +50,1729 @@ export default buildConfig({ // storage-adapter-placeholder ], }) + + +// /* tslint:disable */ +// /* eslint-disable */ +// /** +// * This file was automatically generated by Payload. +// * DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config, +// * and re-run `payload generate:types` to regenerate this file. +// */ + +// /** +// * Supported timezones in IANA format. +// * +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "supportedTimezones". +// */ + + + + + +// export type SupportedTimezones = +// | 'Pacific/Midway' +// | 'Pacific/Niue' +// | 'Pacific/Honolulu' +// | 'Pacific/Rarotonga' +// | 'America/Anchorage' +// | 'Pacific/Gambier' +// | 'America/Los_Angeles' +// | 'America/Tijuana' +// | 'America/Denver' +// | 'America/Phoenix' +// | 'America/Chicago' +// | 'America/Guatemala' +// | 'America/New_York' +// | 'America/Bogota' +// | 'America/Caracas' +// | 'America/Santiago' +// | 'America/Buenos_Aires' +// | 'America/Sao_Paulo' +// | 'Atlantic/South_Georgia' +// | 'Atlantic/Azores' +// | 'Atlantic/Cape_Verde' +// | 'Europe/London' +// | 'Europe/Berlin' +// | 'Africa/Lagos' +// | 'Europe/Athens' +// | 'Africa/Cairo' +// | 'Europe/Moscow' +// | 'Asia/Riyadh' +// | 'Asia/Dubai' +// | 'Asia/Baku' +// | 'Asia/Karachi' +// | 'Asia/Tashkent' +// | 'Asia/Calcutta' +// | 'Asia/Dhaka' +// | 'Asia/Almaty' +// | 'Asia/Jakarta' +// | 'Asia/Bangkok' +// | 'Asia/Shanghai' +// | 'Asia/Singapore' +// | 'Asia/Tokyo' +// | 'Asia/Seoul' +// | 'Australia/Brisbane' +// | 'Australia/Sydney' +// | 'Pacific/Guam' +// | 'Pacific/Noumea' +// | 'Pacific/Auckland' +// | 'Pacific/Fiji'; + +// export interface Config { +// auth: { +// users: UserAuthOperations; +// }; +// blocks: {}; +// collections: { +// pages: Page; +// posts: Post; +// media: Media; +// categories: Category; +// users: User; +// redirects: Redirect; +// forms: Form; +// 'form-submissions': FormSubmission; +// search: Search; +// 'payload-jobs': PayloadJob; +// 'payload-locked-documents': PayloadLockedDocument; +// 'payload-preferences': PayloadPreference; +// 'payload-migrations': PayloadMigration; +// }; +// collectionsJoins: {}; +// collectionsSelect: { +// pages: PagesSelect | PagesSelect; +// posts: PostsSelect | PostsSelect; +// media: MediaSelect | MediaSelect; +// categories: CategoriesSelect | CategoriesSelect; +// users: UsersSelect | UsersSelect; +// redirects: RedirectsSelect | RedirectsSelect; +// forms: FormsSelect | FormsSelect; +// 'form-submissions': FormSubmissionsSelect | FormSubmissionsSelect; +// search: SearchSelect | SearchSelect; +// 'payload-jobs': PayloadJobsSelect | PayloadJobsSelect; +// 'payload-locked-documents': PayloadLockedDocumentsSelect | PayloadLockedDocumentsSelect; +// 'payload-preferences': PayloadPreferencesSelect | PayloadPreferencesSelect; +// 'payload-migrations': PayloadMigrationsSelect | PayloadMigrationsSelect; +// }; +// db: { +// defaultIDType: string; +// }; +// globals: { +// header: Header; +// footer: Footer; +// }; +// globalsSelect: { +// header: HeaderSelect | HeaderSelect; +// footer: FooterSelect | FooterSelect; +// }; +// locale: null; +// user: User & { +// collection: 'users'; +// }; +// jobs: { +// tasks: { +// schedulePublish: TaskSchedulePublish; +// inline: { +// input: unknown; +// output: unknown; +// }; +// }; +// workflows: unknown; +// }; +// } +// export interface UserAuthOperations { +// forgotPassword: { +// email: string; +// password: string; +// }; +// login: { +// email: string; +// password: string; +// }; +// registerFirstUser: { +// email: string; +// password: string; +// }; +// unlock: { +// email: string; +// password: string; +// }; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "pages". +// */ +// export interface Page { +// id: string; +// title: string; +// hero: { +// type: 'none' | 'highImpact' | 'mediumImpact' | 'lowImpact'; +// richText?: { +// root: { +// type: string; +// children: { +// type: string; +// version: number; +// [k: string]: unknown; +// }[]; +// direction: ('ltr' | 'rtl') | null; +// format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; +// indent: number; +// version: number; +// }; +// [k: string]: unknown; +// } | null; +// form?: { +// submitLabel?: string | null; +// fields?: +// | { +// label: string; +// type: 'text' | 'email' | 'select'; +// options?: +// | { +// label: string; +// value: string; +// id?: string | null; +// }[] +// | null; +// required?: boolean | null; +// id?: string | null; +// }[] +// | null; +// }; +// media?: (string | null) | Media; +// }; +// layout: (CallToActionBlock | ContentBlock | MediaBlock | ArchiveBlock | FormBlock)[]; +// meta?: { +// title?: string | null; +// /** +// * Maximum upload file size: 12MB. Recommended file size for images is <500KB. +// */ +// image?: (string | null) | Media; +// description?: string | null; +// }; +// publishedAt?: string | null; +// slug?: string | null; +// slugLock?: boolean | null; +// updatedAt: string; +// createdAt: string; +// _status?: ('draft' | 'published') | null; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "media". +// */ +// export interface Media { +// id: string; +// alt?: string | null; +// caption?: { +// root: { +// type: string; +// children: { +// type: string; +// version: number; +// [k: string]: unknown; +// }[]; +// direction: ('ltr' | 'rtl') | null; +// format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; +// indent: number; +// version: number; +// }; +// [k: string]: unknown; +// } | null; +// updatedAt: string; +// createdAt: string; +// url?: string | null; +// thumbnailURL?: string | null; +// filename?: string | null; +// mimeType?: string | null; +// filesize?: number | null; +// width?: number | null; +// height?: number | null; +// focalX?: number | null; +// focalY?: number | null; +// sizes?: { +// thumbnail?: { +// url?: string | null; +// width?: number | null; +// height?: number | null; +// mimeType?: string | null; +// filesize?: number | null; +// filename?: string | null; +// }; +// square?: { +// url?: string | null; +// width?: number | null; +// height?: number | null; +// mimeType?: string | null; +// filesize?: number | null; +// filename?: string | null; +// }; +// small?: { +// url?: string | null; +// width?: number | null; +// height?: number | null; +// mimeType?: string | null; +// filesize?: number | null; +// filename?: string | null; +// }; +// medium?: { +// url?: string | null; +// width?: number | null; +// height?: number | null; +// mimeType?: string | null; +// filesize?: number | null; +// filename?: string | null; +// }; +// large?: { +// url?: string | null; +// width?: number | null; +// height?: number | null; +// mimeType?: string | null; +// filesize?: number | null; +// filename?: string | null; +// }; +// xlarge?: { +// url?: string | null; +// width?: number | null; +// height?: number | null; +// mimeType?: string | null; +// filesize?: number | null; +// filename?: string | null; +// }; +// og?: { +// url?: string | null; +// width?: number | null; +// height?: number | null; +// mimeType?: string | null; +// filesize?: number | null; +// filename?: string | null; +// }; +// }; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "CallToActionBlock". +// */ +// export interface CallToActionBlock { +// richText?: { +// root: { +// type: string; +// children: { +// type: string; +// version: number; +// [k: string]: unknown; +// }[]; +// direction: ('ltr' | 'rtl') | null; +// format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; +// indent: number; +// version: number; +// }; +// [k: string]: unknown; +// } | null; +// links?: +// | { +// link: { +// type?: ('reference' | 'custom') | null; +// newTab?: boolean | null; +// reference?: +// | ({ +// relationTo: 'pages'; +// value: string | Page; +// } | null) +// | ({ +// relationTo: 'posts'; +// value: string | Post; +// } | null); +// url?: string | null; +// label: string; +// /** +// * Choose how the link should be rendered. +// */ +// appearance?: ('default' | 'outline') | null; +// }; +// id?: string | null; +// }[] +// | null; +// id?: string | null; +// blockName?: string | null; +// blockType: 'cta'; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "posts". +// */ +// export interface Post { +// id: string; +// title: string; +// heroImage?: (string | null) | Media; +// content: { +// root: { +// type: string; +// children: { +// type: string; +// version: number; +// [k: string]: unknown; +// }[]; +// direction: ('ltr' | 'rtl') | null; +// format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; +// indent: number; +// version: number; +// }; +// [k: string]: unknown; +// }; +// relatedPosts?: (string | Post)[] | null; +// categories?: (string | Category)[] | null; +// meta?: { +// title?: string | null; +// /** +// * Maximum upload file size: 12MB. Recommended file size for images is <500KB. +// */ +// image?: (string | null) | Media; +// description?: string | null; +// }; +// publishedAt?: string | null; +// authors?: (string | User)[] | null; +// populatedAuthors?: +// | { +// id?: string | null; +// name?: string | null; +// }[] +// | null; +// slug?: string | null; +// slugLock?: boolean | null; +// updatedAt: string; +// createdAt: string; +// _status?: ('draft' | 'published') | null; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "categories". +// */ +// export interface Category { +// id: string; +// title: string; +// slug?: string | null; +// slugLock?: boolean | null; +// parent?: (string | null) | Category; +// breadcrumbs?: +// | { +// doc?: (string | null) | Category; +// url?: string | null; +// label?: string | null; +// id?: string | null; +// }[] +// | null; +// updatedAt: string; +// createdAt: string; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "users". +// */ +// export interface User { +// id: string; +// name?: string | null; +// updatedAt: string; +// createdAt: string; +// email: string; +// resetPasswordToken?: string | null; +// resetPasswordExpiration?: string | null; +// salt?: string | null; +// hash?: string | null; +// loginAttempts?: number | null; +// lockUntil?: string | null; +// sessions?: +// | { +// id: string; +// createdAt?: string | null; +// expiresAt: string; +// }[] +// | null; +// password?: string | null; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "ContentBlock". +// */ +// export interface ContentBlock { +// image: string | Media; +// date: string; +// name: string; +// heading: string; +// highlightText: string; +// richText?: { +// root: { +// type: string; +// children: { +// type: string; +// version: number; +// [k: string]: unknown; +// }[]; +// direction: ('ltr' | 'rtl') | null; +// format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; +// indent: number; +// version: number; +// }; +// [k: string]: unknown; +// } | null; +// enableButton?: boolean | null; +// link?: { +// type?: ('reference' | 'custom') | null; +// newTab?: boolean | null; +// reference?: +// | ({ +// relationTo: 'pages'; +// value: string | Page; +// } | null) +// | ({ +// relationTo: 'posts'; +// value: string | Post; +// } | null); +// url?: string | null; +// label: string; +// /** +// * Choose how the link should be rendered. +// */ +// appearance?: ('default' | 'outline') | null; +// }; +// id?: string | null; +// blockName?: string | null; +// blockType: 'content'; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "MediaBlock". +// */ +// export interface MediaBlock { +// media: string | Media; +// id?: string | null; +// blockName?: string | null; +// blockType: 'mediaBlock'; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "ArchiveBlock". +// */ +// export interface ArchiveBlock { +// introContent?: { +// root: { +// type: string; +// children: { +// type: string; +// version: number; +// [k: string]: unknown; +// }[]; +// direction: ('ltr' | 'rtl') | null; +// format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; +// indent: number; +// version: number; +// }; +// [k: string]: unknown; +// } | null; +// populateBy?: ('collection' | 'selection') | null; +// relationTo?: 'posts' | null; +// categories?: (string | Category)[] | null; +// limit?: number | null; +// selectedDocs?: +// | { +// relationTo: 'posts'; +// value: string | Post; +// }[] +// | null; +// id?: string | null; +// blockName?: string | null; +// blockType: 'archive'; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "FormBlock". +// */ +// export interface FormBlock { +// form: string | Form; +// enableIntro?: boolean | null; +// introContent?: { +// root: { +// type: string; +// children: { +// type: string; +// version: number; +// [k: string]: unknown; +// }[]; +// direction: ('ltr' | 'rtl') | null; +// format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; +// indent: number; +// version: number; +// }; +// [k: string]: unknown; +// } | null; +// id?: string | null; +// blockName?: string | null; +// blockType: 'formBlock'; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "forms". +// */ +// export interface Form { +// id: string; +// title: string; +// fields?: +// | ( +// | { +// name: string; +// label?: string | null; +// width?: number | null; +// required?: boolean | null; +// defaultValue?: boolean | null; +// id?: string | null; +// blockName?: string | null; +// blockType: 'checkbox'; +// } +// | { +// name: string; +// label?: string | null; +// width?: number | null; +// required?: boolean | null; +// id?: string | null; +// blockName?: string | null; +// blockType: 'country'; +// } +// | { +// name: string; +// label?: string | null; +// width?: number | null; +// required?: boolean | null; +// id?: string | null; +// blockName?: string | null; +// blockType: 'email'; +// } +// | { +// message?: { +// root: { +// type: string; +// children: { +// type: string; +// version: number; +// [k: string]: unknown; +// }[]; +// direction: ('ltr' | 'rtl') | null; +// format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; +// indent: number; +// version: number; +// }; +// [k: string]: unknown; +// } | null; +// id?: string | null; +// blockName?: string | null; +// blockType: 'message'; +// } +// | { +// name: string; +// label?: string | null; +// width?: number | null; +// defaultValue?: number | null; +// required?: boolean | null; +// id?: string | null; +// blockName?: string | null; +// blockType: 'number'; +// } +// | { +// name: string; +// label?: string | null; +// width?: number | null; +// defaultValue?: string | null; +// placeholder?: string | null; +// options?: +// | { +// label: string; +// value: string; +// id?: string | null; +// }[] +// | null; +// required?: boolean | null; +// id?: string | null; +// blockName?: string | null; +// blockType: 'select'; +// } +// | { +// name: string; +// label?: string | null; +// width?: number | null; +// required?: boolean | null; +// id?: string | null; +// blockName?: string | null; +// blockType: 'state'; +// } +// | { +// name: string; +// label?: string | null; +// width?: number | null; +// defaultValue?: string | null; +// required?: boolean | null; +// id?: string | null; +// blockName?: string | null; +// blockType: 'text'; +// } +// | { +// name: string; +// label?: string | null; +// width?: number | null; +// defaultValue?: string | null; +// required?: boolean | null; +// id?: string | null; +// blockName?: string | null; +// blockType: 'textarea'; +// } +// )[] +// | null; +// submitButtonLabel?: string | null; +// /** +// * Choose whether to display an on-page message or redirect to a different page after they submit the form. +// */ +// confirmationType?: ('message' | 'redirect') | null; +// confirmationMessage?: { +// root: { +// type: string; +// children: { +// type: string; +// version: number; +// [k: string]: unknown; +// }[]; +// direction: ('ltr' | 'rtl') | null; +// format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; +// indent: number; +// version: number; +// }; +// [k: string]: unknown; +// } | null; +// redirect?: { +// url: string; +// }; +// /** +// * Send custom emails when the form submits. Use comma separated lists to send the same email to multiple recipients. To reference a value from this form, wrap that field's name with double curly brackets, i.e. {{firstName}}. You can use a wildcard {{*}} to output all data and {{*:table}} to format it as an HTML table in the email. +// */ +// emails?: +// | { +// emailTo?: string | null; +// cc?: string | null; +// bcc?: string | null; +// replyTo?: string | null; +// emailFrom?: string | null; +// subject: string; +// /** +// * Enter the message that should be sent in this email. +// */ +// message?: { +// root: { +// type: string; +// children: { +// type: string; +// version: number; +// [k: string]: unknown; +// }[]; +// direction: ('ltr' | 'rtl') | null; +// format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; +// indent: number; +// version: number; +// }; +// [k: string]: unknown; +// } | null; +// id?: string | null; +// }[] +// | null; +// updatedAt: string; +// createdAt: string; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "redirects". +// */ +// export interface Redirect { +// id: string; +// /** +// * You will need to rebuild the website when changing this field. +// */ +// from: string; +// to?: { +// type?: ('reference' | 'custom') | null; +// reference?: +// | ({ +// relationTo: 'pages'; +// value: string | Page; +// } | null) +// | ({ +// relationTo: 'posts'; +// value: string | Post; +// } | null); +// url?: string | null; +// }; +// updatedAt: string; +// createdAt: string; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "form-submissions". +// */ +// export interface FormSubmission { +// id: string; +// form: string | Form; +// submissionData?: +// | { +// field: string; +// value: string; +// id?: string | null; +// }[] +// | null; +// updatedAt: string; +// createdAt: string; +// } +// /** +// * This is a collection of automatically created search results. These results are used by the global site search and will be updated automatically as documents in the CMS are created or updated. +// * +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "search". +// */ +// export interface Search { +// id: string; +// title?: string | null; +// priority?: number | null; +// doc: { +// relationTo: 'posts'; +// value: string | Post; +// }; +// slug?: string | null; +// meta?: { +// title?: string | null; +// description?: string | null; +// image?: (string | null) | Media; +// }; +// categories?: +// | { +// relationTo?: string | null; +// categoryID?: string | null; +// title?: string | null; +// id?: string | null; +// }[] +// | null; +// updatedAt: string; +// createdAt: string; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "payload-jobs". +// */ +// export interface PayloadJob { +// id: string; +// /** +// * Input data provided to the job +// */ +// input?: +// | { +// [k: string]: unknown; +// } +// | unknown[] +// | string +// | number +// | boolean +// | null; +// taskStatus?: +// | { +// [k: string]: unknown; +// } +// | unknown[] +// | string +// | number +// | boolean +// | null; +// completedAt?: string | null; +// totalTried?: number | null; +// /** +// * If hasError is true this job will not be retried +// */ +// hasError?: boolean | null; +// /** +// * If hasError is true, this is the error that caused it +// */ +// error?: +// | { +// [k: string]: unknown; +// } +// | unknown[] +// | string +// | number +// | boolean +// | null; +// /** +// * Task execution log +// */ +// log?: +// | { +// executedAt: string; +// completedAt: string; +// taskSlug: 'inline' | 'schedulePublish'; +// taskID: string; +// input?: +// | { +// [k: string]: unknown; +// } +// | unknown[] +// | string +// | number +// | boolean +// | null; +// output?: +// | { +// [k: string]: unknown; +// } +// | unknown[] +// | string +// | number +// | boolean +// | null; +// state: 'failed' | 'succeeded'; +// error?: +// | { +// [k: string]: unknown; +// } +// | unknown[] +// | string +// | number +// | boolean +// | null; +// id?: string | null; +// }[] +// | null; +// taskSlug?: ('inline' | 'schedulePublish') | null; +// queue?: string | null; +// waitUntil?: string | null; +// processing?: boolean | null; +// updatedAt: string; +// createdAt: string; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "payload-locked-documents". +// */ +// export interface PayloadLockedDocument { +// id: string; +// document?: +// | ({ +// relationTo: 'pages'; +// value: string | Page; +// } | null) +// | ({ +// relationTo: 'posts'; +// value: string | Post; +// } | null) +// | ({ +// relationTo: 'media'; +// value: string | Media; +// } | null) +// | ({ +// relationTo: 'categories'; +// value: string | Category; +// } | null) +// | ({ +// relationTo: 'users'; +// value: string | User; +// } | null) +// | ({ +// relationTo: 'redirects'; +// value: string | Redirect; +// } | null) +// | ({ +// relationTo: 'forms'; +// value: string | Form; +// } | null) +// | ({ +// relationTo: 'form-submissions'; +// value: string | FormSubmission; +// } | null) +// | ({ +// relationTo: 'search'; +// value: string | Search; +// } | null) +// | ({ +// relationTo: 'payload-jobs'; +// value: string | PayloadJob; +// } | null); +// globalSlug?: string | null; +// user: { +// relationTo: 'users'; +// value: string | User; +// }; +// updatedAt: string; +// createdAt: string; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "payload-preferences". +// */ +// export interface PayloadPreference { +// id: string; +// user: { +// relationTo: 'users'; +// value: string | User; +// }; +// key?: string | null; +// value?: +// | { +// [k: string]: unknown; +// } +// | unknown[] +// | string +// | number +// | boolean +// | null; +// updatedAt: string; +// createdAt: string; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "payload-migrations". +// */ +// export interface PayloadMigration { +// id: string; +// name?: string | null; +// batch?: number | null; +// updatedAt: string; +// createdAt: string; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "pages_select". +// */ +// export interface PagesSelect { +// title?: T; +// hero?: +// | T +// | { +// type?: T; +// richText?: T; +// form?: +// | T +// | { +// submitLabel?: T; +// fields?: +// | T +// | { +// label?: T; +// type?: T; +// options?: +// | T +// | { +// label?: T; +// value?: T; +// id?: T; +// }; +// required?: T; +// id?: T; +// }; +// }; +// media?: T; +// }; +// layout?: +// | T +// | { +// cta?: T | CallToActionBlockSelect; +// content?: T | ContentBlockSelect; +// mediaBlock?: T | MediaBlockSelect; +// archive?: T | ArchiveBlockSelect; +// formBlock?: T | FormBlockSelect; +// }; +// meta?: +// | T +// | { +// title?: T; +// image?: T; +// description?: T; +// }; +// publishedAt?: T; +// slug?: T; +// slugLock?: T; +// updatedAt?: T; +// createdAt?: T; +// _status?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "CallToActionBlock_select". +// */ +// export interface CallToActionBlockSelect { +// richText?: T; +// links?: +// | T +// | { +// link?: +// | T +// | { +// type?: T; +// newTab?: T; +// reference?: T; +// url?: T; +// label?: T; +// appearance?: T; +// }; +// id?: T; +// }; +// id?: T; +// blockName?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "ContentBlock_select". +// */ +// export interface ContentBlockSelect { +// image?: T; +// date?: T; +// name?: T; +// heading?: T; +// highlightText?: T; +// richText?: T; +// enableButton?: T; +// link?: +// | T +// | { +// type?: T; +// newTab?: T; +// reference?: T; +// url?: T; +// label?: T; +// appearance?: T; +// }; +// id?: T; +// blockName?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "MediaBlock_select". +// */ +// export interface MediaBlockSelect { +// media?: T; +// id?: T; +// blockName?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "ArchiveBlock_select". +// */ +// export interface ArchiveBlockSelect { +// introContent?: T; +// populateBy?: T; +// relationTo?: T; +// categories?: T; +// limit?: T; +// selectedDocs?: T; +// id?: T; +// blockName?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "FormBlock_select". +// */ +// export interface FormBlockSelect { +// form?: T; +// enableIntro?: T; +// introContent?: T; +// id?: T; +// blockName?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "posts_select". +// */ +// export interface PostsSelect { +// title?: T; +// heroImage?: T; +// content?: T; +// relatedPosts?: T; +// categories?: T; +// meta?: +// | T +// | { +// title?: T; +// image?: T; +// description?: T; +// }; +// publishedAt?: T; +// authors?: T; +// populatedAuthors?: +// | T +// | { +// id?: T; +// name?: T; +// }; +// slug?: T; +// slugLock?: T; +// updatedAt?: T; +// createdAt?: T; +// _status?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "media_select". +// */ +// export interface MediaSelect { +// alt?: T; +// caption?: T; +// updatedAt?: T; +// createdAt?: T; +// url?: T; +// thumbnailURL?: T; +// filename?: T; +// mimeType?: T; +// filesize?: T; +// width?: T; +// height?: T; +// focalX?: T; +// focalY?: T; +// sizes?: +// | T +// | { +// thumbnail?: +// | T +// | { +// url?: T; +// width?: T; +// height?: T; +// mimeType?: T; +// filesize?: T; +// filename?: T; +// }; +// square?: +// | T +// | { +// url?: T; +// width?: T; +// height?: T; +// mimeType?: T; +// filesize?: T; +// filename?: T; +// }; +// small?: +// | T +// | { +// url?: T; +// width?: T; +// height?: T; +// mimeType?: T; +// filesize?: T; +// filename?: T; +// }; +// medium?: +// | T +// | { +// url?: T; +// width?: T; +// height?: T; +// mimeType?: T; +// filesize?: T; +// filename?: T; +// }; +// large?: +// | T +// | { +// url?: T; +// width?: T; +// height?: T; +// mimeType?: T; +// filesize?: T; +// filename?: T; +// }; +// xlarge?: +// | T +// | { +// url?: T; +// width?: T; +// height?: T; +// mimeType?: T; +// filesize?: T; +// filename?: T; +// }; +// og?: +// | T +// | { +// url?: T; +// width?: T; +// height?: T; +// mimeType?: T; +// filesize?: T; +// filename?: T; +// }; +// }; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "categories_select". +// */ +// export interface CategoriesSelect { +// title?: T; +// slug?: T; +// slugLock?: T; +// parent?: T; +// breadcrumbs?: +// | T +// | { +// doc?: T; +// url?: T; +// label?: T; +// id?: T; +// }; +// updatedAt?: T; +// createdAt?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "users_select". +// */ +// export interface UsersSelect { +// name?: T; +// updatedAt?: T; +// createdAt?: T; +// email?: T; +// resetPasswordToken?: T; +// resetPasswordExpiration?: T; +// salt?: T; +// hash?: T; +// loginAttempts?: T; +// lockUntil?: T; +// sessions?: +// | T +// | { +// id?: T; +// createdAt?: T; +// expiresAt?: T; +// }; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "redirects_select". +// */ +// export interface RedirectsSelect { +// from?: T; +// to?: +// | T +// | { +// type?: T; +// reference?: T; +// url?: T; +// }; +// updatedAt?: T; +// createdAt?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "forms_select". +// */ +// export interface FormsSelect { +// title?: T; +// fields?: +// | T +// | { +// checkbox?: +// | T +// | { +// name?: T; +// label?: T; +// width?: T; +// required?: T; +// defaultValue?: T; +// id?: T; +// blockName?: T; +// }; +// country?: +// | T +// | { +// name?: T; +// label?: T; +// width?: T; +// required?: T; +// id?: T; +// blockName?: T; +// }; +// email?: +// | T +// | { +// name?: T; +// label?: T; +// width?: T; +// required?: T; +// id?: T; +// blockName?: T; +// }; +// message?: +// | T +// | { +// message?: T; +// id?: T; +// blockName?: T; +// }; +// number?: +// | T +// | { +// name?: T; +// label?: T; +// width?: T; +// defaultValue?: T; +// required?: T; +// id?: T; +// blockName?: T; +// }; +// select?: +// | T +// | { +// name?: T; +// label?: T; +// width?: T; +// defaultValue?: T; +// placeholder?: T; +// options?: +// | T +// | { +// label?: T; +// value?: T; +// id?: T; +// }; +// required?: T; +// id?: T; +// blockName?: T; +// }; +// state?: +// | T +// | { +// name?: T; +// label?: T; +// width?: T; +// required?: T; +// id?: T; +// blockName?: T; +// }; +// text?: +// | T +// | { +// name?: T; +// label?: T; +// width?: T; +// defaultValue?: T; +// required?: T; +// id?: T; +// blockName?: T; +// }; +// textarea?: +// | T +// | { +// name?: T; +// label?: T; +// width?: T; +// defaultValue?: T; +// required?: T; +// id?: T; +// blockName?: T; +// }; +// }; +// submitButtonLabel?: T; +// confirmationType?: T; +// confirmationMessage?: T; +// redirect?: +// | T +// | { +// url?: T; +// }; +// emails?: +// | T +// | { +// emailTo?: T; +// cc?: T; +// bcc?: T; +// replyTo?: T; +// emailFrom?: T; +// subject?: T; +// message?: T; +// id?: T; +// }; +// updatedAt?: T; +// createdAt?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "form-submissions_select". +// */ +// export interface FormSubmissionsSelect { +// form?: T; +// submissionData?: +// | T +// | { +// field?: T; +// value?: T; +// id?: T; +// }; +// updatedAt?: T; +// createdAt?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "search_select". +// */ +// export interface SearchSelect { +// title?: T; +// priority?: T; +// doc?: T; +// slug?: T; +// meta?: +// | T +// | { +// title?: T; +// description?: T; +// image?: T; +// }; +// categories?: +// | T +// | { +// relationTo?: T; +// categoryID?: T; +// title?: T; +// id?: T; +// }; +// updatedAt?: T; +// createdAt?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "payload-jobs_select". +// */ +// export interface PayloadJobsSelect { +// input?: T; +// taskStatus?: T; +// completedAt?: T; +// totalTried?: T; +// hasError?: T; +// error?: T; +// log?: +// | T +// | { +// executedAt?: T; +// completedAt?: T; +// taskSlug?: T; +// taskID?: T; +// input?: T; +// output?: T; +// state?: T; +// error?: T; +// id?: T; +// }; +// taskSlug?: T; +// queue?: T; +// waitUntil?: T; +// processing?: T; +// updatedAt?: T; +// createdAt?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "payload-locked-documents_select". +// */ +// export interface PayloadLockedDocumentsSelect { +// document?: T; +// globalSlug?: T; +// user?: T; +// updatedAt?: T; +// createdAt?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "payload-preferences_select". +// */ +// export interface PayloadPreferencesSelect { +// user?: T; +// key?: T; +// value?: T; +// updatedAt?: T; +// createdAt?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "payload-migrations_select". +// */ +// export interface PayloadMigrationsSelect { +// name?: T; +// batch?: T; +// updatedAt?: T; +// createdAt?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "header". +// */ +// export interface Header { +// id: string; +// navItems?: +// | { +// link: { +// type?: ('reference' | 'custom') | null; +// newTab?: boolean | null; +// reference?: +// | ({ +// relationTo: 'pages'; +// value: string | Page; +// } | null) +// | ({ +// relationTo: 'posts'; +// value: string | Post; +// } | null); +// url?: string | null; +// label: string; +// }; +// id?: string | null; +// }[] +// | null; +// updatedAt?: string | null; +// createdAt?: string | null; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "footer". +// */ +// export interface Footer { +// id: string; +// navItems?: +// | { +// link: { +// type?: ('reference' | 'custom') | null; +// newTab?: boolean | null; +// reference?: +// | ({ +// relationTo: 'pages'; +// value: string | Page; +// } | null) +// | ({ +// relationTo: 'posts'; +// value: string | Post; +// } | null); +// url?: string | null; +// label: string; +// }; +// id?: string | null; +// }[] +// | null; +// updatedAt?: string | null; +// createdAt?: string | null; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "header_select". +// */ +// export interface HeaderSelect { +// navItems?: +// | T +// | { +// link?: +// | T +// | { +// type?: T; +// newTab?: T; +// reference?: T; +// url?: T; +// label?: T; +// }; +// id?: T; +// }; +// updatedAt?: T; +// createdAt?: T; +// globalType?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "footer_select". +// */ +// export interface FooterSelect { +// navItems?: +// | T +// | { +// link?: +// | T +// | { +// type?: T; +// newTab?: T; +// reference?: T; +// url?: T; +// label?: T; +// }; +// id?: T; +// }; +// updatedAt?: T; +// createdAt?: T; +// globalType?: T; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "TaskSchedulePublish". +// */ +// export interface TaskSchedulePublish { +// input: { +// type?: ('publish' | 'unpublish') | null; +// locale?: string | null; +// doc?: +// | ({ +// relationTo: 'pages'; +// value: string | Page; +// } | null) +// | ({ +// relationTo: 'posts'; +// value: string | Post; +// } | null); +// global?: string | null; +// user?: (string | null) | User; +// }; +// output?: unknown; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "BannerBlock". +// */ +// export interface BannerBlock { +// style: 'info' | 'warning' | 'error' | 'success'; +// content: { +// root: { +// type: string; +// children: { +// type: string; +// version: number; +// [k: string]: unknown; +// }[]; +// direction: ('ltr' | 'rtl') | null; +// format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; +// indent: number; +// version: number; +// }; +// [k: string]: unknown; +// }; +// id?: string | null; +// blockName?: string | null; +// blockType: 'banner'; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "CodeBlock". +// */ +// export interface CodeBlock { +// language?: ('typescript' | 'javascript' | 'css') | null; +// code: string; +// id?: string | null; +// blockName?: string | null; +// blockType: 'code'; +// } +// /** +// * This interface was referenced by `Config`'s JSON-Schema +// * via the `definition` "auth". +// */ +// export interface Auth { +// [k: string]: unknown; +// } + + +// declare module 'payload' { +// export interface GeneratedTypes extends Config {} +// } \ No newline at end of file -- 2.49.0