@elementor/editor-controls 3.32.0-73 → 3.32.0-75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-controls",
3
3
  "description": "This package contains the controls model and utils for the Elementor editor",
4
- "version": "3.32.0-73",
4
+ "version": "3.32.0-75",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,21 +40,21 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor-current-user": "3.32.0-73",
44
- "@elementor/editor-elements": "3.32.0-73",
45
- "@elementor/editor-props": "3.32.0-73",
46
- "@elementor/editor-responsive": "3.32.0-73",
47
- "@elementor/editor-ui": "3.32.0-73",
48
- "@elementor/editor-v1-adapters": "3.32.0-73",
49
- "@elementor/env": "3.32.0-73",
50
- "@elementor/http-client": "3.32.0-73",
43
+ "@elementor/editor-current-user": "3.32.0-75",
44
+ "@elementor/editor-elements": "3.32.0-75",
45
+ "@elementor/editor-props": "3.32.0-75",
46
+ "@elementor/editor-responsive": "3.32.0-75",
47
+ "@elementor/editor-ui": "3.32.0-75",
48
+ "@elementor/editor-v1-adapters": "3.32.0-75",
49
+ "@elementor/env": "3.32.0-75",
50
+ "@elementor/http-client": "3.32.0-75",
51
51
  "@elementor/icons": "^1.51.1",
52
- "@elementor/locations": "3.32.0-73",
53
- "@elementor/query": "3.32.0-73",
54
- "@elementor/session": "3.32.0-73",
52
+ "@elementor/locations": "3.32.0-75",
53
+ "@elementor/query": "3.32.0-75",
54
+ "@elementor/session": "3.32.0-75",
55
55
  "@elementor/ui": "1.36.8",
56
- "@elementor/utils": "3.32.0-73",
57
- "@elementor/wp-media": "3.32.0-73",
56
+ "@elementor/utils": "3.32.0-75",
57
+ "@elementor/wp-media": "3.32.0-75",
58
58
  "@wordpress/i18n": "^5.13.0",
59
59
  "@monaco-editor/react": "^4.7.0"
60
60
  },
@@ -26,7 +26,7 @@ export const TooltipAddItemAction = ( {
26
26
 
27
27
  return (
28
28
  <ConditionalToolTip content={ tooltipContent } enable={ enableTooltip }>
29
- <Box sx={ { ml: 'auto', cursor: disabled ? 'not-allowed' : 'pointer' } }>
29
+ <Box component="span" sx={ { cursor: disabled ? 'not-allowed' : 'pointer' } }>
30
30
  <IconButton
31
31
  size={ SIZE }
32
32
  disabled={ disabled }
@@ -4,31 +4,24 @@ import { Box, Stack, Typography } from '@elementor/ui';
4
4
  import { useBoundProp } from '../../../bound-prop-context/use-bound-prop';
5
5
  import { ControlAdornments } from '../../../control-adornments/control-adornments';
6
6
  import { SlotChildren } from '../../../control-replacements';
7
- import { TransformBaseControl } from '../../../controls/transform-control/transform-base-control';
8
7
  import { TooltipAddItemAction } from '../actions/tooltip-add-item-action';
9
8
  import { RepeaterHeaderActionsSlot } from '../locations';
10
9
 
11
- export const Header = ( { label, children }: React.PropsWithChildren< { label: string } > ) => {
10
+ export const Header = React.forwardRef( ( { label, children }: React.PropsWithChildren< { label: string } >, ref ) => {
12
11
  const { value } = useBoundProp();
13
12
 
14
13
  return (
15
- <Stack
16
- direction="row"
17
- justifyContent="start"
18
- alignItems="center"
19
- gap={ 1 }
20
- sx={ { marginInlineEnd: -0.75, py: 0.25 } }
21
- >
22
- <Typography component="label" variant="caption" color="text.secondary" sx={ { lineHeight: 1 } }>
23
- { label }
24
- </Typography>
25
- <ControlAdornments />
26
- <RepeaterHeaderActionsSlot value={ value } />
27
- <Box sx={ { ml: 'auto' } }>
28
- <SlotChildren whitelist={ [ TransformBaseControl, TooltipAddItemAction ] as React.FC[] } sorted>
29
- { children }
30
- </SlotChildren>
14
+ <Stack direction="row" alignItems="center" gap={ 1 } sx={ { marginInlineEnd: -0.75, py: 0.25 } } ref={ ref }>
15
+ <Box display="flex" alignItems="center" gap={ 1 } sx={ { flexGrow: 1 } }>
16
+ <Typography component="label" variant="caption" color="text.secondary" sx={ { lineHeight: 1 } }>
17
+ { label }
18
+ </Typography>
19
+ <ControlAdornments />
31
20
  </Box>
21
+ <RepeaterHeaderActionsSlot value={ value } />
22
+ <SlotChildren whitelist={ [ TooltipAddItemAction ] as React.FC[] } sorted>
23
+ { children }
24
+ </SlotChildren>
32
25
  </Stack>
33
26
  );
34
- };
27
+ } );
@@ -8,10 +8,9 @@ import { __ } from '@wordpress/i18n';
8
8
  import { PropKeyProvider, PropProvider, useBoundProp } from '../bound-prop-context';
9
9
  import { ControlFormLabel } from '../components/control-form-label';
10
10
  import { ControlLabel } from '../components/control-label';
11
- import { createControl } from '../create-control';
12
11
  import { SizeControl } from './size-control';
13
12
 
14
- export const GapControl = createControl( ( { label }: { label: string } ) => {
13
+ export const GapControl = ( { label }: { label: string } ) => {
15
14
  const {
16
15
  value: directionValue,
17
16
  setValue: setDirectionValue,
@@ -87,7 +86,7 @@ export const GapControl = createControl( ( { label }: { label: string } ) => {
87
86
  </Stack>
88
87
  </PropProvider>
89
88
  );
90
- } );
89
+ };
91
90
 
92
91
  const Control = ( {
93
92
  bind,
@@ -9,120 +9,117 @@ import { PropKeyProvider, PropProvider, useBoundProp } from '../bound-prop-conte
9
9
  import { ControlFormLabel } from '../components/control-form-label';
10
10
  import { ControlLabel } from '../components/control-label';
11
11
  import { StyledToggleButton } from '../components/control-toggle-button-group';
12
- import { createControl } from '../create-control';
13
12
  import { type ExtendedOption } from '../utils/size-control';
14
13
  import { SizeControl } from './size-control';
15
14
 
16
- export const LinkedDimensionsControl = createControl(
17
- ( {
18
- label,
19
- isSiteRtl = false,
20
- extendedOptions,
21
- min,
22
- }: {
23
- label: string;
24
- isSiteRtl?: boolean;
25
- extendedOptions?: ExtendedOption[];
26
- min?: number;
27
- } ) => {
28
- const {
29
- value: sizeValue,
30
- setValue: setSizeValue,
31
- disabled: sizeDisabled,
32
- placeholder: sizePlaceholder,
33
- } = useBoundProp( sizePropTypeUtil );
34
- const gridRowRefs: RefObject< HTMLDivElement >[] = [ useRef( null ), useRef( null ) ];
35
-
36
- const {
37
- value: dimensionsValue,
38
- setValue: setDimensionsValue,
39
- propType,
40
- placeholder: dimensionsPlaceholder,
41
- disabled: dimensionsDisabled,
42
- } = useBoundProp( dimensionsPropTypeUtil );
43
-
44
- const hasUserValues = !! ( dimensionsValue || sizeValue );
45
- const hasPlaceholders = !! ( sizePlaceholder || dimensionsPlaceholder );
46
-
47
- const isLinked =
48
- ( ! hasUserValues && ! hasPlaceholders ) || ( hasPlaceholders ? !! sizePlaceholder : !! sizeValue );
49
- const onLinkToggle = () => {
50
- if ( ! isLinked ) {
51
- setSizeValue( dimensionsValue[ 'block-start' ]?.value ?? null );
52
- return;
53
- }
54
-
55
- const value = sizeValue ? sizePropTypeUtil.create( sizeValue ) : null;
56
-
57
- setDimensionsValue( {
58
- 'block-start': value,
59
- 'block-end': value,
60
- 'inline-start': value,
61
- 'inline-end': value,
62
- } );
63
- };
64
-
65
- const tooltipLabel = label.toLowerCase();
66
-
67
- const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
68
- // translators: %s: Tooltip title.
69
- const linkedLabel = __( 'Link %s', 'elementor' ).replace( '%s', tooltipLabel );
70
- // translators: %s: Tooltip title.
71
- const unlinkedLabel = __( 'Unlink %s', 'elementor' ).replace( '%s', tooltipLabel );
72
-
73
- const disabled = sizeDisabled || dimensionsDisabled;
74
-
75
- return (
76
- <PropProvider
77
- propType={ propType }
78
- value={ dimensionsValue }
79
- setValue={ setDimensionsValue }
80
- placeholder={ dimensionsPlaceholder }
81
- isDisabled={ () => disabled }
82
- >
83
- <Stack direction="row" gap={ 2 } flexWrap="nowrap">
84
- <ControlFormLabel>{ label }</ControlFormLabel>
85
- <Tooltip title={ isLinked ? unlinkedLabel : linkedLabel } placement="top">
86
- <StyledToggleButton
87
- aria-label={ isLinked ? unlinkedLabel : linkedLabel }
88
- size={ 'tiny' }
89
- value={ 'check' }
90
- selected={ isLinked }
91
- sx={ { marginLeft: 'auto' } }
92
- onChange={ onLinkToggle }
93
- disabled={ disabled }
94
- isPlaceholder={ hasPlaceholders }
95
- >
96
- <LinkedIcon fontSize={ 'tiny' } />
97
- </StyledToggleButton>
98
- </Tooltip>
99
- </Stack>
15
+ export const LinkedDimensionsControl = ( {
16
+ label,
17
+ isSiteRtl = false,
18
+ extendedOptions,
19
+ min,
20
+ }: {
21
+ label: string;
22
+ isSiteRtl?: boolean;
23
+ extendedOptions?: ExtendedOption[];
24
+ min?: number;
25
+ } ) => {
26
+ const {
27
+ value: sizeValue,
28
+ setValue: setSizeValue,
29
+ disabled: sizeDisabled,
30
+ placeholder: sizePlaceholder,
31
+ } = useBoundProp( sizePropTypeUtil );
32
+ const gridRowRefs: RefObject< HTMLDivElement >[] = [ useRef( null ), useRef( null ) ];
33
+
34
+ const {
35
+ value: dimensionsValue,
36
+ setValue: setDimensionsValue,
37
+ propType,
38
+ placeholder: dimensionsPlaceholder,
39
+ disabled: dimensionsDisabled,
40
+ } = useBoundProp( dimensionsPropTypeUtil );
41
+
42
+ const hasUserValues = !! ( dimensionsValue || sizeValue );
43
+ const hasPlaceholders = !! ( sizePlaceholder || dimensionsPlaceholder );
44
+
45
+ const isLinked =
46
+ ( ! hasUserValues && ! hasPlaceholders ) || ( hasPlaceholders ? !! sizePlaceholder : !! sizeValue );
47
+ const onLinkToggle = () => {
48
+ if ( ! isLinked ) {
49
+ setSizeValue( dimensionsValue[ 'block-start' ]?.value ?? null );
50
+ return;
51
+ }
52
+
53
+ const value = sizeValue ? sizePropTypeUtil.create( sizeValue ) : null;
54
+
55
+ setDimensionsValue( {
56
+ 'block-start': value,
57
+ 'block-end': value,
58
+ 'inline-start': value,
59
+ 'inline-end': value,
60
+ } );
61
+ };
62
+
63
+ const tooltipLabel = label.toLowerCase();
64
+
65
+ const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
66
+ // translators: %s: Tooltip title.
67
+ const linkedLabel = __( 'Link %s', 'elementor' ).replace( '%s', tooltipLabel );
68
+ // translators: %s: Tooltip title.
69
+ const unlinkedLabel = __( 'Unlink %s', 'elementor' ).replace( '%s', tooltipLabel );
70
+
71
+ const disabled = sizeDisabled || dimensionsDisabled;
100
72
 
101
- { getCssDimensionProps( isSiteRtl ).map( ( row, index ) => (
102
- <Stack direction="row" gap={ 2 } flexWrap="nowrap" key={ index } ref={ gridRowRefs[ index ] }>
103
- { row.map( ( { icon, ...props } ) => (
104
- <Grid container gap={ 0.75 } alignItems="center" key={ props.bind }>
105
- <Grid item xs={ 12 }>
106
- <Label { ...props } />
107
- </Grid>
108
- <Grid item xs={ 12 }>
109
- <Control
110
- bind={ props.bind }
111
- startIcon={ icon }
112
- isLinked={ isLinked }
113
- extendedOptions={ extendedOptions }
114
- anchorRef={ gridRowRefs[ index ] }
115
- min={ min }
116
- />
117
- </Grid>
73
+ return (
74
+ <PropProvider
75
+ propType={ propType }
76
+ value={ dimensionsValue }
77
+ setValue={ setDimensionsValue }
78
+ placeholder={ dimensionsPlaceholder }
79
+ isDisabled={ () => disabled }
80
+ >
81
+ <Stack direction="row" gap={ 2 } flexWrap="nowrap">
82
+ <ControlFormLabel>{ label }</ControlFormLabel>
83
+ <Tooltip title={ isLinked ? unlinkedLabel : linkedLabel } placement="top">
84
+ <StyledToggleButton
85
+ aria-label={ isLinked ? unlinkedLabel : linkedLabel }
86
+ size={ 'tiny' }
87
+ value={ 'check' }
88
+ selected={ isLinked }
89
+ sx={ { marginLeft: 'auto' } }
90
+ onChange={ onLinkToggle }
91
+ disabled={ disabled }
92
+ isPlaceholder={ hasPlaceholders }
93
+ >
94
+ <LinkedIcon fontSize={ 'tiny' } />
95
+ </StyledToggleButton>
96
+ </Tooltip>
97
+ </Stack>
98
+
99
+ { getCssDimensionProps( isSiteRtl ).map( ( row, index ) => (
100
+ <Stack direction="row" gap={ 2 } flexWrap="nowrap" key={ index } ref={ gridRowRefs[ index ] }>
101
+ { row.map( ( { icon, ...props } ) => (
102
+ <Grid container gap={ 0.75 } alignItems="center" key={ props.bind }>
103
+ <Grid item xs={ 12 }>
104
+ <Label { ...props } />
118
105
  </Grid>
119
- ) ) }
120
- </Stack>
121
- ) ) }
122
- </PropProvider>
123
- );
124
- }
125
- );
106
+ <Grid item xs={ 12 }>
107
+ <Control
108
+ bind={ props.bind }
109
+ startIcon={ icon }
110
+ isLinked={ isLinked }
111
+ extendedOptions={ extendedOptions }
112
+ anchorRef={ gridRowRefs[ index ] }
113
+ min={ min }
114
+ />
115
+ </Grid>
116
+ </Grid>
117
+ ) ) }
118
+ </Stack>
119
+ ) ) }
120
+ </PropProvider>
121
+ );
122
+ };
126
123
 
127
124
  const Control = ( {
128
125
  bind,
@@ -1,53 +1,57 @@
1
1
  import * as React from 'react';
2
- import { useRef } from 'react';
3
2
  import { PopoverHeader } from '@elementor/editor-ui';
4
3
  import { AdjustmentsIcon } from '@elementor/icons';
5
- import { bindPopover, bindTrigger, Divider, IconButton, Popover, usePopupState } from '@elementor/ui';
4
+ import { bindPopover, Box, Divider, Popover, type PopupState } from '@elementor/ui';
6
5
  import { __ } from '@wordpress/i18n';
7
6
 
7
+ import { PropKeyProvider } from '../../bound-prop-context';
8
+ import { PopoverContent } from '../../components/popover-content';
8
9
  import { ChildrenPerspectiveControl } from './transform-base-controls/children-perspective-control';
9
10
  import { TransformOriginControl } from './transform-base-controls/transform-origin-control';
10
11
 
11
12
  const SIZE = 'tiny';
12
13
 
13
- export const TransformBaseControl = ( { anchorRef }: { anchorRef: React.RefObject< HTMLDivElement | null > } ) => {
14
- const rowRef = useRef< HTMLDivElement >( null );
15
- const popupState = usePopupState( { variant: 'popover' } );
14
+ export const TransformBaseControl = ( {
15
+ popupState,
16
+ anchorRef,
17
+ }: {
18
+ popupState: PopupState;
19
+ anchorRef: React.RefObject< HTMLDivElement | null >;
20
+ } ) => {
16
21
  const popupProps = bindPopover( {
17
22
  ...popupState,
18
23
  anchorEl: anchorRef.current ?? undefined,
19
24
  } );
20
25
 
21
26
  return (
22
- <>
23
- <IconButton
24
- size={ SIZE }
25
- aria-label={ __( 'Base Transform', 'elementor' ) }
26
- { ...bindTrigger( popupState ) }
27
- >
28
- <AdjustmentsIcon fontSize={ SIZE } />
29
- </IconButton>
30
- <Popover
31
- disablePortal
32
- slotProps={ {
33
- paper: {
34
- sx: {
35
- width: anchorRef.current?.offsetWidth + 'px',
36
- },
27
+ <Popover
28
+ disablePortal
29
+ anchorOrigin={ { vertical: 'bottom', horizontal: 'left' } }
30
+ slotProps={ {
31
+ paper: {
32
+ sx: {
33
+ width: ( anchorRef.current?.offsetWidth || 0 ) - 6 + 'px',
34
+ mt: 0.5,
37
35
  },
38
- } }
39
- { ...popupProps }
40
- >
41
- <PopoverHeader
42
- title={ __( 'Base Transform', 'elementor' ) }
43
- onClose={ popupState.close }
44
- icon={ <AdjustmentsIcon fontSize={ SIZE } /> }
45
- />
46
- <Divider />
47
- <TransformOriginControl rowRef={ rowRef } />
48
- <Divider />
49
- <ChildrenPerspectiveControl rowRef={ rowRef } />
50
- </Popover>
51
- </>
36
+ },
37
+ } }
38
+ { ...popupProps }
39
+ >
40
+ <PopoverHeader
41
+ title={ __( 'Base Transform', 'elementor' ) }
42
+ onClose={ popupState.close }
43
+ icon={ <AdjustmentsIcon fontSize={ SIZE } /> }
44
+ />
45
+ <Divider />
46
+ <PopoverContent sx={ { px: 2, py: 1.5 } }>
47
+ <PropKeyProvider bind={ 'transform-origin' }>
48
+ <TransformOriginControl />
49
+ </PropKeyProvider>
50
+ <Box sx={ { my: 0.5 } }>
51
+ <Divider />
52
+ </Box>
53
+ <ChildrenPerspectiveControl />
54
+ </PopoverContent>
55
+ </Popover>
52
56
  );
53
57
  };
@@ -1,78 +1,88 @@
1
1
  import * as React from 'react';
2
- import { sizePropTypeUtil } from '@elementor/editor-props';
3
- import { Divider, Grid, Stack } from '@elementor/ui';
2
+ import { perspectiveOriginPropTypeUtil } from '@elementor/editor-props';
3
+ import { Grid, Stack } from '@elementor/ui';
4
4
  import { __ } from '@wordpress/i18n';
5
5
 
6
6
  import { PropKeyProvider, PropProvider, useBoundProp } from '../../../bound-prop-context';
7
7
  import { ControlFormLabel } from '../../../components/control-form-label';
8
- import { ControlLabel } from '../../../components/control-label';
9
- import { lengthUnits } from '../../../utils/size-control';
8
+ import { PopoverGridContainer } from '../../../components/popover-grid-container';
9
+ import { type LengthUnit } from '../../../utils/size-control';
10
10
  import { SizeControl } from '../../size-control';
11
11
 
12
- const ORIGIN_UNITS = [ 'px', '%', 'em', 'rem' ] as ( 'px' | '%' | 'em' | 'rem' )[];
12
+ type FieldProps = {
13
+ label: string;
14
+ bind: string;
15
+ units: LengthUnit[];
16
+ };
13
17
 
14
- const CHILDREN_PERSPECTIVE_FIELDS = [
15
- {
16
- label: __( 'Perspective', 'elementor' ),
17
- bindValue: 'perspective',
18
- units: lengthUnits,
19
- },
18
+ const ORIGIN_UNITS: LengthUnit[] = [ 'px', '%', 'em', 'rem' ];
19
+
20
+ const PERSPECTIVE_CONTROL_FIELD: FieldProps = {
21
+ label: __( 'Perspective', 'elementor' ),
22
+ bind: 'perspective',
23
+ units: [ 'px', 'em', 'rem', 'vw', 'vh' ],
24
+ };
25
+
26
+ const CHILDREN_PERSPECTIVE_FIELDS: FieldProps[] = [
20
27
  {
21
28
  label: __( 'Origin X', 'elementor' ),
22
- bindValue: 'perspective-origin-x',
29
+ bind: 'x',
23
30
  units: ORIGIN_UNITS,
24
31
  },
25
32
  {
26
33
  label: __( 'Origin Y', 'elementor' ),
27
- bindValue: 'perspective-origin-y',
34
+ bind: 'y',
28
35
  units: ORIGIN_UNITS,
29
36
  },
30
37
  ] as const;
31
38
 
32
- export const ChildrenPerspectiveControl = ( { rowRef }: { rowRef: React.RefObject< HTMLDivElement > } ) => {
39
+ export const ChildrenPerspectiveControl = () => {
33
40
  return (
34
41
  <Stack direction="column" spacing={ 1.5 }>
35
- <ControlFormLabel sx={ { pt: 1.5, pl: 1.5 } }>
36
- { __( 'Children perspective', 'elementor' ) }
37
- </ControlFormLabel>
38
- <Grid container spacing={ 1.5 } ref={ rowRef }>
39
- { CHILDREN_PERSPECTIVE_FIELDS.map( ( control ) => (
40
- <ControlFields control={ control } rowRef={ rowRef } key={ control.bindValue } />
41
- ) ) }
42
- <Divider sx={ { py: 3 } } />
43
- </Grid>
42
+ <ControlFormLabel>{ __( 'Children perspective', 'elementor' ) }</ControlFormLabel>
43
+ <PerspectiveControl />
44
+ <PerspectiveOriginControl />
44
45
  </Stack>
45
46
  );
46
47
  };
47
48
 
48
- const ControlFields = ( {
49
- control,
50
- rowRef,
51
- }: {
52
- control: ( typeof CHILDREN_PERSPECTIVE_FIELDS )[ number ];
53
- rowRef: React.RefObject< HTMLDivElement >;
54
- } ) => {
55
- const context = useBoundProp( sizePropTypeUtil );
49
+ const PerspectiveControl = () => (
50
+ <PropKeyProvider bind={ 'perspective' }>
51
+ <ControlFields control={ PERSPECTIVE_CONTROL_FIELD } key={ PERSPECTIVE_CONTROL_FIELD.bind } />
52
+ </PropKeyProvider>
53
+ );
54
+
55
+ const PerspectiveOriginControl = () => (
56
+ <PropKeyProvider bind={ 'perspective-origin' }>
57
+ <PerspectiveOriginControlProvider />
58
+ </PropKeyProvider>
59
+ );
60
+
61
+ const PerspectiveOriginControlProvider = () => {
62
+ const context = useBoundProp( perspectiveOriginPropTypeUtil );
56
63
 
57
64
  return (
58
65
  <PropProvider { ...context }>
59
- <PropKeyProvider bind={ control.bindValue }>
60
- <Grid item xs={ 12 }>
61
- <Grid container spacing={ 1 } alignItems="center">
62
- <Grid item xs={ 6 }>
63
- <ControlLabel>{ control.label }</ControlLabel>
64
- </Grid>
65
- <Grid item xs={ 6 } sx={ { pr: 3 } }>
66
- <SizeControl
67
- variant="length"
68
- units={ [ ...control.units ] }
69
- anchorRef={ rowRef }
70
- disableCustom
71
- />
72
- </Grid>
73
- </Grid>
74
- </Grid>
75
- </PropKeyProvider>
66
+ { CHILDREN_PERSPECTIVE_FIELDS.map( ( control ) => (
67
+ <PropKeyProvider bind={ control.bind } key={ control.bind }>
68
+ <ControlFields control={ control } />
69
+ </PropKeyProvider>
70
+ ) ) }
76
71
  </PropProvider>
77
72
  );
78
73
  };
74
+
75
+ const ControlFields = ( { control }: { control: FieldProps } ) => {
76
+ const rowRef = React.useRef< HTMLDivElement >( null );
77
+
78
+ return (
79
+ <PopoverGridContainer ref={ rowRef }>
80
+ <Grid item xs={ 6 }>
81
+ <ControlFormLabel>{ control.label }</ControlFormLabel>
82
+ </Grid>
83
+ <Grid item xs={ 6 }>
84
+ <SizeControl variant="length" units={ control.units } anchorRef={ rowRef } disableCustom />
85
+ </Grid>
86
+ </PopoverGridContainer>
87
+ );
88
+ };