fix: fix all ui imports in our plugins, and get rid of ui subpath exports within monorepo (#6854)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { EntityToGroup } from '@payloadcms/ui/utilities/groupNavItems'
|
import type { EntityToGroup } from '@payloadcms/ui/shared'
|
||||||
|
|
||||||
import { getTranslation } from '@payloadcms/translations'
|
import { getTranslation } from '@payloadcms/translations'
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import type { SanitizedConfig } from 'payload'
|
|||||||
|
|
||||||
import { initI18n, rtlLanguages } from '@payloadcms/translations'
|
import { initI18n, rtlLanguages } from '@payloadcms/translations'
|
||||||
import { RootProvider } from '@payloadcms/ui'
|
import { RootProvider } from '@payloadcms/ui'
|
||||||
import { buildComponentMap } from '@payloadcms/ui/providers/ComponentMap/buildComponentMap'
|
|
||||||
import '@payloadcms/ui/scss/app.scss'
|
import '@payloadcms/ui/scss/app.scss'
|
||||||
|
import { buildComponentMap } from '@payloadcms/ui/utilities/buildComponentMap'
|
||||||
import { Merriweather } from 'next/font/google'
|
import { Merriweather } from 'next/font/google'
|
||||||
import { headers as getHeaders, cookies as nextCookies } from 'next/headers.js'
|
import { headers as getHeaders, cookies as nextCookies } from 'next/headers.js'
|
||||||
import { createClientConfig, parseCookies } from 'payload'
|
import { createClientConfig, parseCookies } from 'payload'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { AcceptedLanguages } from '@payloadcms/translations'
|
import type { AcceptedLanguages } from '@payloadcms/translations'
|
||||||
import type { Option } from '@payloadcms/ui/elements/ReactSelect'
|
import type { ReactSelectOption } from '@payloadcms/ui'
|
||||||
import type { LanguageOptions } from 'payload'
|
import type { LanguageOptions } from 'payload'
|
||||||
|
|
||||||
import { ReactSelect, useTranslation } from '@payloadcms/ui'
|
import { ReactSelect, useTranslation } from '@payloadcms/ui'
|
||||||
@@ -17,7 +17,7 @@ export const LanguageSelector: React.FC<{
|
|||||||
<ReactSelect
|
<ReactSelect
|
||||||
inputId="language-select"
|
inputId="language-select"
|
||||||
isClearable={false}
|
isClearable={false}
|
||||||
onChange={async (option: Option<AcceptedLanguages>) => {
|
onChange={async (option: ReactSelectOption<AcceptedLanguages>) => {
|
||||||
await switchLanguage(option.value)
|
await switchLanguage(option.value)
|
||||||
}}
|
}}
|
||||||
options={languageOptions}
|
options={languageOptions}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { EntityToGroup } from '@payloadcms/ui/utilities/groupNavItems'
|
import type { EntityToGroup } from '@payloadcms/ui/shared'
|
||||||
import type { AdminViewProps } from 'payload'
|
import type { AdminViewProps } from 'payload'
|
||||||
|
|
||||||
import { HydrateClientUser } from '@payloadcms/ui'
|
import { HydrateClientUser } from '@payloadcms/ui'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { FormProps } from '@payloadcms/ui/forms/Form'
|
import type { FormProps } from '@payloadcms/ui'
|
||||||
import type { FieldMap } from '@payloadcms/ui/utilities/buildComponentMap'
|
import type { FieldMap } from '@payloadcms/ui/utilities/buildComponentMap'
|
||||||
import type {
|
import type {
|
||||||
ClientCollectionConfig,
|
ClientCollectionConfig,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { StepNavItem } from '@payloadcms/ui/elements/StepNav'
|
import type { StepNavItem } from '@payloadcms/ui'
|
||||||
import type { FieldMap } from '@payloadcms/ui/utilities/buildComponentMap'
|
import type { FieldMap } from '@payloadcms/ui/utilities/buildComponentMap'
|
||||||
import type { ClientCollectionConfig, ClientGlobalConfig } from 'payload'
|
import type { ClientCollectionConfig, ClientGlobalConfig } from 'payload'
|
||||||
import type React from 'react'
|
import type React from 'react'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { I18nClient } from '@payloadcms/translations'
|
import type { I18nClient } from '@payloadcms/translations'
|
||||||
import type { SelectFieldProps } from '@payloadcms/ui/fields/Select'
|
import type { SelectFieldProps } from '@payloadcms/ui'
|
||||||
import type { MappedField } from '@payloadcms/ui/utilities/buildComponentMap'
|
import type { MappedField } from '@payloadcms/ui/utilities/buildComponentMap'
|
||||||
import type { OptionObject, SelectField } from 'payload'
|
import type { OptionObject, SelectField } from 'payload'
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { TextFieldProps } from '@payloadcms/ui/fields/Text'
|
import type { TextFieldProps } from '@payloadcms/ui'
|
||||||
|
|
||||||
import { Select } from '@payloadcms/ui/fields/Select'
|
import { SelectField, useForm } from '@payloadcms/ui'
|
||||||
import { useForm } from '@payloadcms/ui/forms/Form'
|
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
|
|
||||||
import type { SelectFieldOption } from '../../types.js'
|
import type { SelectFieldOption } from '../../types.js'
|
||||||
@@ -37,5 +36,5 @@ export const DynamicFieldSelector: React.FC<TextFieldProps> = (props) => {
|
|||||||
|
|
||||||
// TODO: label from config is Record<string, string> | false | string
|
// TODO: label from config is Record<string, string> | false | string
|
||||||
// but the FormFieldBase type has only label?: string, changing FormFieldBase breaks other ui components
|
// but the FormFieldBase type has only label?: string, changing FormFieldBase breaks other ui components
|
||||||
return <Select {...props} options={options} />
|
return <SelectField {...props} options={options} />
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { TextFieldProps } from '@payloadcms/ui/fields/Text'
|
import type { TextFieldProps } from '@payloadcms/ui'
|
||||||
import type { Data } from 'payload'
|
import type { Data } from 'payload'
|
||||||
|
|
||||||
import { Text } from '@payloadcms/ui/fields/Text'
|
import { TextField, useLocale, useWatchForm } from '@payloadcms/ui'
|
||||||
import { useWatchForm } from '@payloadcms/ui/forms/Form'
|
|
||||||
import { useLocale } from '@payloadcms/ui/providers/Locale'
|
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
|
|
||||||
type FieldWithID = {
|
type FieldWithID = {
|
||||||
@@ -47,7 +45,7 @@ export const DynamicPriceSelector: React.FC<TextFieldProps> = (props) => {
|
|||||||
|
|
||||||
// TODO: make this a number field, block by Payload
|
// TODO: make this a number field, block by Payload
|
||||||
if (valueType === 'static') {
|
if (valueType === 'static') {
|
||||||
return <Text {...props} />
|
return <TextField {...props} />
|
||||||
}
|
}
|
||||||
|
|
||||||
const localeCode = typeof locale === 'object' && 'code' in locale ? locale.code : locale
|
const localeCode = typeof locale === 'object' && 'code' in locale ? locale.code : locale
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
import type { FormState } from 'payload'
|
import type { FormState } from 'payload'
|
||||||
|
|
||||||
import { useWatchForm } from '@payloadcms/ui/forms/Form'
|
import { useConfig, useWatchForm } from '@payloadcms/ui'
|
||||||
import { useConfig } from '@payloadcms/ui/providers/Config'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
// TODO: fix this import to work in dev mode within the monorepo in a way that is backwards compatible with 1.x
|
// TODO: fix this import to work in dev mode within the monorepo in a way that is backwards compatible with 1.x
|
||||||
// import CopyToClipboard from 'payload/dist/admin/components/elements/CopyToClipboard'
|
// import CopyToClipboard from 'payload/dist/admin/components/elements/CopyToClipboard'
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FieldType, FormFieldBase, Options } from '@payloadcms/ui'
|
||||||
import type { FieldType, Options } from '@payloadcms/ui/forms/useField'
|
|
||||||
|
|
||||||
import { FieldLabel } from '@payloadcms/ui/fields/FieldLabel'
|
import {
|
||||||
import { TextareaInput } from '@payloadcms/ui/fields/Textarea'
|
FieldLabel,
|
||||||
import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'
|
TextareaInput,
|
||||||
import { useAllFormFields } from '@payloadcms/ui/forms/Form'
|
useAllFormFields,
|
||||||
import { useField } from '@payloadcms/ui/forms/useField'
|
useDocumentInfo,
|
||||||
import { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'
|
useField,
|
||||||
import { useLocale } from '@payloadcms/ui/providers/Locale'
|
useFieldProps,
|
||||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
useLocale,
|
||||||
|
useTranslation,
|
||||||
|
} from '@payloadcms/ui'
|
||||||
import React, { useCallback } from 'react'
|
import React, { useCallback } from 'react'
|
||||||
|
|
||||||
import type { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'
|
import type { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { UploadInputProps } from '@payloadcms/ui/fields/Upload'
|
import type { FieldType, Options, UploadInputProps } from '@payloadcms/ui'
|
||||||
import type { FieldType, Options } from '@payloadcms/ui/forms/useField'
|
|
||||||
|
|
||||||
import { FieldLabel } from '@payloadcms/ui/fields/FieldLabel'
|
import {
|
||||||
import { UploadInput } from '@payloadcms/ui/fields/Upload'
|
FieldLabel,
|
||||||
import { useAllFormFields } from '@payloadcms/ui/forms/Form'
|
UploadInput,
|
||||||
import { useField } from '@payloadcms/ui/forms/useField'
|
useAllFormFields,
|
||||||
import { useConfig } from '@payloadcms/ui/providers/Config'
|
useConfig,
|
||||||
import { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'
|
useDocumentInfo,
|
||||||
import { useLocale } from '@payloadcms/ui/providers/Locale'
|
useField,
|
||||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
useLocale,
|
||||||
|
useTranslation,
|
||||||
|
} from '@payloadcms/ui'
|
||||||
import React, { useCallback } from 'react'
|
import React, { useCallback } from 'react'
|
||||||
|
|
||||||
import type { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'
|
import type { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FieldType, FormFieldBase, Options } from '@payloadcms/ui'
|
||||||
import type { FieldType, Options } from '@payloadcms/ui/forms/useField'
|
|
||||||
|
|
||||||
import { FieldLabel } from '@payloadcms/ui/fields/FieldLabel'
|
import {
|
||||||
import { TextInput } from '@payloadcms/ui/fields/Text'
|
FieldLabel,
|
||||||
import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'
|
TextInput,
|
||||||
import { useAllFormFields } from '@payloadcms/ui/forms/Form'
|
useAllFormFields,
|
||||||
import { useField } from '@payloadcms/ui/forms/useField'
|
useDocumentInfo,
|
||||||
import { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'
|
useField,
|
||||||
import { useLocale } from '@payloadcms/ui/providers/Locale'
|
useFieldProps,
|
||||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
useLocale,
|
||||||
|
useTranslation,
|
||||||
|
} from '@payloadcms/ui'
|
||||||
import React, { useCallback } from 'react'
|
import React, { useCallback } from 'react'
|
||||||
|
|
||||||
import type { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'
|
import type { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { Config, Field, GroupField, TabsField, TextField } from 'payload'
|
import type { Config, Field, GroupField, TabsField, TextField } from 'payload'
|
||||||
|
|
||||||
import { addDataAndFileToRequest } from '@payloadcms/next/utilities'
|
import { addDataAndFileToRequest } from '@payloadcms/next/utilities'
|
||||||
import { withMergedProps } from '@payloadcms/ui/elements/withMergedProps'
|
import { withMergedProps } from '@payloadcms/ui/shared'
|
||||||
import { deepMerge } from 'payload/shared'
|
import { deepMerge } from 'payload/shared'
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { DocumentInfoContext } from '@payloadcms/ui/providers/DocumentInfo'
|
import type { DocumentInfoContext } from '@payloadcms/ui'
|
||||||
import type { Field, TextField, TextareaField, UploadField } from 'payload'
|
import type { Field, TextField, TextareaField, UploadField } from 'payload'
|
||||||
|
|
||||||
export type GenerateTitle = <T = any>(
|
export type GenerateTitle = <T = any>(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
import { useTranslation } from '@payloadcms/ui'
|
||||||
import React, { Fragment, useEffect, useState } from 'react'
|
import React, { Fragment, useEffect, useState } from 'react'
|
||||||
|
|
||||||
import type { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'
|
import type { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'
|
||||||
|
|||||||
@@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
import type { FormField } from 'payload'
|
import type { FormField } from 'payload'
|
||||||
|
|
||||||
import { useAllFormFields, useForm } from '@payloadcms/ui/forms/Form'
|
import { useAllFormFields, useForm, useTranslation } from '@payloadcms/ui'
|
||||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
|
||||||
import React, { useCallback, useEffect, useState } from 'react'
|
import React, { useCallback, useEffect, useState } from 'react'
|
||||||
|
|
||||||
import type { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'
|
import type { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'
|
||||||
|
|||||||
@@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
import type { FormField, UIField } from 'payload'
|
import type { FormField, UIField } from 'payload'
|
||||||
|
|
||||||
import { useAllFormFields } from '@payloadcms/ui/forms/Form'
|
import { useAllFormFields, useDocumentInfo, useLocale, useTranslation } from '@payloadcms/ui'
|
||||||
import { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'
|
|
||||||
import { useLocale } from '@payloadcms/ui/providers/Locale'
|
|
||||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
|
|
||||||
import type { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'
|
import type { PluginSEOTranslationKeys, PluginSEOTranslations } from '../translations/index.js'
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
"noEmit": false /* Do not emit outputs. */,
|
"noEmit": false /* Do not emit outputs. */,
|
||||||
"emitDeclarationOnly": true,
|
"emitDeclarationOnly": true,
|
||||||
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
|
"outDir": "./dist" /* Specify an output folder for all emitted files. */,
|
||||||
"rootDir": "./src" /* Specify the root folder within your source files. */
|
"rootDir": "./src", /* Specify the root folder within your source files. */
|
||||||
|
"jsx": "react-jsx"
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"dist",
|
"dist",
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { CustomComponent, UIField } from 'payload'
|
import type { CustomComponent, UIField } from 'payload'
|
||||||
|
|
||||||
import { CopyToClipboard } from '@payloadcms/ui/elements/CopyToClipboard'
|
import { CopyToClipboard, useFieldProps, useFormFields } from '@payloadcms/ui'
|
||||||
import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'
|
|
||||||
import { useFormFields } from '@payloadcms/ui/forms/Form'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export const LinkToDoc: CustomComponent<UIField> = () => {
|
export const LinkToDoc: CustomComponent<UIField> = () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FormFieldBase } from '@payloadcms/ui'
|
||||||
import type { SerializedEditorState } from 'lexical'
|
import type { SerializedEditorState } from 'lexical'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -15,8 +15,8 @@ import { ErrorBoundary } from 'react-error-boundary'
|
|||||||
|
|
||||||
import type { SanitizedClientEditorConfig } from './lexical/config/types.js'
|
import type { SanitizedClientEditorConfig } from './lexical/config/types.js'
|
||||||
|
|
||||||
import './index.scss'
|
|
||||||
import './bundled.css'
|
import './bundled.css'
|
||||||
|
import './index.scss'
|
||||||
import { LexicalProvider } from './lexical/LexicalProvider.js'
|
import { LexicalProvider } from './lexical/LexicalProvider.js'
|
||||||
|
|
||||||
const baseClass = 'rich-text-lexical'
|
const baseClass = 'rich-text-lexical'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FormFieldBase } from '@payloadcms/ui'
|
||||||
import type { FieldMap, ReducedBlock } from '@payloadcms/ui/utilities/buildComponentMap'
|
import type { FieldMap, ReducedBlock } from '@payloadcms/ui/utilities/buildComponentMap'
|
||||||
import type { CollapsedPreferences, Data, FormState } from 'payload'
|
import type { CollapsedPreferences, Data, FormState } from 'payload'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { FormProps } from '@payloadcms/ui/forms/Form'
|
import type { FormProps } from '@payloadcms/ui'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Collapsible,
|
Collapsible,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { FormProps } from '@payloadcms/ui/forms/Form'
|
import type { FormProps } from '@payloadcms/ui'
|
||||||
import type { FormState } from 'payload'
|
import type { FormState } from 'payload'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { FormProps } from '@payloadcms/ui/forms/Form'
|
import type { FormProps } from '@payloadcms/ui'
|
||||||
import type { ClientCollectionConfig, FormState } from 'payload'
|
import type { ClientCollectionConfig, FormState } from 'payload'
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FormFieldBase } from '@payloadcms/ui'
|
||||||
import type { EditorConfig as LexicalEditorConfig } from 'lexical'
|
import type { EditorConfig as LexicalEditorConfig } from 'lexical'
|
||||||
|
|
||||||
import { ShimmerEffect, useClientFunctions, useFieldProps } from '@payloadcms/ui'
|
import { ShimmerEffect, useClientFunctions, useFieldProps } from '@payloadcms/ui'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { InitialConfigType } from '@lexical/react/LexicalComposer.js'
|
import type { InitialConfigType } from '@lexical/react/LexicalComposer.js'
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FormFieldBase } from '@payloadcms/ui'
|
||||||
import type { EditorState, LexicalEditor, SerializedEditorState } from 'lexical'
|
import type { EditorState, LexicalEditor, SerializedEditorState } from 'lexical'
|
||||||
|
|
||||||
import { LexicalComposer } from '@lexical/react/LexicalComposer.js'
|
import { LexicalComposer } from '@lexical/react/LexicalComposer.js'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FormFieldBase } from '@payloadcms/ui'
|
||||||
import type { LexicalEditor } from 'lexical'
|
import type { LexicalEditor } from 'lexical'
|
||||||
|
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type {
|
|||||||
SerializedLexicalNode,
|
SerializedLexicalNode,
|
||||||
} from 'lexical'
|
} from 'lexical'
|
||||||
|
|
||||||
import { withMergedProps } from '@payloadcms/ui/elements/withMergedProps'
|
import { withMergedProps } from '@payloadcms/ui/shared'
|
||||||
import { fileURLToPath } from 'node:url'
|
import { fileURLToPath } from 'node:url'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FormFieldBase } from '@payloadcms/ui'
|
||||||
import type { ClientValidate } from 'payload'
|
import type { ClientValidate } from 'payload'
|
||||||
import type { BaseEditor, BaseOperation } from 'slate'
|
import type { BaseEditor, BaseOperation } from 'slate'
|
||||||
import type { HistoryEditor } from 'slate-history'
|
import type { HistoryEditor } from 'slate-history'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { FormProps } from '@payloadcms/ui/forms/Form'
|
import type { FormProps } from '@payloadcms/ui'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Drawer,
|
Drawer,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { FieldMap } from '@payloadcms/ui/utilities/buildComponentMap'
|
import type { FieldMap } from '@payloadcms/ui'
|
||||||
import type { FormState } from 'payload'
|
import type { FormState } from 'payload'
|
||||||
|
|
||||||
export type Props = {
|
export type Props = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FormFieldBase } from '@payloadcms/ui'
|
||||||
|
|
||||||
import { getTranslation } from '@payloadcms/translations'
|
import { getTranslation } from '@payloadcms/translations'
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FormFieldBase, FormProps } from '@payloadcms/ui'
|
||||||
import type { ClientCollectionConfig } from 'payload'
|
import type { ClientCollectionConfig } from 'payload'
|
||||||
|
|
||||||
import { getTranslation } from '@payloadcms/translations'
|
import { getTranslation } from '@payloadcms/translations'
|
||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
Drawer,
|
Drawer,
|
||||||
Form,
|
Form,
|
||||||
FormSubmit,
|
FormSubmit,
|
||||||
|
RenderFields,
|
||||||
useAuth,
|
useAuth,
|
||||||
useConfig,
|
useConfig,
|
||||||
useDocumentInfo,
|
useDocumentInfo,
|
||||||
@@ -15,8 +16,6 @@ import {
|
|||||||
useModal,
|
useModal,
|
||||||
useTranslation,
|
useTranslation,
|
||||||
} from '@payloadcms/ui'
|
} from '@payloadcms/ui'
|
||||||
import { type FormProps } from '@payloadcms/ui/forms/Form'
|
|
||||||
import { RenderFields } from '@payloadcms/ui/forms/RenderFields'
|
|
||||||
import { getFormState } from '@payloadcms/ui/shared'
|
import { getFormState } from '@payloadcms/ui/shared'
|
||||||
import { deepCopyObject } from 'payload/shared'
|
import { deepCopyObject } from 'payload/shared'
|
||||||
import React, { useCallback, useEffect, useState } from 'react'
|
import React, { useCallback, useEffect, useState } from 'react'
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FormFieldBase } from '@payloadcms/ui'
|
||||||
import type { ClientCollectionConfig } from 'payload'
|
import type { ClientCollectionConfig } from 'payload'
|
||||||
|
|
||||||
import { getTranslation } from '@payloadcms/translations'
|
import { getTranslation } from '@payloadcms/translations'
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
DrawerToggler,
|
DrawerToggler,
|
||||||
|
File,
|
||||||
useConfig,
|
useConfig,
|
||||||
useDocumentDrawer,
|
useDocumentDrawer,
|
||||||
useDrawerSlug,
|
useDrawerSlug,
|
||||||
@@ -14,7 +15,6 @@ import {
|
|||||||
usePayloadAPI,
|
usePayloadAPI,
|
||||||
useTranslation,
|
useTranslation,
|
||||||
} from '@payloadcms/ui'
|
} from '@payloadcms/ui'
|
||||||
import { File } from '@payloadcms/ui/graphics/File'
|
|
||||||
import React, { useCallback, useReducer, useState } from 'react'
|
import React, { useCallback, useReducer, useState } from 'react'
|
||||||
import { Transforms } from 'slate'
|
import { Transforms } from 'slate'
|
||||||
import { ReactEditor, useFocused, useSelected, useSlateStatic } from 'slate-react'
|
import { ReactEditor, useFocused, useSelected, useSlateStatic } from 'slate-react'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FormFieldBase } from '@payloadcms/ui'
|
||||||
|
|
||||||
import { ShimmerEffect, useClientFunctions, useFieldProps } from '@payloadcms/ui'
|
import { ShimmerEffect, useClientFunctions, useFieldProps } from '@payloadcms/ui'
|
||||||
import React, { Suspense, lazy, useEffect, useState } from 'react'
|
import React, { Suspense, lazy, useEffect, useState } from 'react'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FormFieldBase } from '@payloadcms/ui'
|
||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FormFieldBase } from '@payloadcms/ui'
|
||||||
import type { Element } from 'slate'
|
import type { Element } from 'slate'
|
||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FormFieldBase } from '@payloadcms/ui'
|
||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { FormFieldBase } from '@payloadcms/ui/fields/shared'
|
import type { FormFieldBase } from '@payloadcms/ui'
|
||||||
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -20,56 +20,35 @@
|
|||||||
"types": "./src/exports/shared/index.ts",
|
"types": "./src/exports/shared/index.ts",
|
||||||
"default": "./src/exports/shared/index.ts"
|
"default": "./src/exports/shared/index.ts"
|
||||||
},
|
},
|
||||||
"./assets": {
|
|
||||||
"import": "./src/assets/index.ts",
|
|
||||||
"types": "./src/assets/index.ts",
|
|
||||||
"default": "./src/assets/index.ts"
|
|
||||||
},
|
|
||||||
"./scss": {
|
"./scss": {
|
||||||
"import": "./src/scss/styles.scss",
|
"import": "./src/scss/styles.scss",
|
||||||
"default": "./src/scss/styles.scss"
|
"default": "./src/scss/styles.scss"
|
||||||
},
|
},
|
||||||
|
"./utilities/buildComponentMap": {
|
||||||
|
"import": "./src/utilities/buildComponentMap.ts",
|
||||||
|
"types": "./src/utilities/buildComponentMap.ts",
|
||||||
|
"default": "./src/utilities/buildComponentMap.ts"
|
||||||
|
},
|
||||||
|
"./utilities/buildFormState": {
|
||||||
|
"import": "./src/utilities/buildFormState.ts",
|
||||||
|
"types": "./src/utilities/buildFormState.ts",
|
||||||
|
"default": "./src/utilities/buildFormState.ts"
|
||||||
|
},
|
||||||
|
"./utilities/buildFieldSchemaMap/traverseFields": {
|
||||||
|
"import": "./src/utilities/buildFieldSchemaMap/traverseFields.ts",
|
||||||
|
"types": "./src/utilities/buildFieldSchemaMap/traverseFields.ts",
|
||||||
|
"default": "./src/utilities/buildFieldSchemaMap/traverseFields.ts"
|
||||||
|
},
|
||||||
|
"./forms/buildStateFromSchema": {
|
||||||
|
"import": "./src/forms/buildStateFromSchema/index.tsx",
|
||||||
|
"types": "./src/forms/buildStateFromSchema/index.tsx",
|
||||||
|
"default": "./src/forms/buildStateFromSchema/index.tsx"
|
||||||
|
},
|
||||||
"./scss/app.scss": "./src/scss/app.scss",
|
"./scss/app.scss": "./src/scss/app.scss",
|
||||||
"./styles.css": "./dist/styles.css",
|
"./assets": {
|
||||||
"./elements/*": {
|
"import": "./src/assets/index.ts",
|
||||||
"import": "./src/elements/*/index.tsx",
|
"types": "./src/assets/index.ts",
|
||||||
"types": "./src/elements/*/index.tsx",
|
"default": "./src/assets/index.ts"
|
||||||
"default": "./src/elements/*/index.tsx"
|
|
||||||
},
|
|
||||||
"./fields/*": {
|
|
||||||
"import": "./src/fields/*/index.tsx",
|
|
||||||
"types": "./src/fields/*/index.tsx",
|
|
||||||
"default": "./src/fields/*/index.tsx"
|
|
||||||
},
|
|
||||||
"./forms/*": {
|
|
||||||
"import": "./src/forms/*/index.tsx",
|
|
||||||
"types": "./src/forms/*/index.tsx",
|
|
||||||
"default": "./src/forms/*/index.tsx"
|
|
||||||
},
|
|
||||||
"./graphics/*": {
|
|
||||||
"import": "./src/graphics/*/index.tsx",
|
|
||||||
"types": "./src/graphics/*/index.tsx",
|
|
||||||
"default": "./src/graphics/*/index.tsx"
|
|
||||||
},
|
|
||||||
"./hooks/*": {
|
|
||||||
"import": "./src/hooks/*.ts",
|
|
||||||
"types": "./src/hooks/*.ts",
|
|
||||||
"default": "./src/hooks/*.ts"
|
|
||||||
},
|
|
||||||
"./icons/*": {
|
|
||||||
"import": "./src/icons/*/index.tsx",
|
|
||||||
"types": "./src/icons/*/index.tsx",
|
|
||||||
"default": "./src/icons/*/index.tsx"
|
|
||||||
},
|
|
||||||
"./providers/*": {
|
|
||||||
"import": "./src/providers/*/index.tsx",
|
|
||||||
"types": "./src/providers/*/index.tsx",
|
|
||||||
"default": "./src/providers/*/index.tsx"
|
|
||||||
},
|
|
||||||
"./utilities/*": {
|
|
||||||
"import": "./src/utilities/*.ts",
|
|
||||||
"types": "./src/utilities/*.ts",
|
|
||||||
"default": "./src/utilities/*.ts"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"main": "./src/exports/client/index.ts",
|
"main": "./src/exports/client/index.ts",
|
||||||
@@ -178,7 +157,6 @@
|
|||||||
"types": "./dist/assets/index.d.ts",
|
"types": "./dist/assets/index.d.ts",
|
||||||
"default": "./dist/assets/index.js"
|
"default": "./dist/assets/index.js"
|
||||||
},
|
},
|
||||||
"./assets/*": "./dist/assets/*",
|
|
||||||
"./elements/*": {
|
"./elements/*": {
|
||||||
"import": "./dist/elements/*/index.js",
|
"import": "./dist/elements/*/index.js",
|
||||||
"types": "./dist/elements/*/index.d.ts",
|
"types": "./dist/elements/*/index.d.ts",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { DropdownIndicatorProps } from 'react-select'
|
import type { DropdownIndicatorProps } from 'react-select'
|
||||||
|
|
||||||
import { ChevronIcon } from '@payloadcms/ui/icons/Chevron'
|
import { ChevronIcon } from '@payloadcms/ui'
|
||||||
import React, { type JSX } from 'react'
|
import React, { type JSX } from 'react'
|
||||||
|
|
||||||
import type { Option as OptionType } from '../types.js'
|
import type { Option as OptionType } from '../types.js'
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { getTranslation } from '@payloadcms/translations'
|
import { getTranslation } from '@payloadcms/translations'
|
||||||
import { useComponentMap } from '@payloadcms/ui/providers/ComponentMap'
|
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
|
|
||||||
import { PayloadIcon } from '../../graphics/Icon/index.js'
|
import { PayloadIcon } from '../../graphics/Icon/index.js'
|
||||||
@@ -12,6 +11,8 @@ import './index.scss'
|
|||||||
export { SetStepNav } from './SetStepNav.js'
|
export { SetStepNav } from './SetStepNav.js'
|
||||||
import type { StepNavItem } from './types.js'
|
import type { StepNavItem } from './types.js'
|
||||||
|
|
||||||
|
import { useComponentMap } from '../../providers/ComponentMap/index.js'
|
||||||
|
|
||||||
const baseClass = 'step-nav'
|
const baseClass = 'step-nav'
|
||||||
|
|
||||||
const StepNav: React.FC<{
|
const StepNav: React.FC<{
|
||||||
|
|||||||
@@ -53,7 +53,9 @@ import * as PopupList from '../../elements/Popup/PopupButtonList/index.js'
|
|||||||
export { PopupList }
|
export { PopupList }
|
||||||
export { Popup } from '../../elements/Popup/index.js'
|
export { Popup } from '../../elements/Popup/index.js'
|
||||||
export { PublishMany } from '../../elements/PublishMany/index.js'
|
export { PublishMany } from '../../elements/PublishMany/index.js'
|
||||||
export { ReactSelect } from '../../elements/ReactSelect/index.js'
|
export { DefaultPublishButton, PublishButton } from '../../elements/PublishButton/index.js'
|
||||||
|
|
||||||
|
export { type Option as ReactSelectOption, ReactSelect } from '../../elements/ReactSelect/index.js'
|
||||||
export { ReactSelect as Select } from '../../elements/ReactSelect/index.js'
|
export { ReactSelect as Select } from '../../elements/ReactSelect/index.js'
|
||||||
export { RenderTitle } from '../../elements/RenderTitle/index.js'
|
export { RenderTitle } from '../../elements/RenderTitle/index.js'
|
||||||
export { ShimmerEffect } from '../../elements/ShimmerEffect/index.js'
|
export { ShimmerEffect } from '../../elements/ShimmerEffect/index.js'
|
||||||
@@ -100,10 +102,16 @@ export { RichText as RichTextField } from '../../fields/RichText/index.js'
|
|||||||
export { Row as RowField } from '../../fields/Row/index.js'
|
export { Row as RowField } from '../../fields/Row/index.js'
|
||||||
export { Select as SelectField, type SelectFieldProps } from '../../fields/Select/index.js'
|
export { Select as SelectField, type SelectFieldProps } from '../../fields/Select/index.js'
|
||||||
export { Tabs as TabsField, type TabsFieldProps } from '../../fields/Tabs/index.js'
|
export { Tabs as TabsField, type TabsFieldProps } from '../../fields/Tabs/index.js'
|
||||||
export { Text as TextField } from '../../fields/Text/index.js'
|
export { Text as TextField, TextInput } from '../../fields/Text/index.js'
|
||||||
export { Textarea as TextareaField } from '../../fields/Textarea/index.js'
|
export type { TextFieldProps, TextInputProps } from '../../fields/Text/index.js'
|
||||||
|
|
||||||
|
export { Textarea as TextareaField, TextareaInput } from '../../fields/Textarea/index.js'
|
||||||
|
export type { TextAreaInputProps, TextareaFieldProps } from '../../fields/Textarea/index.js'
|
||||||
|
|
||||||
export { UI as UIField } from '../../fields/UI/index.js'
|
export { UI as UIField } from '../../fields/UI/index.js'
|
||||||
export { Upload as UploadField } from '../../fields/Upload/index.js'
|
export { Upload as UploadField, UploadInput } from '../../fields/Upload/index.js'
|
||||||
|
export type { UploadFieldProps, UploadInputProps } from '../../fields/Upload/index.js'
|
||||||
|
|
||||||
export { fieldBaseClass } from '../../fields/shared/index.js'
|
export { fieldBaseClass } from '../../fields/shared/index.js'
|
||||||
|
|
||||||
// forms
|
// forms
|
||||||
@@ -122,10 +130,15 @@ export {
|
|||||||
export { Form, type FormProps } from '../../forms/Form/index.js'
|
export { Form, type FormProps } from '../../forms/Form/index.js'
|
||||||
export { NullifyLocaleField } from '../../forms/NullifyField/index.js'
|
export { NullifyLocaleField } from '../../forms/NullifyField/index.js'
|
||||||
export { RenderFields } from '../../forms/RenderFields/index.js'
|
export { RenderFields } from '../../forms/RenderFields/index.js'
|
||||||
export { RowLabel } from '../../forms/RowLabel/index.js'
|
export { RowLabel, type RowLabelProps } from '../../forms/RowLabel/index.js'
|
||||||
|
export { RowLabelProvider, useRowLabel } from '../../forms/RowLabel/Context/index.js'
|
||||||
|
|
||||||
export { FormSubmit } from '../../forms/Submit/index.js'
|
export { FormSubmit } from '../../forms/Submit/index.js'
|
||||||
export { WatchChildErrors } from '../../forms/WatchChildErrors/index.js'
|
export { WatchChildErrors } from '../../forms/WatchChildErrors/index.js'
|
||||||
export { useField } from '../../forms/useField/index.js'
|
export { useField } from '../../forms/useField/index.js'
|
||||||
|
export type { FormFieldBase } from '../../fields/shared/index.js'
|
||||||
|
export type { FieldType, Options } from '../../forms/useField/types.js'
|
||||||
|
|
||||||
export { withCondition } from '../../forms/withCondition/index.js'
|
export { withCondition } from '../../forms/withCondition/index.js'
|
||||||
|
|
||||||
// graphics
|
// graphics
|
||||||
@@ -158,11 +171,24 @@ export { ActionsProvider, SetViewActions, useActions } from '../../providers/Act
|
|||||||
export { AuthProvider, useAuth } from '../../providers/Auth/index.js'
|
export { AuthProvider, useAuth } from '../../providers/Auth/index.js'
|
||||||
export { ClientFunctionProvider, useClientFunctions } from '../../providers/ClientFunction/index.js'
|
export { ClientFunctionProvider, useClientFunctions } from '../../providers/ClientFunction/index.js'
|
||||||
export { useAddClientFunction } from '../../providers/ClientFunction/index.js'
|
export { useAddClientFunction } from '../../providers/ClientFunction/index.js'
|
||||||
export type { MappedField } from '../../providers/ComponentMap/buildComponentMap/types.js'
|
export type {
|
||||||
|
ActionMap,
|
||||||
|
CollectionComponentMap,
|
||||||
|
ComponentMap,
|
||||||
|
ConfigComponentMapBase,
|
||||||
|
FieldComponentProps,
|
||||||
|
FieldMap,
|
||||||
|
GlobalComponentMap,
|
||||||
|
MappedField,
|
||||||
|
MappedTab,
|
||||||
|
ReducedBlock,
|
||||||
|
} from '../../providers/ComponentMap/buildComponentMap/types.js'
|
||||||
export { ComponentMapProvider, useComponentMap } from '../../providers/ComponentMap/index.js'
|
export { ComponentMapProvider, useComponentMap } from '../../providers/ComponentMap/index.js'
|
||||||
export { ConfigProvider, useConfig } from '../../providers/Config/index.js'
|
export { ConfigProvider, useConfig } from '../../providers/Config/index.js'
|
||||||
export { DocumentEventsProvider, useDocumentEvents } from '../../providers/DocumentEvents/index.js'
|
export { DocumentEventsProvider, useDocumentEvents } from '../../providers/DocumentEvents/index.js'
|
||||||
export { DocumentInfoProvider, useDocumentInfo } from '../../providers/DocumentInfo/index.js'
|
export { DocumentInfoProvider, useDocumentInfo } from '../../providers/DocumentInfo/index.js'
|
||||||
|
export type { DocumentInfoContext, DocumentInfoProps } from '../../providers/DocumentInfo/index.js'
|
||||||
|
|
||||||
export { EditDepthProvider, useEditDepth } from '../../providers/EditDepth/index.js'
|
export { EditDepthProvider, useEditDepth } from '../../providers/EditDepth/index.js'
|
||||||
export {
|
export {
|
||||||
EntityVisibilityProvider,
|
EntityVisibilityProvider,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
// IMPORTANT: the shared.ts file CANNOT contain any Server Components _that import client components_.
|
// IMPORTANT: the shared.ts file CANNOT contain any Server Components _that import client components_.
|
||||||
export { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'
|
export { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'
|
||||||
export { WithServerSideProps } from '../../elements/WithServerSideProps/index.js'
|
export { WithServerSideProps } from '../../elements/WithServerSideProps/index.js'
|
||||||
|
export { withMergedProps } from '../../elements/withMergedProps/index.js' // cannot be within a 'use client', thus we export this from shared
|
||||||
export { PayloadIcon } from '../../graphics/Icon/index.js'
|
export { PayloadIcon } from '../../graphics/Icon/index.js'
|
||||||
export { PayloadLogo } from '../../graphics/Logo/index.js'
|
export { PayloadLogo } from '../../graphics/Logo/index.js'
|
||||||
export { requests } from '../../utilities/api.js'
|
export { requests } from '../../utilities/api.js'
|
||||||
@@ -8,7 +9,12 @@ export { findLocaleFromCode } from '../../utilities/findLocaleFromCode.js'
|
|||||||
export { formatDate } from '../../utilities/formatDate.js'
|
export { formatDate } from '../../utilities/formatDate.js'
|
||||||
export { formatDocTitle } from '../../utilities/formatDocTitle.js'
|
export { formatDocTitle } from '../../utilities/formatDocTitle.js'
|
||||||
export { getFormState } from '../../utilities/getFormState.js'
|
export { getFormState } from '../../utilities/getFormState.js'
|
||||||
export { EntityType, groupNavItems } from '../../utilities/groupNavItems.js'
|
export {
|
||||||
|
type EntityToGroup,
|
||||||
|
EntityType,
|
||||||
|
type Group,
|
||||||
|
groupNavItems,
|
||||||
|
} from '../../utilities/groupNavItems.js'
|
||||||
export { hasSavePermission } from '../../utilities/hasSavePermission.js'
|
export { hasSavePermission } from '../../utilities/hasSavePermission.js'
|
||||||
export { isEditing } from '../../utilities/isEditing.js'
|
export { isEditing } from '../../utilities/isEditing.js'
|
||||||
export { reduceFieldsToValues } from '../../utilities/reduceFieldsToValues.js'
|
export { reduceFieldsToValues } from '../../utilities/reduceFieldsToValues.js'
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useForm } from '@payloadcms/ui/forms/Form'
|
|
||||||
import { useAuth } from '@payloadcms/ui/providers/Auth'
|
import { useAuth, useForm, useTranslation } from '@payloadcms/ui'
|
||||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export const TestButton: React.FC = () => {
|
export const TestButton: React.FC = () => {
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
import type { SanitizedConfig } from 'payload'
|
import type { SanitizedConfig } from 'payload'
|
||||||
|
|
||||||
import { useConfig } from '@payloadcms/ui/providers/Config'
|
|
||||||
import LinkImport from 'next/link.js'
|
import LinkImport from 'next/link.js'
|
||||||
const Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default
|
const Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default
|
||||||
|
|
||||||
|
import { useConfig } from '@payloadcms/ui'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
const baseClass = 'after-nav-links'
|
const baseClass = 'after-nav-links'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import type { SanitizedConfig } from 'payload'
|
import type { SanitizedConfig } from 'payload'
|
||||||
|
|
||||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
import { useTranslation } from '@payloadcms/ui'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export const BeforeLogin: SanitizedConfig['admin']['components']['beforeLogin'][0] = () => {
|
export const BeforeLogin: SanitizedConfig['admin']['components']['beforeLogin'][0] = () => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { CellComponentProps } from 'payload'
|
import type { CellComponentProps } from 'payload'
|
||||||
|
|
||||||
import { useTableCell } from '@payloadcms/ui/elements/Table'
|
import { useTableCell } from '@payloadcms/ui'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export const CustomCell: React.FC<CellComponentProps> = (props) => {
|
export const CustomCell: React.FC<CellComponentProps> = (props) => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useConfig } from '@payloadcms/ui/providers/Config'
|
import { useConfig } from '@payloadcms/ui'
|
||||||
import LinkImport from 'next/link.js'
|
import LinkImport from 'next/link.js'
|
||||||
import { useParams } from 'next/navigation.js'
|
import { useParams } from 'next/navigation.js'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { DescriptionComponent } from 'payload'
|
import type { DescriptionComponent } from 'payload'
|
||||||
|
|
||||||
import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'
|
import { useFieldProps, useFormFields } from '@payloadcms/ui'
|
||||||
import { useFormFields } from '@payloadcms/ui/forms/Form'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export const FieldDescriptionComponent: DescriptionComponent = () => {
|
export const FieldDescriptionComponent: DescriptionComponent = () => {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { LogOutIcon } from '@payloadcms/ui/icons/LogOut'
|
import { LogOutIcon, useConfig } from '@payloadcms/ui'
|
||||||
import { useConfig } from '@payloadcms/ui/providers/Config'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export const Logout: React.FC = () => {
|
export const Logout: React.FC = () => {
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ const Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.
|
|||||||
|
|
||||||
import type { AdminViewProps } from 'payload'
|
import type { AdminViewProps } from 'payload'
|
||||||
|
|
||||||
import { Button } from '@payloadcms/ui/elements/Button'
|
import { Button, SetStepNav } from '@payloadcms/ui'
|
||||||
import { SetStepNav } from '@payloadcms/ui/elements/StepNav'
|
|
||||||
|
|
||||||
import { customViewPath } from '../../../shared.js'
|
import { customViewPath } from '../../../shared.js'
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { EditViewComponent } from 'payload'
|
import type { EditViewComponent } from 'payload'
|
||||||
|
|
||||||
import { SetStepNav } from '@payloadcms/ui/elements/StepNav'
|
import { SetStepNav } from '@payloadcms/ui'
|
||||||
import { notFound, redirect } from 'next/navigation.js'
|
import { notFound, redirect } from 'next/navigation.js'
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { SetStepNav } from '@payloadcms/ui/elements/StepNav'
|
import type { EditViewComponent } from 'payload'
|
||||||
|
|
||||||
|
import { SetStepNav } from '@payloadcms/ui'
|
||||||
import { notFound, redirect } from 'next/navigation.js'
|
import { notFound, redirect } from 'next/navigation.js'
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
|
|
||||||
import type { EditViewComponent } from '../../../../../packages/payload/types.js'
|
|
||||||
|
|
||||||
export const CustomDefaultEditView: EditViewComponent = ({ initPageResult }) => {
|
export const CustomDefaultEditView: EditViewComponent = ({ initPageResult }) => {
|
||||||
if (!initPageResult) {
|
if (!initPageResult) {
|
||||||
notFound()
|
notFound()
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.
|
|||||||
import type { AdminViewProps } from 'payload'
|
import type { AdminViewProps } from 'payload'
|
||||||
|
|
||||||
import { MinimalTemplate } from '@payloadcms/next/templates'
|
import { MinimalTemplate } from '@payloadcms/next/templates'
|
||||||
import { Button } from '@payloadcms/ui/elements/Button'
|
import { Button } from '@payloadcms/ui'
|
||||||
|
|
||||||
import { customViewPath } from '../../../shared.js'
|
import { customViewPath } from '../../../shared.js'
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { SetStepNav } from '@payloadcms/ui/elements/StepNav'
|
import type { ServerSideEditViewProps } from 'payload'
|
||||||
|
|
||||||
|
import { SetStepNav } from '@payloadcms/ui'
|
||||||
import { notFound } from 'next/navigation.js'
|
import { notFound } from 'next/navigation.js'
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
|
|
||||||
import type { ServerSideEditViewProps } from '../../../../../packages/payload/types.js'
|
|
||||||
|
|
||||||
import { customTabViewComponentTitle } from '../../../shared.js'
|
import { customTabViewComponentTitle } from '../../../shared.js'
|
||||||
|
|
||||||
export const CustomTabComponentView: React.FC<ServerSideEditViewProps> = ({ initPageResult }) => {
|
export const CustomTabComponentView: React.FC<ServerSideEditViewProps> = ({ initPageResult }) => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { EditViewComponent } from 'payload'
|
import type { EditViewComponent } from 'payload'
|
||||||
|
|
||||||
import { SetStepNav } from '@payloadcms/ui/elements/StepNav'
|
import { SetStepNav } from '@payloadcms/ui'
|
||||||
import { notFound } from 'next/navigation.js'
|
import { notFound } from 'next/navigation.js'
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { EditViewComponent } from 'payload'
|
import type { EditViewComponent } from 'payload'
|
||||||
|
|
||||||
import { SetStepNav } from '@payloadcms/ui/elements/StepNav'
|
import { SetStepNav } from '@payloadcms/ui'
|
||||||
import { notFound } from 'next/navigation.js'
|
import { notFound } from 'next/navigation.js'
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { EditViewComponent } from 'payload'
|
import type { EditViewComponent } from 'payload'
|
||||||
|
|
||||||
import { SetStepNav } from '@payloadcms/ui/elements/StepNav'
|
import { SetStepNav } from '@payloadcms/ui'
|
||||||
import { notFound, redirect } from 'next/navigation.js'
|
import { notFound, redirect } from 'next/navigation.js'
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { ConfirmPassword } from '@payloadcms/ui/fields/ConfirmPassword'
|
|
||||||
import { Password } from '@payloadcms/ui/fields/Password'
|
import {
|
||||||
import { Form, useFormFields } from '@payloadcms/ui/forms/Form'
|
ConfirmPasswordField,
|
||||||
import { FormSubmit } from '@payloadcms/ui/forms/Submit'
|
Form,
|
||||||
|
FormSubmit,
|
||||||
|
PasswordField,
|
||||||
|
useFormFields,
|
||||||
|
} from '@payloadcms/ui'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export const ClientForm: React.FC = () => {
|
export const ClientForm: React.FC = () => {
|
||||||
@@ -22,7 +26,7 @@ export const ClientForm: React.FC = () => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<CustomPassword />
|
<CustomPassword />
|
||||||
<ConfirmPassword />
|
<ConfirmPasswordField />
|
||||||
<FormSubmit>Submit</FormSubmit>
|
<FormSubmit>Submit</FormSubmit>
|
||||||
</Form>
|
</Form>
|
||||||
)
|
)
|
||||||
@@ -36,7 +40,7 @@ const CustomPassword: React.FC = () => {
|
|||||||
const confirmValue = confirmPassword.value
|
const confirmValue = confirmPassword.value
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Password
|
<PasswordField
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
label="Password"
|
label="Password"
|
||||||
name="password"
|
name="password"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import React from 'react'
|
|||||||
|
|
||||||
const Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default
|
const Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default
|
||||||
|
|
||||||
import { Button } from '@payloadcms/ui/elements/Button'
|
import { Button } from '@payloadcms/ui'
|
||||||
|
|
||||||
import { customNestedViewPath, customViewTitle } from '../../../shared.js'
|
import { customNestedViewPath, customViewTitle } from '../../../shared.js'
|
||||||
import { ClientForm } from './index.client.js'
|
import { ClientForm } from './index.client.js'
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { Button } from '@payloadcms/ui/elements/Button'
|
import type { AdminViewProps } from 'payload'
|
||||||
|
|
||||||
|
import { Button } from '@payloadcms/ui'
|
||||||
import LinkImport from 'next/link.js'
|
import LinkImport from 'next/link.js'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import type { AdminViewProps } from '../../../../../packages/payload/types.js'
|
|
||||||
|
|
||||||
import { customNestedViewTitle, customViewPath } from '../../../shared.js'
|
import { customNestedViewTitle, customViewPath } from '../../../shared.js'
|
||||||
|
|
||||||
const Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default
|
const Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { Button } from '@payloadcms/ui/elements/Button'
|
import { Button } from '@payloadcms/ui'
|
||||||
import LinkImport from 'next/link.js'
|
import LinkImport from 'next/link.js'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import type { AdminViewProps } from '../../../../../packages/payload/types.js'
|
|
||||||
|
|
||||||
const Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default
|
const Link = (LinkImport.default || LinkImport) as unknown as typeof LinkImport.default
|
||||||
|
|
||||||
|
import type { AdminViewProps } from 'payload'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
customParamViewPath,
|
customParamViewPath,
|
||||||
customParamViewPathBase,
|
customParamViewPathBase,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import type { UIField, User } from 'payload'
|
import type { UIField, User } from 'payload'
|
||||||
|
|
||||||
import { useAuth } from '@payloadcms/ui/providers/Auth'
|
import { useAuth } from '@payloadcms/ui'
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
|
|
||||||
export const AuthDebug: React.FC<UIField> = () => {
|
export const AuthDebug: React.FC<UIField> = () => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { UIField, User } from 'payload'
|
import type { UIField, User } from 'payload'
|
||||||
|
|
||||||
import { useAuth } from '@payloadcms/ui/providers/Auth'
|
import { useAuth } from '@payloadcms/ui'
|
||||||
import React, { useEffect, useState } from 'react'
|
import React, { useEffect, useState } from 'react'
|
||||||
|
|
||||||
export const AuthDebug: React.FC<UIField> = () => {
|
export const AuthDebug: React.FC<UIField> = () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useField } from '@payloadcms/ui/forms/useField'
|
import { useField } from '@payloadcms/ui'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
import { collection1Slug } from '../collectionSlugs.js'
|
import { collection1Slug } from '../collectionSlugs.js'
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const filename = fileURLToPath(import.meta.url)
|
|||||||
const dirname = path.dirname(filename)
|
const dirname = path.dirname(filename)
|
||||||
import type { CollectionConfig, FilterOptionsProps } from 'payload'
|
import type { CollectionConfig, FilterOptionsProps } from 'payload'
|
||||||
|
|
||||||
import { withMergedProps } from '@payloadcms/ui/elements/withMergedProps'
|
import { withMergedProps } from '@payloadcms/ui/shared'
|
||||||
|
|
||||||
import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
|
import { buildConfigWithDefaults } from '../buildConfigWithDefaults.js'
|
||||||
import { devUser } from '../credentials.js'
|
import { devUser } from '../credentials.js'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import type { RowLabelComponent } from 'payload'
|
import type { RowLabelComponent } from 'payload'
|
||||||
|
|
||||||
import { useRowLabel } from '@payloadcms/ui/forms/RowLabel/Context'
|
import { useRowLabel } from '@payloadcms/ui'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export const ArrayRowLabel: RowLabelComponent = () => {
|
export const ArrayRowLabel: RowLabelComponent = () => {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useForm } from '@payloadcms/ui/forms/Form'
|
import { useField, useForm } from '@payloadcms/ui'
|
||||||
import { useField } from '@payloadcms/ui/forms/useField'
|
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
import { blockFieldsSlug } from '../../../../slugs.js'
|
import { blockFieldsSlug } from '../../../../slugs.js'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useRowLabel } from '@payloadcms/ui/forms/RowLabel/Context'
|
import { useRowLabel } from '@payloadcms/ui'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export const CustomLabelComponent: React.FC<{
|
export const CustomLabelComponent: React.FC<{
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useRowLabel } from '@payloadcms/ui/forms/RowLabel/Context'
|
import { useRowLabel } from '@payloadcms/ui'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export const NestedCustomLabel: React.FC = () => {
|
export const NestedCustomLabel: React.FC = () => {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useFormFields, useFormSubmitted } from '@payloadcms/ui/forms/Form'
|
import { useField, useFormFields, useFormSubmitted } from '@payloadcms/ui'
|
||||||
import { useField } from '@payloadcms/ui/forms/useField'
|
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
const CustomError: React.FC<any> = (props) => {
|
const CustomError: React.FC<any> = (props) => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'
|
import { useFieldProps } from '@payloadcms/ui'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
const CustomLabel = ({ schemaPath }) => {
|
const CustomLabel = ({ schemaPath }) => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'
|
import { useFieldProps } from '@payloadcms/ui'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export const UICustomClient: React.FC = () => {
|
export const UICustomClient: React.FC = () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
import { useTranslation } from '@payloadcms/ui'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import type { CustomTranslationsKeys, CustomTranslationsObject } from './config.js'
|
import type { CustomTranslationsKeys, CustomTranslationsObject } from './config.js'
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useTranslation } from '@payloadcms/ui/providers/Translation'
|
import { useTranslation } from '@payloadcms/ui'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
export const ComponentWithDefaultI18n = () => {
|
export const ComponentWithDefaultI18n = () => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useLivePreview } from '@payloadcms/live-preview-react'
|
import { useLivePreview } from '@payloadcms/live-preview-react'
|
||||||
import { Gutter } from '@payloadcms/ui/elements/Gutter'
|
import { Gutter } from '@payloadcms/ui'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import type { Post as PostType } from '../../../../../payload-types.js'
|
import type { Post as PostType } from '../../../../../payload-types.js'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Gutter } from '@payloadcms/ui/elements/Gutter'
|
import { Gutter } from '@payloadcms/ui'
|
||||||
import { notFound } from 'next/navigation.js'
|
import { notFound } from 'next/navigation.js'
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Gutter } from '@payloadcms/ui/elements/Gutter'
|
import { Gutter } from '@payloadcms/ui'
|
||||||
import { notFound } from 'next/navigation.js'
|
import { notFound } from 'next/navigation.js'
|
||||||
import React, { Fragment } from 'react'
|
import React, { Fragment } from 'react'
|
||||||
|
|
||||||
|
|||||||
@@ -8,124 +8,123 @@
|
|||||||
|
|
||||||
export interface Config {
|
export interface Config {
|
||||||
collections: {
|
collections: {
|
||||||
users: User
|
users: User;
|
||||||
pages: Page
|
pages: Page;
|
||||||
media: Media
|
media: Media;
|
||||||
'payload-preferences': PayloadPreference
|
'payload-preferences': PayloadPreference;
|
||||||
'payload-migrations': PayloadMigration
|
'payload-migrations': PayloadMigration;
|
||||||
}
|
};
|
||||||
globals: {}
|
globals: {};
|
||||||
locale: 'en' | 'es' | 'de'
|
locale: 'en' | 'es' | 'de';
|
||||||
user: User & {
|
user: User & {
|
||||||
collection: 'users'
|
collection: 'users';
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "users".
|
* via the `definition` "users".
|
||||||
*/
|
*/
|
||||||
export interface User {
|
export interface User {
|
||||||
id: string
|
id: string;
|
||||||
updatedAt: string
|
updatedAt: string;
|
||||||
createdAt: string
|
createdAt: string;
|
||||||
email: string
|
email: string;
|
||||||
resetPasswordToken?: string | null
|
resetPasswordToken?: string | null;
|
||||||
resetPasswordExpiration?: string | null
|
resetPasswordExpiration?: string | null;
|
||||||
salt?: string | null
|
salt?: string | null;
|
||||||
hash?: string | null
|
hash?: string | null;
|
||||||
loginAttempts?: number | null
|
loginAttempts?: number | null;
|
||||||
lockUntil?: string | null
|
lockUntil?: string | null;
|
||||||
password?: string | null
|
password?: string | null;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "pages".
|
* via the `definition` "pages".
|
||||||
*/
|
*/
|
||||||
export interface Page {
|
export interface Page {
|
||||||
id: string
|
id: string;
|
||||||
title: string
|
title: string;
|
||||||
excerpt?: string | null
|
excerpt?: string | null;
|
||||||
slug: string
|
slug: string;
|
||||||
meta: {
|
meta?: {
|
||||||
title: string
|
title?: string | null;
|
||||||
description?: string | null
|
description?: string | null;
|
||||||
image?: string | Media | null
|
};
|
||||||
ogTitle?: string | null
|
updatedAt: string;
|
||||||
}
|
createdAt: string;
|
||||||
updatedAt: string
|
_status?: ('draft' | 'published') | null;
|
||||||
createdAt: string
|
|
||||||
_status?: ('draft' | 'published') | null
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "media".
|
* via the `definition` "media".
|
||||||
*/
|
*/
|
||||||
export interface Media {
|
export interface Media {
|
||||||
id: string
|
id: string;
|
||||||
media?: string | Media | null
|
media?: string | Media | null;
|
||||||
richText?: {
|
richText?: {
|
||||||
root: {
|
root: {
|
||||||
type: string
|
type: string;
|
||||||
children: {
|
children: {
|
||||||
type: string
|
type: string;
|
||||||
version: number
|
version: number;
|
||||||
[k: string]: unknown
|
[k: string]: unknown;
|
||||||
}[]
|
}[];
|
||||||
direction: ('ltr' | 'rtl') | null
|
direction: ('ltr' | 'rtl') | null;
|
||||||
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''
|
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
|
||||||
indent: number
|
indent: number;
|
||||||
version: number
|
version: number;
|
||||||
}
|
};
|
||||||
[k: string]: unknown
|
[k: string]: unknown;
|
||||||
} | null
|
} | null;
|
||||||
updatedAt: string
|
updatedAt: string;
|
||||||
createdAt: string
|
createdAt: string;
|
||||||
url?: string | null
|
url?: string | null;
|
||||||
thumbnailURL?: string | null
|
thumbnailURL?: string | null;
|
||||||
filename?: string | null
|
filename?: string | null;
|
||||||
mimeType?: string | null
|
mimeType?: string | null;
|
||||||
filesize?: number | null
|
filesize?: number | null;
|
||||||
width?: number | null
|
width?: number | null;
|
||||||
height?: number | null
|
height?: number | null;
|
||||||
focalX?: number | null
|
focalX?: number | null;
|
||||||
focalY?: number | null
|
focalY?: number | null;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "payload-preferences".
|
* via the `definition` "payload-preferences".
|
||||||
*/
|
*/
|
||||||
export interface PayloadPreference {
|
export interface PayloadPreference {
|
||||||
id: string
|
id: string;
|
||||||
user: {
|
user: {
|
||||||
relationTo: 'users'
|
relationTo: 'users';
|
||||||
value: string | User
|
value: string | User;
|
||||||
}
|
};
|
||||||
key?: string | null
|
key?: string | null;
|
||||||
value?:
|
value?:
|
||||||
| {
|
| {
|
||||||
[k: string]: unknown
|
[k: string]: unknown;
|
||||||
}
|
}
|
||||||
| unknown[]
|
| unknown[]
|
||||||
| string
|
| string
|
||||||
| number
|
| number
|
||||||
| boolean
|
| boolean
|
||||||
| null
|
| null;
|
||||||
updatedAt: string
|
updatedAt: string;
|
||||||
createdAt: string
|
createdAt: string;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "payload-migrations".
|
* via the `definition` "payload-migrations".
|
||||||
*/
|
*/
|
||||||
export interface PayloadMigration {
|
export interface PayloadMigration {
|
||||||
id: string
|
id: string;
|
||||||
name?: string | null
|
name?: string | null;
|
||||||
batch?: number | null
|
batch?: number | null;
|
||||||
updatedAt: string
|
updatedAt: string;
|
||||||
createdAt: string
|
createdAt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
declare module 'payload' {
|
declare module 'payload' {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
export interface GeneratedTypes extends Config {}
|
export interface GeneratedTypes extends Config {}
|
||||||
}
|
}
|
||||||
@@ -27,20 +27,18 @@
|
|||||||
],
|
],
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@payloadcms/ui/assets": ["../packages/ui/src/assets/index.ts"],
|
"@payloadcms/ui": [
|
||||||
"@payloadcms/ui/elements/*": ["../packages/ui/src/elements/*/index.tsx"],
|
"../packages/ui/src/exports/client/index.ts"
|
||||||
"@payloadcms/ui/fields/*": ["../packages/ui/src/fields/*/index.tsx"],
|
],
|
||||||
"@payloadcms/ui/forms/*": ["../packages/ui/src/forms/*/index.tsx"],
|
"@payloadcms/ui/shared": [
|
||||||
"@payloadcms/ui/graphics/*": ["../packages/ui/src/graphics/*/index.tsx"],
|
"../packages/ui/src/exports/shared/index.ts"
|
||||||
"@payloadcms/ui/hooks/*": ["../packages/ui/src/hooks/*.ts"],
|
],
|
||||||
"@payloadcms/ui/icons/*": ["../packages/ui/src/icons/*/index.tsx"],
|
"@payloadcms/ui/scss": [
|
||||||
"@payloadcms/ui/providers/*": ["../packages/ui/src/providers/*/index.tsx"],
|
"../packages/ui/src/scss.scss"
|
||||||
"@payloadcms/ui/templates/*": ["../packages/ui/src/templates/*/index.tsx"],
|
],
|
||||||
"@payloadcms/ui/utilities/*": ["../packages/ui/src/utilities/*.ts"],
|
"@payloadcms/ui/scss/app.scss": [
|
||||||
"@payloadcms/ui/scss": ["../packages/ui/src/scss.scss"],
|
"../packages/ui/src/scss/app.scss"
|
||||||
"@payloadcms/ui": ["../packages/ui/src/exports/client/index.ts"],
|
],
|
||||||
"@payloadcms/ui/server": ["../packages/ui/src/exports/shared/index.ts"],
|
|
||||||
"@payloadcms/ui/scss/app.scss": ["../packages/ui/src/scss/app.scss"],
|
|
||||||
"@payloadcms/next/*": ["./packages/next/src/exports/*.ts"],
|
"@payloadcms/next/*": ["./packages/next/src/exports/*.ts"],
|
||||||
"@payload-config": ["./_community/config.ts"]
|
"@payload-config": ["./_community/config.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import type { CustomPublishButton as CustomPublishButtonType } from 'payload'
|
import type { CustomPublishButton as CustomPublishButtonType } from 'payload'
|
||||||
|
|
||||||
import { DefaultPublishButton } from '@payloadcms/ui/elements/PublishButton'
|
import { DefaultPublishButton } from '@payloadcms/ui'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
||||||
import classes from './index.module.scss'
|
import classes from './index.module.scss'
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
],
|
],
|
||||||
"paths": {
|
"paths": {
|
||||||
"@payload-config": [
|
"@payload-config": [
|
||||||
"./test/fields/config.ts"
|
"./test/_community/config.ts"
|
||||||
],
|
],
|
||||||
"@payloadcms/live-preview": [
|
"@payloadcms/live-preview": [
|
||||||
"./packages/live-preview/src"
|
"./packages/live-preview/src"
|
||||||
@@ -45,41 +45,11 @@
|
|||||||
"@payloadcms/live-preview-react": [
|
"@payloadcms/live-preview-react": [
|
||||||
"./packages/live-preview-react/src/index.ts"
|
"./packages/live-preview-react/src/index.ts"
|
||||||
],
|
],
|
||||||
"@payloadcms/ui/assets": [
|
|
||||||
"./packages/ui/src/assets/index.ts"
|
|
||||||
],
|
|
||||||
"@payloadcms/ui/elements/*": [
|
|
||||||
"./packages/ui/src/elements/*/index.tsx"
|
|
||||||
],
|
|
||||||
"@payloadcms/ui/fields/*": [
|
|
||||||
"./packages/ui/src/fields/*/index.tsx"
|
|
||||||
],
|
|
||||||
"@payloadcms/ui/forms/*": [
|
|
||||||
"./packages/ui/src/forms/*/index.tsx"
|
|
||||||
],
|
|
||||||
"@payloadcms/ui/graphics/*": [
|
|
||||||
"./packages/ui/src/graphics/*/index.tsx"
|
|
||||||
],
|
|
||||||
"@payloadcms/ui/hooks/*": [
|
|
||||||
"./packages/ui/src/hooks/*.ts"
|
|
||||||
],
|
|
||||||
"@payloadcms/ui/icons/*": [
|
|
||||||
"./packages/ui/src/icons/*/index.tsx"
|
|
||||||
],
|
|
||||||
"@payloadcms/ui/providers/*": [
|
|
||||||
"./packages/ui/src/providers/*/index.tsx"
|
|
||||||
],
|
|
||||||
"@payloadcms/ui/templates/*": [
|
|
||||||
"./packages/ui/src/templates/*/index.tsx"
|
|
||||||
],
|
|
||||||
"@payloadcms/ui/utilities/*": [
|
|
||||||
"./packages/ui/src/utilities/*.ts"
|
|
||||||
],
|
|
||||||
"@payloadcms/ui": [
|
"@payloadcms/ui": [
|
||||||
"./packages/ui/src/exports/client/index.ts"
|
"./packages/ui/src/exports/client/index.ts"
|
||||||
],
|
],
|
||||||
"@payloadcms/ui/shared": [
|
"@payloadcms/ui/shared": [
|
||||||
"packages/ui/src/exports/shared/index.ts"
|
"./packages/ui/src/exports/shared/index.ts"
|
||||||
],
|
],
|
||||||
"@payloadcms/ui/scss": [
|
"@payloadcms/ui/scss": [
|
||||||
"./packages/ui/src/scss.scss"
|
"./packages/ui/src/scss.scss"
|
||||||
|
|||||||
Reference in New Issue
Block a user