chore: more reference and export fixes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { FilterOptions } from 'payload/dist/fields/config/types'
|
||||
import type { FilterOptions } from 'payload/types'
|
||||
|
||||
export const parentFilterOptions: (breadcrumbsFieldSlug?: string) => FilterOptions =
|
||||
(breadcrumbsFieldSlug = 'breadcrumbs') =>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Plugin } from 'payload/config'
|
||||
import type { SingleRelationshipField } from 'payload/dist/fields/config/types'
|
||||
import type { SingleRelationshipField } from 'payload/types'
|
||||
|
||||
import type { PluginConfig } from './types'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Config } from 'payload/config'
|
||||
import type { Field, GroupField, TabsField } from 'payload/dist/fields/config/types'
|
||||
import type { Field, GroupField, TabsField } from 'payload/types'
|
||||
|
||||
import { deepMerge } from 'payload/utilities'
|
||||
|
||||
@@ -30,7 +30,6 @@ const seo =
|
||||
},
|
||||
label: 'Overview',
|
||||
},
|
||||
// @ts-expect-error
|
||||
{
|
||||
name: 'title',
|
||||
type: 'text',
|
||||
|
||||
@@ -1,40 +1,41 @@
|
||||
import type { ContextType } from 'payload/dist/admin/components/utilities/DocumentInfo/types'
|
||||
import type { Field, TextareaField, TextField, UploadField } from 'payload/dist/fields/config/types'
|
||||
import type { Field, TextField, TextareaField, UploadField } from 'payload/types'
|
||||
|
||||
import type { DocumentInfoContext } from '../../ui/src/providers/DocumentInfo/types'
|
||||
|
||||
export type GenerateTitle = <T = any>(
|
||||
args: ContextType & { doc: T; locale?: string },
|
||||
args: DocumentInfoContext & { doc: T; locale?: string },
|
||||
) => Promise<string> | string
|
||||
|
||||
export type GenerateDescription = <T = any>(
|
||||
args: ContextType & {
|
||||
args: DocumentInfoContext & {
|
||||
doc: T
|
||||
locale?: string
|
||||
},
|
||||
) => Promise<string> | string
|
||||
|
||||
export type GenerateImage = <T = any>(
|
||||
args: ContextType & { doc: T; locale?: string },
|
||||
args: DocumentInfoContext & { doc: T; locale?: string },
|
||||
) => Promise<string> | string
|
||||
|
||||
export type GenerateURL = <T = any>(
|
||||
args: ContextType & { doc: T; locale?: string },
|
||||
args: DocumentInfoContext & { doc: T; locale?: string },
|
||||
) => Promise<string> | string
|
||||
|
||||
export interface PluginConfig {
|
||||
collections?: string[]
|
||||
fieldOverrides?: {
|
||||
description?: Partial<TextareaField>
|
||||
image?: Partial<UploadField>
|
||||
title?: Partial<TextField>
|
||||
}
|
||||
fields?: Field[]
|
||||
generateDescription?: GenerateDescription
|
||||
generateImage?: GenerateImage
|
||||
generateTitle?: GenerateTitle
|
||||
generateURL?: GenerateURL
|
||||
globals?: string[]
|
||||
tabbedUI?: boolean
|
||||
fieldOverrides?: {
|
||||
title?: Partial<TextField>
|
||||
description?: Partial<TextareaField>
|
||||
image?: Partial<UploadField>
|
||||
}
|
||||
interfaceName?: string
|
||||
tabbedUI?: boolean
|
||||
uploadsCollection?: string
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Response } from 'express'
|
||||
import type { Config as PayloadConfig } from 'payload/config'
|
||||
import type { PayloadRequest } from 'payload/dist/types'
|
||||
import type { PayloadRequest } from 'payload/types'
|
||||
|
||||
import Stripe from 'stripe'
|
||||
|
||||
|
||||
@@ -7,7 +7,12 @@ export { ConfigProvider, useConfig } from '../providers/Config'
|
||||
export { CustomProvider } from '../providers/CustomProvider'
|
||||
export { useDocumentEvents } from '../providers/DocumentEvents'
|
||||
export { useDocumentInfo } from '../providers/DocumentInfo'
|
||||
export { DocumentInfoProvider } from '../providers/DocumentInfo'
|
||||
export {
|
||||
type DocumentInfo,
|
||||
type DocumentInfoContext,
|
||||
type DocumentInfoProps,
|
||||
DocumentInfoProvider,
|
||||
} from '../providers/DocumentInfo'
|
||||
export { SetDocumentInfo } from '../providers/DocumentInfo/SetDocumentInfo'
|
||||
export { EditDepthContext, EditDepthProvider } from '../providers/EditDepth'
|
||||
export { useEditDepth } from '../providers/EditDepth'
|
||||
|
||||
@@ -16,6 +16,8 @@ import { useTranslation } from '../Translation'
|
||||
|
||||
const Context = createContext({} as DocumentInfoContext)
|
||||
|
||||
export type { DocumentInfo, DocumentInfoContext, DocumentInfoProps }
|
||||
|
||||
export const useDocumentInfo = (): DocumentInfoContext => useContext(Context)
|
||||
|
||||
export const DocumentInfoProvider: React.FC<
|
||||
|
||||
Reference in New Issue
Block a user