@elementor/editor-editing-panel 1.46.0 → 1.47.0

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/index.d.mts +12 -1
  3. package/dist/index.d.ts +12 -1
  4. package/dist/index.js +875 -753
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +787 -667
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +15 -15
  9. package/src/components/popover-scrollable-content.tsx +12 -0
  10. package/src/components/section-content.tsx +6 -16
  11. package/src/components/section.tsx +8 -4
  12. package/src/components/settings-tab.tsx +5 -2
  13. package/src/components/style-sections/background-section/background-section.tsx +4 -1
  14. package/src/components/style-sections/border-section/border-color-field.tsx +10 -16
  15. package/src/components/style-sections/border-section/border-radius-field.tsx +4 -2
  16. package/src/components/style-sections/border-section/border-style-field.tsx +11 -16
  17. package/src/components/style-sections/border-section/border-width-field.tsx +4 -2
  18. package/src/components/style-sections/effects-section/effects-section.tsx +19 -5
  19. package/src/components/style-sections/layout-section/align-content-field.tsx +11 -12
  20. package/src/components/style-sections/layout-section/align-items-field.tsx +8 -11
  21. package/src/components/style-sections/layout-section/align-self-child-field.tsx +11 -16
  22. package/src/components/style-sections/layout-section/display-field.tsx +6 -6
  23. package/src/components/style-sections/layout-section/flex-direction-field.tsx +11 -14
  24. package/src/components/style-sections/layout-section/flex-order-field.tsx +31 -34
  25. package/src/components/style-sections/layout-section/flex-size-field.tsx +28 -48
  26. package/src/components/style-sections/layout-section/gap-control-field.tsx +5 -6
  27. package/src/components/style-sections/layout-section/justify-content-field.tsx +11 -12
  28. package/src/components/style-sections/layout-section/opacity-control-field.tsx +9 -13
  29. package/src/components/style-sections/layout-section/wrap-field.tsx +10 -14
  30. package/src/components/style-sections/position-section/dimensions-field.tsx +4 -4
  31. package/src/components/style-sections/position-section/offset-field.tsx +12 -14
  32. package/src/components/style-sections/position-section/position-field.tsx +7 -11
  33. package/src/components/style-sections/position-section/z-index-field.tsx +7 -11
  34. package/src/components/style-sections/size-section/object-fit-field.tsx +7 -11
  35. package/src/components/style-sections/size-section/object-position-field.tsx +4 -1
  36. package/src/components/style-sections/size-section/overflow-field.tsx +7 -11
  37. package/src/components/style-sections/size-section/size-section.tsx +9 -7
  38. package/src/components/style-sections/spacing-section/spacing-section.tsx +7 -4
  39. package/src/components/style-sections/typography-section/column-count-field.tsx +7 -11
  40. package/src/components/style-sections/typography-section/column-gap-field.tsx +9 -13
  41. package/src/components/style-sections/typography-section/font-family-field.tsx +9 -11
  42. package/src/components/style-sections/typography-section/font-size-field.tsx +9 -13
  43. package/src/components/style-sections/typography-section/font-style-field.tsx +13 -13
  44. package/src/components/style-sections/typography-section/font-weight-field.tsx +7 -11
  45. package/src/components/style-sections/typography-section/letter-spacing-field.tsx +9 -13
  46. package/src/components/style-sections/typography-section/line-height-field.tsx +9 -13
  47. package/src/components/style-sections/typography-section/text-alignment-field.tsx +11 -14
  48. package/src/components/style-sections/typography-section/text-color-field.tsx +7 -11
  49. package/src/components/style-sections/typography-section/text-decoration-field.tsx +7 -11
  50. package/src/components/style-sections/typography-section/text-direction-field.tsx +7 -11
  51. package/src/components/style-sections/typography-section/text-stroke-field.tsx +4 -2
  52. package/src/components/style-sections/typography-section/transform-field.tsx +7 -11
  53. package/src/components/style-sections/typography-section/word-spacing-field.tsx +9 -13
  54. package/src/components/styles-field-layout.tsx +50 -0
  55. package/src/contexts/section-context.tsx +14 -0
  56. package/src/controls-registry/control-type-container.tsx +6 -2
  57. package/src/controls-registry/controls-registry.tsx +1 -1
  58. package/src/controls-registry/settings-field.tsx +65 -6
  59. package/src/controls-registry/styles-field.tsx +10 -2
  60. package/src/dynamics/components/dynamic-selection-control.tsx +10 -4
  61. package/src/dynamics/components/dynamic-selection.tsx +18 -14
  62. package/src/hooks/use-default-panel-settings.ts +4 -0
  63. package/src/index.ts +4 -0
  64. package/src/popover-action.tsx +8 -1
  65. package/src/styles-inheritance/components/styles-inheritance-indicator.tsx +4 -1
  66. package/src/styles-inheritance/components/styles-inheritance-infotip.tsx +9 -19
  67. package/src/sync/experiments-flags.ts +1 -0
  68. package/src/components/popover-content.tsx +0 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-editing-panel",
3
- "version": "1.46.0",
3
+ "version": "1.47.0",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,27 +39,27 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "0.20.0",
43
- "@elementor/editor-canvas": "0.24.0",
44
- "@elementor/editor-controls": "1.1.0",
42
+ "@elementor/editor": "0.20.1",
43
+ "@elementor/editor-canvas": "0.25.0",
44
+ "@elementor/editor-controls": "1.2.0",
45
45
  "@elementor/editor-current-user": "0.5.0",
46
- "@elementor/editor-documents": "0.13.7",
47
- "@elementor/editor-elements": "0.8.6",
48
- "@elementor/editor-panels": "0.16.0",
49
- "@elementor/editor-props": "0.14.0",
50
- "@elementor/editor-responsive": "0.13.5",
51
- "@elementor/editor-styles": "0.6.10",
52
- "@elementor/editor-styles-repository": "0.10.3",
53
- "@elementor/editor-ui": "0.12.0",
54
- "@elementor/editor-v1-adapters": "0.12.0",
46
+ "@elementor/editor-documents": "0.13.8",
47
+ "@elementor/editor-elements": "0.8.7",
48
+ "@elementor/editor-panels": "0.16.1",
49
+ "@elementor/editor-props": "0.15.0",
50
+ "@elementor/editor-responsive": "0.13.6",
51
+ "@elementor/editor-styles": "0.6.11",
52
+ "@elementor/editor-styles-repository": "0.10.4",
53
+ "@elementor/editor-ui": "0.13.0",
54
+ "@elementor/editor-v1-adapters": "0.12.1",
55
55
  "@elementor/icons": "1.44.0",
56
56
  "@elementor/locations": "0.8.0",
57
57
  "@elementor/menus": "0.1.5",
58
58
  "@elementor/schema": "0.1.2",
59
59
  "@elementor/session": "0.1.0",
60
60
  "@elementor/ui": "1.35.5",
61
- "@elementor/utils": "0.4.0",
62
- "@elementor/wp-media": "0.6.0",
61
+ "@elementor/utils": "0.5.0",
62
+ "@elementor/wp-media": "0.6.1",
63
63
  "@wordpress/i18n": "^5.13.0"
64
64
  },
65
65
  "peerDependencies": {
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { PopoverScrollableContent as BasePopoverScrollableContent } from '@elementor/editor-ui';
3
+
4
+ import { useSectionWidth } from '../contexts/section-context';
5
+
6
+ type Props = React.ComponentProps< typeof BasePopoverScrollableContent >;
7
+
8
+ export const PopoverScrollableContent = ( props: Props ) => {
9
+ const sectionWidth = useSectionWidth();
10
+
11
+ return <BasePopoverScrollableContent { ...props } width={ sectionWidth } />;
12
+ };
@@ -1,11 +1,7 @@
1
- import { createContext, type FC, type PropsWithChildren, useContext, useRef } from 'react';
1
+ import { type FC, type PropsWithChildren } from 'react';
2
2
  import * as React from 'react';
3
3
  import { Stack } from '@elementor/ui';
4
4
 
5
- const SectionContentRefContext = createContext< React.RefObject< HTMLElement > | null >( null );
6
-
7
- export const useSectionContentRef = () => useContext( SectionContentRefContext );
8
-
9
5
  type SectionContentProps = PropsWithChildren< {
10
6
  gap?: number;
11
7
  sx?: {
@@ -13,14 +9,8 @@ type SectionContentProps = PropsWithChildren< {
13
9
  };
14
10
  } >;
15
11
 
16
- export const SectionContent: FC< SectionContentProps > = ( { gap = 2, sx, children } ) => {
17
- const ref = useRef< HTMLElement >( null );
18
-
19
- return (
20
- <SectionContentRefContext.Provider value={ ref }>
21
- <Stack gap={ gap } sx={ { ...sx } } ref={ ref }>
22
- { children }
23
- </Stack>
24
- </SectionContentRefContext.Provider>
25
- );
26
- };
12
+ export const SectionContent: FC< SectionContentProps > = ( { gap = 2, sx, children } ) => (
13
+ <Stack gap={ gap } sx={ { ...sx } }>
14
+ { children }
15
+ </Stack>
16
+ );
@@ -1,8 +1,9 @@
1
1
  import * as React from 'react';
2
- import { type PropsWithChildren, type ReactNode, useId } from 'react';
2
+ import { type PropsWithChildren, type ReactNode, useId, useRef } from 'react';
3
3
  import { isExperimentActive } from '@elementor/editor-v1-adapters';
4
4
  import { Collapse, Divider, ListItemButton, ListItemText, Stack } from '@elementor/ui';
5
5
 
6
+ import { SectionRefContext } from '../contexts/section-context';
6
7
  import { useStateByElement } from '../hooks/use-state-by-element';
7
8
  import { EXPERIMENTAL_FEATURES } from '../sync/experiments-flags';
8
9
  import { CollapseIcon } from './collapse-icon';
@@ -16,6 +17,7 @@ type Props = PropsWithChildren< {
16
17
 
17
18
  export function Section( { title, children, defaultExpanded = false, titleEnd }: Props ) {
18
19
  const [ isOpen, setIsOpen ] = useStateByElement( title, !! defaultExpanded );
20
+ const ref = useRef< HTMLElement >( null );
19
21
 
20
22
  const handleClick = () => {
21
23
  setIsOpen( ! isOpen );
@@ -46,9 +48,11 @@ export function Section( { title, children, defaultExpanded = false, titleEnd }:
46
48
  <CollapseIcon open={ isOpen } color="secondary" fontSize="tiny" />
47
49
  </ListItemButton>
48
50
  <Collapse id={ contentId } aria-labelledby={ labelId } in={ isOpen } timeout="auto" unmountOnExit>
49
- <Stack gap={ 2.5 } p={ 2 }>
50
- { children }
51
- </Stack>
51
+ <SectionRefContext.Provider value={ ref }>
52
+ <Stack ref={ ref } gap={ 2.5 } p={ 2 }>
53
+ { children }
54
+ </Stack>
55
+ </SectionRefContext.Provider>
52
56
  </Collapse>
53
57
  <Divider />
54
58
  </>
@@ -70,12 +70,15 @@ const Control = ( { control }: { control: Control[ 'value' ] } ) => {
70
70
 
71
71
  const layout = control.meta?.layout || getDefaultLayout( control.type as ControlType );
72
72
  const controlProps = populateChildControlProps( control.props );
73
+ if ( layout === 'custom' ) {
74
+ controlProps.label = control.label;
75
+ }
73
76
 
74
77
  return (
75
- <SettingsField bind={ control.bind }>
78
+ <SettingsField bind={ control.bind } propDisplayName={ control.label || control.bind }>
76
79
  { control.meta?.topDivider && <Divider /> }
77
80
  <ControlTypeContainer layout={ layout }>
78
- { control.label ? <ControlFormLabel>{ control.label }</ControlFormLabel> : null }
81
+ { control.label && layout !== 'custom' ? <ControlFormLabel>{ control.label }</ControlFormLabel> : null }
79
82
  <BaseControl type={ control.type as ControlType } props={ controlProps } />
80
83
  </ControlTypeContainer>
81
84
  </SettingsField>
@@ -1,13 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import { BackgroundControl } from '@elementor/editor-controls';
3
+ import { __ } from '@wordpress/i18n';
3
4
 
4
5
  import { StylesField } from '../../../controls-registry/styles-field';
5
6
  import { SectionContent } from '../../section-content';
6
7
 
8
+ const BACKGROUND_LABEL = __( 'Background', 'elementor' );
9
+
7
10
  export const BackgroundSection = () => {
8
11
  return (
9
12
  <SectionContent>
10
- <StylesField bind="background">
13
+ <StylesField bind="background" propDisplayName={ BACKGROUND_LABEL }>
11
14
  <BackgroundControl />
12
15
  </StylesField>
13
16
  </SectionContent>
@@ -1,22 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import { ColorControl } from '@elementor/editor-controls';
3
- import { Grid } from '@elementor/ui';
4
3
  import { __ } from '@wordpress/i18n';
5
4
 
6
5
  import { StylesField } from '../../../controls-registry/styles-field';
7
- import { ControlLabel } from '../../control-label';
6
+ import { StylesFieldLayout } from '../../styles-field-layout';
8
7
 
9
- export const BorderColorField = () => {
10
- return (
11
- <StylesField bind={ 'border-color' }>
12
- <Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
13
- <Grid item xs={ 6 }>
14
- <ControlLabel>{ __( 'Border color', 'elementor' ) }</ControlLabel>
15
- </Grid>
16
- <Grid item xs={ 6 }>
17
- <ColorControl />
18
- </Grid>
19
- </Grid>
20
- </StylesField>
21
- );
22
- };
8
+ const BORDER_COLOR_LABEL = __( 'Border color', 'elementor' );
9
+
10
+ export const BorderColorField = () => (
11
+ <StylesField bind="border-color" propDisplayName={ BORDER_COLOR_LABEL }>
12
+ <StylesFieldLayout label={ BORDER_COLOR_LABEL }>
13
+ <ColorControl />
14
+ </StylesFieldLayout>
15
+ </StylesField>
16
+ );
@@ -15,6 +15,8 @@ import { StylesField } from '../../../controls-registry/styles-field';
15
15
  import { useDirection } from '../../../hooks/use-direction';
16
16
  import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
17
17
 
18
+ const BORDER_RADIUS_LABEL = __( 'Border radius', 'elementor' );
19
+
18
20
  const StartStartIcon = withDirection( RadiusTopLeftIcon );
19
21
  const StartEndIcon = withDirection( RadiusTopRightIcon );
20
22
  const EndStartIcon = withDirection( RadiusBottomLeftIcon );
@@ -57,10 +59,10 @@ export const BorderRadiusField = () => {
57
59
 
58
60
  return (
59
61
  <UiProviders>
60
- <StylesField bind={ 'border-radius' }>
62
+ <StylesField bind={ 'border-radius' } propDisplayName={ BORDER_RADIUS_LABEL }>
61
63
  <EqualUnequalSizesControl
62
64
  items={ getCorners( isSiteRtl ) }
63
- label={ __( 'Border radius', 'elementor' ) }
65
+ label={ BORDER_RADIUS_LABEL }
64
66
  icon={ <BorderCornersIcon fontSize={ 'tiny' } /> }
65
67
  tooltipLabel={ __( 'Adjust corners', 'elementor' ) }
66
68
  multiSizePropTypeUtil={ borderRadiusPropTypeUtil }
@@ -1,10 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { SelectControl } from '@elementor/editor-controls';
3
- import { Grid } from '@elementor/ui';
4
3
  import { __ } from '@wordpress/i18n';
5
4
 
6
5
  import { StylesField } from '../../../controls-registry/styles-field';
7
- import { ControlLabel } from '../../control-label';
6
+ import { StylesFieldLayout } from '../../styles-field-layout';
7
+
8
+ const BORDER_TYPE_LABEL = __( 'Border type', 'elementor' );
8
9
 
9
10
  const borderStyles = [
10
11
  { value: 'none', label: __( 'None', 'elementor' ) },
@@ -17,17 +18,11 @@ const borderStyles = [
17
18
  { value: 'inset', label: __( 'Inset', 'elementor' ) },
18
19
  { value: 'outset', label: __( 'Outset', 'elementor' ) },
19
20
  ];
20
- export const BorderStyleField = () => {
21
- return (
22
- <StylesField bind={ 'border-style' }>
23
- <Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
24
- <Grid item xs={ 6 }>
25
- <ControlLabel>{ __( 'Border type', 'elementor' ) }</ControlLabel>
26
- </Grid>
27
- <Grid item xs={ 6 } sx={ { overflow: 'hidden' } }>
28
- <SelectControl options={ borderStyles } />
29
- </Grid>
30
- </Grid>
31
- </StylesField>
32
- );
33
- };
21
+
22
+ export const BorderStyleField = () => (
23
+ <StylesField bind="border-style" propDisplayName={ BORDER_TYPE_LABEL }>
24
+ <StylesFieldLayout label={ BORDER_TYPE_LABEL }>
25
+ <SelectControl options={ borderStyles } />
26
+ </StylesFieldLayout>
27
+ </StylesField>
28
+ );
@@ -8,6 +8,8 @@ import { __ } from '@wordpress/i18n';
8
8
  import { StylesField } from '../../../controls-registry/styles-field';
9
9
  import { useDirection } from '../../../hooks/use-direction';
10
10
 
11
+ const BORDER_WIDTH_LABEL = __( 'Border width', 'elementor' );
12
+
11
13
  const InlineStartIcon = withDirection( SideRightIcon );
12
14
  const InlineEndIcon = withDirection( SideLeftIcon );
13
15
 
@@ -38,10 +40,10 @@ export const BorderWidthField = () => {
38
40
  const { isSiteRtl } = useDirection();
39
41
 
40
42
  return (
41
- <StylesField bind={ 'border-width' }>
43
+ <StylesField bind={ 'border-width' } propDisplayName={ BORDER_WIDTH_LABEL }>
42
44
  <EqualUnequalSizesControl
43
45
  items={ getEdges( isSiteRtl ) }
44
- label={ __( 'Border width', 'elementor' ) }
46
+ label={ BORDER_WIDTH_LABEL }
45
47
  icon={ <SideAllIcon fontSize={ 'tiny' } /> }
46
48
  tooltipLabel={ __( 'Adjust borders', 'elementor' ) }
47
49
  multiSizePropTypeUtil={ borderWidthPropTypeUtil }
@@ -1,21 +1,35 @@
1
1
  import * as React from 'react';
2
- import { BoxShadowRepeaterControl } from '@elementor/editor-controls';
2
+ import { BoxShadowRepeaterControl, FilterRepeaterControl } from '@elementor/editor-controls';
3
+ import { isExperimentActive } from '@elementor/editor-v1-adapters';
4
+ import { __ } from '@wordpress/i18n';
3
5
 
4
6
  import { StylesField } from '../../../controls-registry/styles-field';
7
+ import { EXPERIMENTAL_FEATURES } from '../../../sync/experiments-flags';
5
8
  import { PanelDivider } from '../../panel-divider';
6
9
  import { SectionContent } from '../../section-content';
7
10
  import { OpacityControlField } from '../layout-section/opacity-control-field';
8
11
 
12
+ const BOX_SHADOW_LABEL = __( 'Box shadow', 'elementor' );
13
+ const FILTER_LABEL = __( 'Filter', 'elementor' );
14
+
9
15
  export const EffectsSection = () => {
16
+ const isVersion331Active = isExperimentActive( EXPERIMENTAL_FEATURES.V_3_31 );
17
+
10
18
  return (
11
19
  <SectionContent>
12
- <StylesField bind="opacity">
13
- <OpacityControlField />
14
- </StylesField>
20
+ <OpacityControlField />
15
21
  <PanelDivider />
16
- <StylesField bind="box-shadow">
22
+ <StylesField bind="box-shadow" propDisplayName={ BOX_SHADOW_LABEL }>
17
23
  <BoxShadowRepeaterControl />
18
24
  </StylesField>
25
+ { isVersion331Active && (
26
+ <>
27
+ <PanelDivider />
28
+ <StylesField bind="filter" propDisplayName={ FILTER_LABEL }>
29
+ <FilterRepeaterControl />
30
+ </StylesField>
31
+ </>
32
+ ) }
19
33
  </SectionContent>
20
34
  );
21
35
  };
@@ -8,16 +8,18 @@ import {
8
8
  JustifySpaceBetweenVerticalIcon as BetweenIcon,
9
9
  JustifyTopIcon,
10
10
  } from '@elementor/icons';
11
- import { Stack, withDirection } from '@elementor/ui';
11
+ import { withDirection } from '@elementor/ui';
12
12
  import { __ } from '@wordpress/i18n';
13
13
 
14
14
  import { StylesField } from '../../../controls-registry/styles-field';
15
15
  import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
16
- import { ControlLabel } from '../../control-label';
16
+ import { StylesFieldLayout } from '../../styles-field-layout';
17
17
  import { RotatedIcon } from './utils/rotated-icon';
18
18
 
19
19
  type AlignContent = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
20
20
 
21
+ const ALIGN_CONTENT_LABEL = __( 'Align content', 'elementor' );
22
+
21
23
  const StartIcon = withDirection( JustifyTopIcon );
22
24
  const EndIcon = withDirection( JustifyBottomIcon );
23
25
 
@@ -66,15 +68,12 @@ const options: ToggleButtonGroupItem< AlignContent >[] = [
66
68
  },
67
69
  ];
68
70
 
69
- export const AlignContentField = () => {
70
- return (
71
+ export const AlignContentField = () => (
72
+ <StylesField bind="align-content" propDisplayName={ ALIGN_CONTENT_LABEL }>
71
73
  <UiProviders>
72
- <StylesField bind="align-content">
73
- <Stack gap={ 1 }>
74
- <ControlLabel>{ __( 'Align content', 'elementor' ) }</ControlLabel>
75
- <ToggleControl options={ options } fullWidth={ true } />
76
- </Stack>
77
- </StylesField>
74
+ <StylesFieldLayout label={ ALIGN_CONTENT_LABEL } direction="column">
75
+ <ToggleControl options={ options } fullWidth={ true } />
76
+ </StylesFieldLayout>
78
77
  </UiProviders>
79
- );
80
- };
78
+ </StylesField>
79
+ );
@@ -6,16 +6,18 @@ import {
6
6
  LayoutAlignRightIcon,
7
7
  LayoutDistributeVerticalIcon as JustifyIcon,
8
8
  } from '@elementor/icons';
9
- import { Grid, withDirection } from '@elementor/ui';
9
+ import { withDirection } from '@elementor/ui';
10
10
  import { __ } from '@wordpress/i18n';
11
11
 
12
12
  import { StylesField } from '../../../controls-registry/styles-field';
13
13
  import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
14
- import { ControlLabel } from '../../control-label';
14
+ import { StylesFieldLayout } from '../../styles-field-layout';
15
15
  import { RotatedIcon } from './utils/rotated-icon';
16
16
 
17
17
  type AlignItems = 'start' | 'center' | 'end' | 'stretch';
18
18
 
19
+ const ALIGN_ITEMS_LABEL = __( 'Align items', 'elementor' );
20
+
19
21
  const StartIcon = withDirection( LayoutAlignLeftIcon );
20
22
  const EndIcon = withDirection( LayoutAlignRightIcon );
21
23
 
@@ -54,15 +56,10 @@ const options: ToggleButtonGroupItem< AlignItems >[] = [
54
56
  export const AlignItemsField = () => {
55
57
  return (
56
58
  <UiProviders>
57
- <StylesField bind="align-items">
58
- <Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
59
- <Grid item xs={ 6 }>
60
- <ControlLabel>{ __( 'Align items', 'elementor' ) }</ControlLabel>
61
- </Grid>
62
- <Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
63
- <ToggleControl options={ options } />
64
- </Grid>
65
- </Grid>
59
+ <StylesField bind="align-items" propDisplayName={ ALIGN_ITEMS_LABEL }>
60
+ <StylesFieldLayout label={ ALIGN_ITEMS_LABEL }>
61
+ <ToggleControl options={ options } />
62
+ </StylesFieldLayout>
66
63
  </StylesField>
67
64
  </UiProviders>
68
65
  );
@@ -6,15 +6,17 @@ import {
6
6
  LayoutAlignRightIcon,
7
7
  LayoutDistributeVerticalIcon as JustifyIcon,
8
8
  } from '@elementor/icons';
9
- import { Grid, type ToggleButtonProps, withDirection } from '@elementor/ui';
9
+ import { type ToggleButtonProps, withDirection } from '@elementor/ui';
10
10
  import { __ } from '@wordpress/i18n';
11
11
 
12
12
  import { StylesField } from '../../../controls-registry/styles-field';
13
13
  import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
14
- import { ControlLabel } from '../../control-label';
14
+ import { StylesFieldLayout } from '../../styles-field-layout';
15
15
  import { type FlexDirection } from './flex-direction-field';
16
16
  import { RotatedIcon } from './utils/rotated-icon';
17
17
 
18
+ const ALIGN_SELF_LABEL = __( 'Align self', 'elementor' );
19
+
18
20
  const ALIGN_SELF_CHILD_OFFSET_MAP: Record< FlexDirection, number > = {
19
21
  row: 90,
20
22
  'row-reverse': 90,
@@ -84,19 +86,12 @@ const getOptions = ( parentStyleDirection: FlexDirection ) => [
84
86
  },
85
87
  ];
86
88
 
87
- export const AlignSelfChild = ( { parentStyleDirection }: { parentStyleDirection: FlexDirection } ) => {
88
- return (
89
+ export const AlignSelfChild = ( { parentStyleDirection }: { parentStyleDirection: FlexDirection } ) => (
90
+ <StylesField bind="align-self" propDisplayName={ ALIGN_SELF_LABEL }>
89
91
  <UiProviders>
90
- <StylesField bind={ 'align-self' }>
91
- <Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
92
- <Grid item xs={ 6 }>
93
- <ControlLabel>{ __( 'Align self', 'elementor' ) }</ControlLabel>
94
- </Grid>
95
- <Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'flex-end' } }>
96
- <ToggleControl options={ getOptions( parentStyleDirection as FlexDirection ) } />
97
- </Grid>
98
- </Grid>
99
- </StylesField>
92
+ <StylesFieldLayout label={ ALIGN_SELF_LABEL }>
93
+ <ToggleControl options={ getOptions( parentStyleDirection ) } />
94
+ </StylesFieldLayout>
100
95
  </UiProviders>
101
- );
102
- };
96
+ </StylesField>
97
+ );
@@ -1,16 +1,17 @@
1
1
  import * as React from 'react';
2
2
  import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
3
3
  import { isExperimentActive } from '@elementor/editor-v1-adapters';
4
- import { Stack } from '@elementor/ui';
5
4
  import { __ } from '@wordpress/i18n';
6
5
 
7
6
  import { useStylesInheritanceChain } from '../../../contexts/styles-inheritance-context';
8
7
  import { StylesField } from '../../../controls-registry/styles-field';
9
8
  import { EXPERIMENTAL_FEATURES } from '../../../sync/experiments-flags';
10
- import { ControlLabel } from '../../control-label';
9
+ import { StylesFieldLayout } from '../../styles-field-layout';
11
10
 
12
11
  type Displays = 'block' | 'flex' | 'inline-block' | 'inline-flex' | 'none';
13
12
 
13
+ const DISPLAY_LABEL = __( 'Display', 'elementor' );
14
+
14
15
  const displayFieldItems: ToggleButtonGroupItem< Displays >[] = [
15
16
  {
16
17
  value: 'block',
@@ -55,11 +56,10 @@ export const DisplayField = () => {
55
56
  const placeholder = useDisplayPlaceholderValue();
56
57
 
57
58
  return (
58
- <StylesField bind="display" placeholder={ placeholder }>
59
- <Stack gap={ 0.75 }>
60
- <ControlLabel>{ __( 'Display', 'elementor' ) }</ControlLabel>
59
+ <StylesField bind="display" propDisplayName={ DISPLAY_LABEL } placeholder={ placeholder }>
60
+ <StylesFieldLayout label={ DISPLAY_LABEL } direction="column">
61
61
  <ToggleControl options={ items } maxItems={ 4 } fullWidth={ true } />
62
- </Stack>
62
+ </StylesFieldLayout>
63
63
  </StylesField>
64
64
  );
65
65
  };
@@ -1,15 +1,17 @@
1
1
  import * as React from 'react';
2
2
  import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
3
3
  import { ArrowDownSmallIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpSmallIcon } from '@elementor/icons';
4
- import { Grid, withDirection } from '@elementor/ui';
4
+ import { withDirection } from '@elementor/ui';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
7
  import { StylesField } from '../../../controls-registry/styles-field';
8
8
  import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
9
- import { ControlLabel } from '../../control-label';
9
+ import { StylesFieldLayout } from '../../styles-field-layout';
10
10
 
11
11
  export type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
12
12
 
13
+ const FLEX_DIRECTION_LABEL = __( 'Direction', 'elementor' );
14
+
13
15
  const options: ToggleButtonGroupItem< FlexDirection >[] = [
14
16
  {
15
17
  value: 'row',
@@ -45,17 +47,12 @@ const options: ToggleButtonGroupItem< FlexDirection >[] = [
45
47
 
46
48
  export const FlexDirectionField = () => {
47
49
  return (
48
- <UiProviders>
49
- <StylesField bind="flex-direction">
50
- <Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
51
- <Grid item xs={ 6 }>
52
- <ControlLabel>{ __( 'Direction', 'elementor' ) }</ControlLabel>
53
- </Grid>
54
- <Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
55
- <ToggleControl options={ options } />
56
- </Grid>
57
- </Grid>
58
- </StylesField>
59
- </UiProviders>
50
+ <StylesField bind="flex-direction" propDisplayName={ FLEX_DIRECTION_LABEL }>
51
+ <UiProviders>
52
+ <StylesFieldLayout label={ FLEX_DIRECTION_LABEL }>
53
+ <ToggleControl options={ options } />
54
+ </StylesFieldLayout>
55
+ </UiProviders>
56
+ </StylesField>
60
57
  );
61
58
  };
@@ -11,9 +11,12 @@ import { useStylesField } from '../../../hooks/use-styles-field';
11
11
  import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
12
12
  import { ControlLabel } from '../../control-label';
13
13
  import { SectionContent } from '../../section-content';
14
+ import { StylesFieldLayout } from '../../styles-field-layout';
14
15
 
15
16
  type GroupControlItemOption = 'first' | 'last' | 'custom';
16
17
 
18
+ const ORDER_LABEL = __( 'Order', 'elementor' );
19
+
17
20
  export const FIRST_DEFAULT_VALUE = -99999;
18
21
  export const LAST_DEFAULT_VALUE = 99999;
19
22
  const FIRST = 'first';
@@ -64,41 +67,35 @@ export const FlexOrderField = () => {
64
67
  };
65
68
 
66
69
  return (
67
- <UiProviders>
68
- <StylesField bind={ 'order' }>
69
- <SectionContent>
70
- <Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
71
- <Grid item xs={ 6 }>
72
- <ControlLabel>{ __( 'Order', 'elementor' ) }</ControlLabel>
73
- </Grid>
74
- <Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
75
- <ControlToggleButtonGroup
76
- items={ items }
77
- value={ groupControlValue }
78
- onChange={ handleToggleButtonChange }
79
- exclusive={ true }
80
- disabled={ ! canEdit }
81
- />
82
- </Grid>
83
- </Grid>
84
-
85
- { CUSTOM === groupControlValue && (
86
- <Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
87
- <Grid item xs={ 6 }>
88
- <ControlLabel>{ __( 'Custom order', 'elementor' ) }</ControlLabel>
89
- </Grid>
90
- <Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
91
- <NumberControl
92
- min={ FIRST_DEFAULT_VALUE + 1 }
93
- max={ LAST_DEFAULT_VALUE - 1 }
94
- shouldForceInt={ true }
95
- />
70
+ <StylesField bind="order" propDisplayName={ ORDER_LABEL }>
71
+ <UiProviders>
72
+ <StylesFieldLayout label={ ORDER_LABEL }>
73
+ <SectionContent>
74
+ <ControlToggleButtonGroup
75
+ items={ items }
76
+ value={ groupControlValue }
77
+ onChange={ handleToggleButtonChange }
78
+ exclusive={ true }
79
+ disabled={ ! canEdit }
80
+ />
81
+ { CUSTOM === groupControlValue && (
82
+ <Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
83
+ <Grid item xs={ 6 }>
84
+ <ControlLabel>{ __( 'Custom order', 'elementor' ) }</ControlLabel>
85
+ </Grid>
86
+ <Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
87
+ <NumberControl
88
+ min={ FIRST_DEFAULT_VALUE + 1 }
89
+ max={ LAST_DEFAULT_VALUE - 1 }
90
+ shouldForceInt={ true }
91
+ />
92
+ </Grid>
96
93
  </Grid>
97
- </Grid>
98
- ) }
99
- </SectionContent>
100
- </StylesField>
101
- </UiProviders>
94
+ ) }
95
+ </SectionContent>
96
+ </StylesFieldLayout>
97
+ </UiProviders>
98
+ </StylesField>
102
99
  );
103
100
  };
104
101