This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import config from '@payload-config' | |
| import { draftMode } from 'next/headers' | |
| import { getPayload as getPayloadFn, type CollectionSlug } from 'payload' | |
| declare module 'payload' { | |
| interface BasePayload { | |
| draftModifications?: boolean | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { env } from '@env' | |
| import { jwtVerify } from 'jose' | |
| import { NextRequest, NextResponse } from 'next/server' | |
| export async function middleware(request: NextRequest) { | |
| const { pathname } = request.nextUrl | |
| // Skip middleware for static files and assets | |
| if (isStaticFile(pathname)) { | |
| return NextResponse.next() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| traverseFields, | |
| type CollectionConfig, | |
| type CollectionSlug, | |
| type GlobalConfig, | |
| type GlobalSlug, | |
| type Plugin, | |
| type TraverseFieldsCallback, | |
| type Validate, | |
| } from 'payload' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| traverseFields, | |
| type CollectionConfig, | |
| type GlobalConfig, | |
| type Plugin, | |
| type RichTextField, | |
| type TraverseFieldsCallback, | |
| } from 'payload' | |
| import { richText } from 'payload/shared' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { CollectionConfig } from 'payload' | |
| import type { SelectHeadingFromRichTextFieldProps } from '../components/SelectHeadingFromRichTextField' | |
| export const Articles: CollectionConfig = { | |
| slug: 'articles', | |
| fields: [ | |
| { | |
| type: 'array', | |
| name: 'tableOfContents', | |
| labels: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { resolveRelationships } from './resolveRelationships' | |
| export default buildConfig({ | |
| typescript: { | |
| schema: [resolveRelationships], | |
| }, | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { | |
| CollectionBeforeOperationHook, | |
| FileData, | |
| Plugin, | |
| UploadCollectionSlug, | |
| } from 'payload' | |
| type AspectRatios = Record<string, number> | |
| type Collections = Partial<Record<UploadCollectionSlug, AspectRatios>> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Add the "Collapse by default" checkbox to the repeater field settings | |
| add_action('acf/render_field_settings', 'add_collapse_setting_to_repeater_field', 10, 1); | |
| function add_collapse_setting_to_repeater_field($field) { | |
| if ($field['type'] == 'repeater') { | |
| acf_render_field_setting($field, array( | |
| 'label' => __('Collapse by default', 'text-domain'), | |
| 'instructions' => __('Collapse all rows by default when editing.', 'text-domain'), | |
| 'type' => 'true_false', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { FC } from 'react' | |
| import { Form, FormSubmit, Gutter, RenderFields } from '@payloadcms/ui' | |
| import { mapFields } from '@payloadcms/ui/utilities/buildComponentMap' | |
| import { AdminViewProps, Field, WithServerSidePropsComponentProps } from 'payload' | |
| import { WithServerSideProps as WithServerSidePropsGeneric } from '@payloadcms/ui/shared' | |
| import { DefaultTemplate } from '@payloadcms/next/templates' | |
| import { buildStateFromSchema } from '@payloadcms/ui/forms/buildStateFromSchema' | |
| type WithServerSidePropsPrePopulated = React.FC< | |
| Omit<WithServerSidePropsComponentProps, 'serverOnlyProps'> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { FC, Fragment } from 'react' | |
| import { | |
| Form, | |
| FormSubmit, | |
| Gutter, | |
| HydrateClientUser, | |
| RenderFields, | |
| SetStepNav, | |
| SetViewActions, | |
| } from '@payloadcms/ui' |
NewerOlder