1
1
'use client'
2
+ import type { BlockField } from 'payload'
3
+
2
4
import { getTranslation } from '@payloadcms/translations'
3
5
import React , { Fragment , useCallback } from 'react'
4
6
7
+ import type { ReducedBlock } from '../../providers/ComponentMap/buildComponentMap/types.js'
8
+ import type { FormFieldBase } from '../shared/index.js'
9
+
5
10
import { Banner } from '../../elements/Banner/index.js'
6
11
import { Button } from '../../elements/Button/index.js'
7
12
import { DraggableSortableItem } from '../../elements/DraggableSortable/DraggableSortableItem/index.js'
8
13
import { DraggableSortable } from '../../elements/DraggableSortable/index.js'
9
14
import { DrawerToggler } from '../../elements/Drawer/index.js'
10
15
import { useDrawerSlug } from '../../elements/Drawer/useDrawerSlug.js'
11
16
import { ErrorPill } from '../../elements/ErrorPill/index.js'
17
+ import { useFieldProps } from '../../forms/FieldPropsProvider/index.js'
12
18
import { useForm , useFormSubmitted } from '../../forms/Form/context.js'
13
19
import { NullifyLocaleField } from '../../forms/NullifyField/index.js'
14
20
import { useField } from '../../forms/useField/index.js'
21
+ import { withCondition } from '../../forms/withCondition/index.js'
15
22
import { useConfig } from '../../providers/Config/index.js'
16
23
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js'
17
24
import { useLocale } from '../../providers/Locale/index.js'
18
25
import { useTranslation } from '../../providers/Translation/index.js'
19
26
import { scrollToID } from '../../utilities/scrollToID.js'
27
+ import { FieldDescription } from '../FieldDescription/index.js'
28
+ import { FieldError } from '../FieldError/index.js'
29
+ import { FieldLabel } from '../FieldLabel/index.js'
20
30
import { fieldBaseClass } from '../shared/index.js'
21
31
import { BlockRow } from './BlockRow.js'
22
32
import { BlocksDrawer } from './BlocksDrawer/index.js'
23
33
import './index.scss'
24
34
25
35
const baseClass = 'blocks-field'
26
36
27
- import type { BlockField , FieldPermissions } from 'payload'
28
-
29
- import type { ReducedBlock } from '../../providers/ComponentMap/buildComponentMap/types.js'
30
- import type { FormFieldBase } from '../shared/index.js'
31
-
32
- import { useFieldProps } from '../../forms/FieldPropsProvider/index.js'
33
- import { withCondition } from '../../forms/withCondition/index.js'
34
- import { FieldDescription } from '../FieldDescription/index.js'
35
- import { FieldError } from '../FieldError/index.js'
36
- import { FieldLabel } from '../FieldLabel/index.js'
37
-
38
37
export type BlocksFieldProps = FormFieldBase & {
39
38
blocks ?: ReducedBlock [ ]
40
39
forceRender ?: boolean
@@ -43,7 +42,6 @@ export type BlocksFieldProps = FormFieldBase & {
43
42
maxRows ?: number
44
43
minRows ?: number
45
44
name ?: string
46
- permissions : FieldPermissions
47
45
slug ?: string
48
46
width ?: string
49
47
}
0 commit comments