chore: converts more files in ui package to esm

This commit is contained in:
PatrikKozak
2024-03-07 09:55:51 -05:00
parent e06022e4d4
commit 539503f766
38 changed files with 182 additions and 177 deletions

View File

@@ -1,10 +1,10 @@
'use client' 'use client'
import React from 'react' import React from 'react'
import type { Props } from './types' import type { Props } from './types.d.ts'
import { useTableColumns } from '../TableColumns' import { useTableColumns } from '../TableColumns/index.js'
import { TableCellProvider } from './TableCellProvider' import { TableCellProvider } from './TableCellProvider/index.js'
import './index.scss' import './index.scss'
const baseClass = 'table' const baseClass = 'table'

View File

@@ -2,12 +2,12 @@ import type { CellProps, SanitizedCollectionConfig } from 'payload/types'
import React from 'react' import React from 'react'
import type { ColumnPreferences } from '../../providers/ListInfo/types' import type { ColumnPreferences } from '../../providers/ListInfo/types.d.ts'
import type { FieldMap } from '../../utilities/buildComponentMap/types' import type { FieldMap } from '../../utilities/buildComponentMap/types.d.ts'
import type { Column } from '../Table/types' import type { Column } from '../Table/types.d.ts'
import { SelectAll } from '../SelectAll' import { SelectAll } from '../SelectAll/index.js'
import { SelectRow } from '../SelectRow' import { SelectRow } from '../SelectRow/index.js'
export const buildColumns = (args: { export const buildColumns = (args: {
cellProps: Partial<CellProps>[] cellProps: Partial<CellProps>[]

View File

@@ -1,4 +1,4 @@
import type { Column } from '../Table/types' import type { Column } from '../Table/types.d.ts'
type TOGGLE = { type TOGGLE = {
payload: { payload: {

View File

@@ -4,15 +4,15 @@ import type { CellProps } from 'payload/types'
import React, { createContext, useCallback, useContext, useEffect, useReducer, useRef } from 'react' import React, { createContext, useCallback, useContext, useEffect, useReducer, useRef } from 'react'
import type { ColumnPreferences } from '../../providers/ListInfo/types' import type { ColumnPreferences } from '../../providers/ListInfo/types.d.ts'
import type { Column } from '../Table/types' import type { Column } from '../Table/types.d.ts'
import type { Action } from './columnReducer' import type { Action } from './columnReducer.js'
import { useComponentMap } from '../../providers/ComponentMapProvider' import { useComponentMap } from '../../providers/ComponentMapProvider/index.js'
import { useConfig } from '../../providers/Config' import { useConfig } from '../../providers/Config/index.js'
import { usePreferences } from '../../providers/Preferences' import { usePreferences } from '../../providers/Preferences/index.js'
import { buildColumns } from './buildColumns' import { buildColumns } from './buildColumns.js'
import { columnReducer } from './columnReducer' import { columnReducer } from './columnReducer.js'
export interface ITableColumns { export interface ITableColumns {
columns: Column[] columns: Column[]

View File

@@ -1,10 +1,10 @@
'use client' 'use client'
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import type { Props } from './types' import type { Props } from './types.d.ts'
import FileGraphic from '../../graphics/File' import FileGraphic from '../../graphics/File/index.js'
import useThumbnail from '../../hooks/useThumbnail' import useThumbnail from '../../hooks/useThumbnail.js'
import './index.scss' import './index.scss'
const baseClass = 'thumbnail' const baseClass = 'thumbnail'

View File

@@ -1,10 +1,10 @@
import React from 'react' import React from 'react'
import type { Props } from './types' import type { Props } from './types.d.ts'
import { useTranslation } from '../../providers/Translation' import { useTranslation } from '../../providers/Translation/index.js'
import { formatDocTitle } from '../../utilities/formatDocTitle' import { formatDocTitle } from '../../utilities/formatDocTitle.js'
import Thumbnail from '../Thumbnail' import Thumbnail from '../Thumbnail/index.js'
import './index.scss' import './index.scss'
const baseClass = 'thumbnail-card' const baseClass = 'thumbnail-card'

View File

@@ -1,9 +1,9 @@
'use client' 'use client'
import React, { useEffect } from 'react' import React, { useEffect } from 'react'
import type { Props } from './types' import type { Props } from './types.d.ts'
import { useIntersect } from '../../hooks/useIntersect' import { useIntersect } from '../../hooks/useIntersect.js'
import './index.scss' import './index.scss'
export const Tooltip: React.FC<Props> = (props) => { export const Tooltip: React.FC<Props> = (props) => {

View File

@@ -4,17 +4,17 @@ import { getTranslation } from '@payloadcms/translations'
import React, { useCallback, useState } from 'react' import React, { useCallback, useState } from 'react'
import { toast } from 'react-toastify' import { toast } from 'react-toastify'
import type { Props } from './types' import type { Props } from './types.d.ts'
import { useAuth } from '../../providers/Auth' import { useAuth } from '../../providers/Auth/index.js'
import { useConfig } from '../../providers/Config' import { useConfig } from '../../providers/Config/index.js'
import { useSearchParams } from '../../providers/SearchParams' import { useSearchParams } from '../../providers/SearchParams/index.js'
import { SelectAllStatus, useSelection } from '../../providers/SelectionProvider' import { SelectAllStatus, useSelection } from '../../providers/SelectionProvider/index.js'
import { useTranslation } from '../../providers/Translation' import { useTranslation } from '../../providers/Translation/index.js'
import { MinimalTemplate } from '../../templates/Minimal' import { MinimalTemplate } from '../../templates/Minimal/index.js'
import { requests } from '../../utilities/api' import { requests } from '../../utilities/api.js'
import { Button } from '../Button' import { Button } from '../Button/index.js'
import Pill from '../Pill' import Pill from '../Pill/index.js'
import './index.scss' import './index.scss'
const baseClass = 'unpublish-many' const baseClass = 'unpublish-many'

View File

@@ -2,22 +2,22 @@
import { isImage } from 'payload/utilities' import { isImage } from 'payload/utilities'
import React, { useCallback, useEffect, useState } from 'react' import React, { useCallback, useEffect, useState } from 'react'
import type { Props } from './types' import type { Props } from './types.d.ts'
import Error from '../../forms/Error' import Error from '../../forms/Error/index.js'
import { useFormSubmitted } from '../../forms/Form/context' import { useFormSubmitted } from '../../forms/Form/context.js'
import reduceFieldsToValues from '../../forms/Form/reduceFieldsToValues' import reduceFieldsToValues from '../../forms/Form/reduceFieldsToValues.js'
import { fieldBaseClass } from '../../forms/fields/shared' import { fieldBaseClass } from '../../forms/fields/shared.js'
import useField from '../../forms/useField' import useField from '../../forms/useField/index.js'
import { useDocumentInfo } from '../../providers/DocumentInfo' import { useDocumentInfo } from '../../providers/DocumentInfo/index.js'
import { useTranslation } from '../../providers/Translation' import { useTranslation } from '../../providers/Translation/index.js'
import { Button } from '../Button' import { Button } from '../Button/index.js'
import { Drawer, DrawerToggler } from '../Drawer' import { Drawer, DrawerToggler } from '../Drawer/index.js'
import { Dropzone } from '../Dropzone' import { Dropzone } from '../Dropzone/index.js'
import { EditUpload } from '../EditUpload' import { EditUpload } from '../EditUpload/index.js'
import FileDetails from '../FileDetails' import FileDetails from '../FileDetails/index.js'
import PreviewSizes from '../PreviewSizes' import PreviewSizes from '../PreviewSizes/index.js'
import Thumbnail from '../Thumbnail' import Thumbnail from '../Thumbnail/index.js'
import './index.scss' import './index.scss'
const baseClass = 'file-field' const baseClass = 'file-field'

View File

@@ -2,11 +2,11 @@
import { getTranslation } from '@payloadcms/translations' import { getTranslation } from '@payloadcms/translations'
import React from 'react' import React from 'react'
import type { Props } from './types' import type { Props } from './types.d.ts'
import { useTranslation } from '../../providers/Translation' import { useTranslation } from '../../providers/Translation/index.js'
import './index.scss' import './index.scss'
import { isComponent } from './types' import { isComponent } from './types.js'
const ViewDescription: React.FC<Props> = (props) => { const ViewDescription: React.FC<Props> = (props) => {
const { i18n } = useTranslation() const { i18n } = useTranslation()

View File

@@ -1,8 +1,8 @@
import React from 'react' import React from 'react'
import type { Props } from './types' import type { Props } from './types.d.ts'
import DatePicker from '../../../DatePicker' import DatePicker from '../../../DatePicker/index.js'
const baseClass = 'condition-value-date' const baseClass = 'condition-value-date'

View File

@@ -1,4 +1,4 @@
import type { Props as DateType } from '../../../../elements/DatePicker/types' import type { Props as DateType } from '../../../../elements/DatePicker/types.d.ts'
export type Props = { export type Props = {
admin?: { admin?: {

View File

@@ -1,8 +1,8 @@
import React from 'react' import React from 'react'
import type { Props } from './types' import type { Props } from './types.d.ts'
import { useTranslation } from '../../../../providers/Translation' import { useTranslation } from '../../../../providers/Translation/index.js'
import './index.scss' import './index.scss'
const baseClass = 'condition-value-number' const baseClass = 'condition-value-number'

View File

@@ -2,15 +2,15 @@ import type { PaginatedDocs } from 'payload/database'
import React, { useCallback, useEffect, useReducer, useState } from 'react' import React, { useCallback, useEffect, useReducer, useState } from 'react'
import type { Option } from '../../../ReactSelect/types' import type { Option } from '../../../ReactSelect/types.d.ts'
import type { GetResults, Props, ValueWithRelation } from './types' import type { GetResults, Props, ValueWithRelation } from './types.d.ts'
import useDebounce from '../../../../hooks/useDebounce' import useDebounce from '../../../../hooks/useDebounce.js'
import { useConfig } from '../../../../providers/Config' import { useConfig } from '../../../../providers/Config/index.js'
import { useTranslation } from '../../../../providers/Translation' import { useTranslation } from '../../../../providers/Translation/index.js'
import ReactSelect from '../../../ReactSelect' import ReactSelect from '../../../ReactSelect/index.js'
import './index.scss' import './index.scss'
import optionsReducer from './optionsReducer' import optionsReducer from './optionsReducer.js'
const baseClass = 'condition-value-relationship' const baseClass = 'condition-value-relationship'
@@ -38,7 +38,7 @@ const RelationshipField: React.FC<Props> = (props) => {
const addOptions = useCallback( const addOptions = useCallback(
(data, relation) => { (data, relation) => {
const collection = collections.find((coll) => coll.slug === relation) const collection = collections.find((coll) => coll.slug === relation)
dispatchOptions({ collection, data, hasMultipleRelations, i18n, relation, type: 'ADD' }) dispatchOptions({ type: 'ADD', collection, data, hasMultipleRelations, i18n, relation })
}, },
[collections, hasMultipleRelations, i18n], [collections, hasMultipleRelations, i18n],
) )
@@ -200,9 +200,9 @@ const RelationshipField: React.FC<Props> = (props) => {
useEffect(() => { useEffect(() => {
dispatchOptions({ dispatchOptions({
type: 'CLEAR',
i18n, i18n,
required: true, required: true,
type: 'CLEAR',
}) })
setHasLoadedFirstOptions(true) setHasLoadedFirstOptions(true)

View File

@@ -1,6 +1,6 @@
import { getTranslation } from '@payloadcms/translations' import { getTranslation } from '@payloadcms/translations'
import type { Action, Option } from './types' import type { Action, Option } from './types.d.ts'
const reduceToIDs = (options) => const reduceToIDs = (options) =>
options.reduce((ids, option) => { options.reduce((ids, option) => {

View File

@@ -3,10 +3,10 @@ import type { Option, OptionObject } from 'payload/types'
import { getTranslation } from '@payloadcms/translations' import { getTranslation } from '@payloadcms/translations'
import React from 'react' import React from 'react'
import type { Props } from './types' import type { Props } from './types.d.ts'
import { useTranslation } from '../../../../providers/Translation' import { useTranslation } from '../../../../providers/Translation/index.js'
import ReactSelect from '../../../ReactSelect' import ReactSelect from '../../../ReactSelect/index.js'
const formatOptions = (options: Option[]): OptionObject[] => const formatOptions = (options: Option[]): OptionObject[] =>
options.map((option) => { options.map((option) => {

View File

@@ -1,8 +1,8 @@
import React from 'react' import React from 'react'
import type { Props } from './types' import type { Props } from './types.d.ts'
import { useTranslation } from '../../../../providers/Translation' import { useTranslation } from '../../../../providers/Translation/index.js'
import './index.scss' import './index.scss'
const baseClass = 'condition-value-text' const baseClass = 'condition-value-text'

View File

@@ -1,17 +1,17 @@
import React, { useEffect, useState } from 'react' import React, { useEffect, useState } from 'react'
import type { FieldCondition } from '../types' import type { FieldCondition } from '../types.d.ts'
import type { Props } from './types' import type { Props } from './types.d.ts'
import { RenderCustomComponent } from '../../../elements/RenderCustomComponent' import { RenderCustomComponent } from '../../../elements/RenderCustomComponent/index.js'
import useDebounce from '../../../hooks/useDebounce' import useDebounce from '../../../hooks/useDebounce.js'
import { Button } from '../../Button' import { Button } from '../../Button/index.js'
import ReactSelect from '../../ReactSelect' import ReactSelect from '../../ReactSelect/index.js'
import Date from './Date' import Date from './Date/index.js'
import Number from './Number' import Number from './Number/index.js'
import Relationship from './Relationship' import Relationship from './Relationship/index.js'
import { Select } from './Select' import { Select } from './Select/index.js'
import Text from './Text' import Text from './Text/index.js'
import './index.scss' import './index.scss'
const valueFields = { const valueFields = {
@@ -52,9 +52,9 @@ const Condition: React.FC<Props> = (props) => {
useEffect(() => { useEffect(() => {
dispatch({ dispatch({
type: 'update',
andIndex, andIndex,
orIndex, orIndex,
type: 'update',
value: debouncedValue || '', value: debouncedValue || '',
}) })
}, [debouncedValue, dispatch, orIndex, andIndex]) }, [debouncedValue, dispatch, orIndex, andIndex])
@@ -80,10 +80,10 @@ const Condition: React.FC<Props> = (props) => {
isClearable={false} isClearable={false}
onChange={(field) => { onChange={(field) => {
dispatch({ dispatch({
andIndex: andIndex,
field: field?.value,
orIndex: orIndex,
type: 'update', type: 'update',
andIndex,
field: field?.value,
orIndex,
}) })
}} }}
options={fields} options={fields}
@@ -96,10 +96,10 @@ const Condition: React.FC<Props> = (props) => {
isClearable={false} isClearable={false}
onChange={(operator) => { onChange={(operator) => {
dispatch({ dispatch({
type: 'update',
andIndex, andIndex,
operator: operator.value, operator: operator.value,
orIndex, orIndex,
type: 'update',
}) })
setInternalOperatorField(operator.value) setInternalOperatorField(operator.value)
}} }}
@@ -134,9 +134,9 @@ const Condition: React.FC<Props> = (props) => {
iconStyle="with-border" iconStyle="with-border"
onClick={() => onClick={() =>
dispatch({ dispatch({
type: 'remove',
andIndex, andIndex,
orIndex, orIndex,
type: 'remove',
}) })
} }
round round
@@ -148,11 +148,11 @@ const Condition: React.FC<Props> = (props) => {
iconStyle="with-border" iconStyle="with-border"
onClick={() => onClick={() =>
dispatch({ dispatch({
type: 'add',
andIndex: andIndex + 1, andIndex: andIndex + 1,
field: fields[0].value, field: fields[0].value,
orIndex, orIndex,
relation: 'and', relation: 'and',
type: 'add',
}) })
} }
round round

View File

@@ -1,6 +1,6 @@
import type { Where } from 'payload/types' import type { Where } from 'payload/types'
import type { Action, FieldCondition } from '../types' import type { Action, FieldCondition } from '../types.d.ts'
export type Props = { export type Props = {
andIndex: number andIndex: number

View File

@@ -4,19 +4,19 @@ import { flattenTopLevelFields } from 'payload/utilities'
import React, { useReducer, useState } from 'react' import React, { useReducer, useState } from 'react'
// import type { Where } from 'payload/types' // import type { Where } from 'payload/types'
import type { Props } from './types' import type { Props } from './types.d.ts'
import { useConfig } from '../../providers/Config' import { useConfig } from '../../providers/Config/index.js'
// import useThrottledEffect from '../../hooks/useThrottledEffect' // import useThrottledEffect from '../../hooks/useThrottledEffect'
import { useSearchParams } from '../../providers/SearchParams' import { useSearchParams } from '../../providers/SearchParams/index.js'
import { useTranslation } from '../../providers/Translation' import { useTranslation } from '../../providers/Translation/index.js'
import { Button } from '../Button' import { Button } from '../Button/index.js'
import Condition from './Condition' import Condition from './Condition/index.js'
import fieldTypes from './field-types' import fieldTypes from './field-types.js'
import './index.scss' import './index.scss'
import reducer from './reducer' import reducer from './reducer.js'
import { transformWhereQuery } from './transformWhereQuery' import { transformWhereQuery } from './transformWhereQuery.js'
import validateWhereQuery from './validateWhereQuery' import validateWhereQuery from './validateWhereQuery.js'
const baseClass = 'where-builder' const baseClass = 'where-builder'

View File

@@ -1,6 +1,6 @@
import type { Where } from 'payload/types' import type { Where } from 'payload/types'
import type { Action } from './types' import type { Action } from './types.d.ts'
const reducer = (state: Where[], action: Action): Where[] => { const reducer = (state: Where[], action: Action): Where[] => {
const newState = [...state] const newState = [...state]

View File

@@ -1,32 +1,36 @@
export { useActions } from '../providers/ActionsProvider' export { useActions } from '../providers/ActionsProvider/index.js'
export { useAuth } from '../providers/Auth' export { useAuth } from '../providers/Auth/index.js'
export { ClientFunctionProvider, useAddClientFunction } from '../providers/ClientFunction' export { ClientFunctionProvider, useAddClientFunction } from '../providers/ClientFunction/index.js'
export { useClientFunctions } from '../providers/ClientFunction' export { useClientFunctions } from '../providers/ClientFunction/index.js'
export { useComponentMap } from '../providers/ComponentMapProvider' export { useComponentMap } from '../providers/ComponentMapProvider/index.js'
export type { IComponentMapContext } from '../providers/ComponentMapProvider' export type { IComponentMapContext } from '../providers/ComponentMapProvider/index.js'
export { ConfigProvider, useConfig } from '../providers/Config' export { ConfigProvider, useConfig } from '../providers/Config/index.js'
export { CustomProvider } from '../providers/CustomProvider' export { CustomProvider } from '../providers/CustomProvider/index.js'
export { useDocumentEvents } from '../providers/DocumentEvents' export { useDocumentEvents } from '../providers/DocumentEvents/index.js'
export { useDocumentInfo } from '../providers/DocumentInfo' export { SetDocumentInfo } from '../providers/DocumentInfo/SetDocumentInfo/index.js'
export { useDocumentInfo } from '../providers/DocumentInfo/index.js'
export { export {
type DocumentInfo, type DocumentInfo,
type DocumentInfoContext, type DocumentInfoContext,
type DocumentInfoProps, type DocumentInfoProps,
DocumentInfoProvider, DocumentInfoProvider,
} from '../providers/DocumentInfo' } from '../providers/DocumentInfo/index.js'
export { SetDocumentInfo } from '../providers/DocumentInfo/SetDocumentInfo' export { EditDepthContext, EditDepthProvider } from '../providers/EditDepth/index.js'
export { EditDepthContext, EditDepthProvider } from '../providers/EditDepth' export { useEditDepth } from '../providers/EditDepth/index.js'
export { useEditDepth } from '../providers/EditDepth' export { FormQueryParams, FormQueryParamsProvider } from '../providers/FormQueryParams/index.js'
export { FormQueryParams, FormQueryParamsProvider } from '../providers/FormQueryParams' export type { QueryParamTypes } from '../providers/FormQueryParams/index.js'
export type { QueryParamTypes } from '../providers/FormQueryParams' export { useFormQueryParams } from '../providers/FormQueryParams/index.js'
export { useFormQueryParams } from '../providers/FormQueryParams' export { useListInfo } from '../providers/ListInfo/index.js'
export { useListInfo } from '../providers/ListInfo' export { ListInfoProvider } from '../providers/ListInfo/index.js'
export { ListInfoProvider } from '../providers/ListInfo' export type { ColumnPreferences } from '../providers/ListInfo/types.d.ts'
export type { ColumnPreferences } from '../providers/ListInfo/types' export { useLocale } from '../providers/Locale/index.js'
export { useLocale } from '../providers/Locale' export { OperationProvider } from '../providers/OperationProvider/index.js'
export { OperationProvider } from '../providers/OperationProvider' export { RootProvider } from '../providers/Root/index.js'
export { RootProvider } from '../providers/Root' export {
export { SelectAllStatus, SelectionProvider, useSelection } from '../providers/SelectionProvider' SelectAllStatus,
export { useTheme } from '../providers/Theme' SelectionProvider,
export type { Theme } from '../providers/Theme/types' useSelection,
export { useTranslation } from '../providers/Translation' } from '../providers/SelectionProvider/index.js'
export { useTheme } from '../providers/Theme/index.js'
export type { Theme } from '../providers/Theme/types.d.ts'
export { useTranslation } from '../providers/Translation/index.js'

View File

@@ -1,2 +1,2 @@
export { DefaultTemplate } from '../templates/Default' export { DefaultTemplate } from '../templates/Default/index.js'
export { MinimalTemplate } from '../templates/Minimal' export { MinimalTemplate } from '../templates/Minimal/index.js'

View File

@@ -6,5 +6,5 @@ import type React from 'react'
// @example // @example
// import { Link } from 'next/link' // import { Link } from 'next/link'
export type LinkType = React.ElementType export type LinkType = React.ElementType
export type { FormFieldBase } from '../forms/fields/shared' export type { FormFieldBase } from '../forms/fields/shared.d.ts'
export type { ReducedBlock } from '../utilities/buildComponentMap/types' export type { ReducedBlock } from '../utilities/buildComponentMap/types.d.ts'

View File

@@ -1,13 +1,13 @@
export { mapFields } from '../utilities/buildComponentMap/mapFields' export { mapFields } from '../utilities/buildComponentMap/mapFields.js'
export type { FieldMap, MappedField } from '../utilities/buildComponentMap/types' export type { FieldMap, MappedField } from '../utilities/buildComponentMap/types.d.ts'
export { buildFieldSchemaMap } from '../utilities/buildFieldSchemaMap' export { buildFieldSchemaMap } from '../utilities/buildFieldSchemaMap/index.js'
export type { FieldSchemaMap } from '../utilities/buildFieldSchemaMap/types' export type { FieldSchemaMap } from '../utilities/buildFieldSchemaMap/types.d.ts'
export { default as canUseDOM } from '../utilities/canUseDOM' export { default as canUseDOM } from '../utilities/canUseDOM.js'
export { findLocaleFromCode } from '../utilities/findLocaleFromCode' export { findLocaleFromCode } from '../utilities/findLocaleFromCode.js'
export { formatDate } from '../utilities/formatDate' export { formatDate } from '../utilities/formatDate/index.js'
export { formatDocTitle } from '../utilities/formatDocTitle' export { formatDocTitle } from '../utilities/formatDocTitle.js'
export { formatFields } from '../utilities/formatFields' export { formatFields } from '../utilities/formatFields.js'
export { getFormState } from '../utilities/getFormState' export { getFormState } from '../utilities/getFormState.js'
export type { EntityToGroup, Group } from '../utilities/groupNavItems' export type { EntityToGroup, Group } from '../utilities/groupNavItems.d.ts'
export { EntityType, groupNavItems } from '../utilities/groupNavItems' export { EntityType, groupNavItems } from '../utilities/groupNavItems.js'
export { withMergedProps } from '../utilities/withMergedProps' export { withMergedProps } from '../utilities/withMergedProps/index.js'

View File

@@ -3,7 +3,7 @@ import md5 from 'md5'
import qs from 'qs' import qs from 'qs'
import React from 'react' import React from 'react'
import { useAuth } from '../../../providers/Auth' import { useAuth } from '../../../providers/Auth/index.js'
const Gravatar: React.FC = () => { const Gravatar: React.FC = () => {
const { user } = useAuth() const { user } = useAuth()

View File

@@ -1,11 +1,11 @@
'use client' 'use client'
import { usePathname } from 'next/navigation' import { usePathname } from 'next/navigation.js'
import React from 'react' import React from 'react'
import { useAuth } from '../../providers/Auth' import { useAuth } from '../../providers/Auth/index.js'
import { useConfig } from '../../providers/Config' import { useConfig } from '../../providers/Config/index.js'
import { DefaultAccountIcon } from './Default' import { DefaultAccountIcon } from './Default/index.js'
import Gravatar from './Gravatar' import Gravatar from './Gravatar/index.js'
const Account = () => { const Account = () => {
const { const {

View File

@@ -1,8 +1,8 @@
import React from 'react' import React from 'react'
import { RenderCustomComponent } from '../../elements/RenderCustomComponent' import { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'
import { useConfig } from '../../providers/Config' import { useConfig } from '../../providers/Config/index.js'
import { useTranslation } from '../../providers/Translation' import { useTranslation } from '../../providers/Translation/index.js'
const css = ` const css = `
.graphic-icon { .graphic-icon {

View File

@@ -2,7 +2,7 @@ import type { SanitizedConfig } from 'payload/config'
import React from 'react' import React from 'react'
import { RenderCustomComponent } from '../../elements/RenderCustomComponent' import { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'
const css = ` const css = `
.graphic-logo path { .graphic-logo path {

View File

@@ -1,6 +1,7 @@
import type { GetAdminThumbnail } from 'payload/types' import type { GetAdminThumbnail } from 'payload/types'
import { useAddClientFunction, useDocumentInfo } from '..' import { useAddClientFunction } from '../providers/ClientFunction/index.js'
import { useDocumentInfo } from '../providers/DocumentInfo/index.js'
export const useAdminThumbnail = (func: GetAdminThumbnail) => { export const useAdminThumbnail = (func: GetAdminThumbnail) => {
const { collectionSlug } = useDocumentInfo() const { collectionSlug } = useDocumentInfo()

View File

@@ -1,6 +1,6 @@
import * as React from 'react' import * as React from 'react'
import { useDelay } from './useDelay' import { useDelay } from './useDelay.js'
type DelayedRenderProps = { type DelayedRenderProps = {
/** Time in ms to wait before "mounting" the component. */ /** Time in ms to wait before "mounting" the component. */

View File

@@ -2,9 +2,9 @@
import queryString from 'qs' import queryString from 'qs'
import { useEffect, useRef, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import { useLocale } from '../providers/Locale' import { useLocale } from '../providers/Locale/index.js'
import { useTranslation } from '../providers/Translation' import { useTranslation } from '../providers/Translation/index.js'
import { requests } from '../utilities/api' import { requests } from '../utilities/api.js'
type Result = [ type Result = [
{ {

View File

@@ -2,8 +2,8 @@ import type { SanitizedCollectionConfig } from 'payload/types'
import { isImage } from 'payload/utilities' import { isImage } from 'payload/utilities'
import { useComponentMap } from '..' import { useComponentMap } from '../providers/ComponentMapProvider/index.js'
import { useConfig } from '../providers/Config' import { useConfig } from '../providers/Config/index.js'
const absoluteURLPattern = new RegExp('^(?:[a-z]+:)?//', 'i') const absoluteURLPattern = new RegExp('^(?:[a-z]+:)?//', 'i')
const base64Pattern = new RegExp(/^data:image\/[a-z]+;base64,/) const base64Pattern = new RegExp(/^data:image\/[a-z]+;base64,/)

View File

@@ -1 +1 @@
export * from './exports' export * from './exports/index.js'

View File

@@ -1,8 +1,8 @@
'use client' 'use client'
import React from 'react' import React from 'react'
import { Hamburger } from '../../../elements/Hamburger' import { Hamburger } from '../../../elements/Hamburger/index.js'
import { useNav } from '../../../elements/Nav/context' import { useNav } from '../../../elements/Nav/context.js'
export const NavHamburger: React.FC = () => { export const NavHamburger: React.FC = () => {
const { navOpen } = useNav() const { navOpen } = useNav()

View File

@@ -1,7 +1,7 @@
'use client' 'use client'
import React from 'react' import React from 'react'
import { useNav } from '../../../elements/Nav/context' import { useNav } from '../../../elements/Nav/context.js'
import './index.scss' import './index.scss'
export const Wrapper: React.FC<{ export const Wrapper: React.FC<{

View File

@@ -1,13 +1,13 @@
import React, { Fragment } from 'react' import React, { Fragment } from 'react'
import type { Props } from './types' import type { Props } from './types.d.ts'
import { AppHeader } from '../../elements/Header' import { AppHeader } from '../../elements/Header/index.js'
import { DefaultNav } from '../../elements/Nav' import { NavToggler } from '../../elements/Nav/NavToggler/index.js'
import { NavToggler } from '../../elements/Nav/NavToggler' import { DefaultNav } from '../../elements/Nav/index.js'
import { RenderCustomComponent } from '../../elements/RenderCustomComponent' import { RenderCustomComponent } from '../../elements/RenderCustomComponent/index.js'
import { NavHamburger } from './NavHamburger' import { NavHamburger } from './NavHamburger/index.js'
import { Wrapper } from './Wrapper' import { Wrapper } from './Wrapper/index.js'
import './index.scss' import './index.scss'
const baseClass = 'template-default' const baseClass = 'template-default'

View File

@@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import type { Props } from './types' import type { Props } from './types.d.ts'
import './index.scss' import './index.scss'