@elementor/editor-editing-panel 1.22.0 → 1.24.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 (51) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/index.js +409 -361
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +379 -336
  5. package/dist/index.mjs.map +1 -1
  6. package/package.json +7 -7
  7. package/src/components/add-or-remove-content.tsx +1 -1
  8. package/src/components/{control-label-with-adornments.tsx → control-label.tsx} +3 -3
  9. package/src/components/css-classes/css-class-item.tsx +16 -5
  10. package/src/components/css-classes/css-class-menu.tsx +12 -15
  11. package/src/components/css-classes/css-class-selector.tsx +3 -3
  12. package/src/components/editing-panel-tabs.tsx +8 -1
  13. package/src/components/editing-panel.tsx +18 -15
  14. package/src/components/multi-combobox.tsx +12 -1
  15. package/src/components/section.tsx +1 -1
  16. package/src/components/settings-tab.tsx +2 -2
  17. package/src/components/style-sections/border-section/border-color-field.tsx +2 -1
  18. package/src/components/style-sections/border-section/border-style-field.tsx +2 -1
  19. package/src/components/style-sections/layout-section/align-content-field.tsx +2 -1
  20. package/src/components/style-sections/layout-section/align-items-field.tsx +2 -1
  21. package/src/components/style-sections/layout-section/align-self-child-field.tsx +2 -1
  22. package/src/components/style-sections/layout-section/display-field.tsx +2 -1
  23. package/src/components/style-sections/layout-section/flex-direction-field.tsx +2 -1
  24. package/src/components/style-sections/layout-section/flex-order-field.tsx +20 -24
  25. package/src/components/style-sections/layout-section/flex-size-field.tsx +6 -4
  26. package/src/components/style-sections/layout-section/justify-content-field.tsx +5 -4
  27. package/src/components/style-sections/layout-section/layout-section.tsx +2 -2
  28. package/src/components/style-sections/layout-section/utils/rotated-icon.tsx +2 -0
  29. package/src/components/style-sections/layout-section/wrap-field.tsx +2 -1
  30. package/src/components/style-sections/position-section/dimensions-field.tsx +2 -1
  31. package/src/components/style-sections/position-section/position-field.tsx +2 -1
  32. package/src/components/style-sections/position-section/z-index-field.tsx +2 -1
  33. package/src/components/style-sections/size-section/overflow-field.tsx +2 -1
  34. package/src/components/style-sections/size-section/size-section.tsx +2 -1
  35. package/src/components/style-sections/typography-section/font-family-field.tsx +2 -1
  36. package/src/components/style-sections/typography-section/font-size-field.tsx +2 -1
  37. package/src/components/style-sections/typography-section/font-style-field.tsx +2 -2
  38. package/src/components/style-sections/typography-section/font-weight-field.tsx +2 -1
  39. package/src/components/style-sections/typography-section/letter-spacing-field.tsx +2 -1
  40. package/src/components/style-sections/typography-section/line-height-field.tsx +2 -1
  41. package/src/components/style-sections/typography-section/text-alignment-field.tsx +2 -1
  42. package/src/components/style-sections/typography-section/text-color-field.tsx +2 -1
  43. package/src/components/style-sections/typography-section/text-decoration-field.tsx +2 -1
  44. package/src/components/style-sections/typography-section/text-direction-field.tsx +2 -1
  45. package/src/components/style-sections/typography-section/text-stroke-field.tsx +9 -9
  46. package/src/components/style-sections/typography-section/transform-field.tsx +2 -1
  47. package/src/components/style-sections/typography-section/word-spacing-field.tsx +2 -1
  48. package/src/dynamics/components/dynamic-selection-control.tsx +3 -3
  49. package/src/dynamics/components/dynamic-selection.tsx +7 -7
  50. package/src/dynamics/hooks/use-prop-dynamic-tags.ts +1 -0
  51. package/src/styles-inheritance/styles-inheritance-indicator.tsx +7 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-editing-panel",
3
- "version": "1.22.0",
3
+ "version": "1.24.0",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,16 +39,16 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "0.18.4",
43
- "@elementor/editor-controls": "0.19.1",
42
+ "@elementor/editor": "0.18.5",
43
+ "@elementor/editor-controls": "0.21.0",
44
44
  "@elementor/editor-current-user": "0.3.0",
45
- "@elementor/editor-elements": "0.6.6",
46
- "@elementor/editor-panels": "0.13.1",
45
+ "@elementor/editor-elements": "0.7.0",
46
+ "@elementor/editor-panels": "0.14.0",
47
47
  "@elementor/editor-props": "0.11.1",
48
48
  "@elementor/editor-responsive": "0.13.3",
49
49
  "@elementor/editor-styles": "0.6.4",
50
- "@elementor/editor-styles-repository": "0.8.0",
51
- "@elementor/editor-ui": "0.4.3",
50
+ "@elementor/editor-styles-repository": "0.8.1",
51
+ "@elementor/editor-ui": "0.5.1",
52
52
  "@elementor/editor-v1-adapters": "0.11.0",
53
53
  "@elementor/icons": "1.37.0",
54
54
  "@elementor/locations": "0.7.7",
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import { type PropsWithChildren } from 'react';
3
- import { ControlLabel } from '@elementor/editor-controls';
4
3
  import { MinusIcon, PlusIcon } from '@elementor/icons';
5
4
  import { Collapse, IconButton, Stack } from '@elementor/ui';
6
5
 
6
+ import { ControlLabel } from './control-label';
7
7
  import { SectionContent } from './section-content';
8
8
 
9
9
  const SIZE = 'tiny';
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react';
2
2
  import { type PropsWithChildren } from 'react';
3
- import { ControlAdornments, ControlLabel } from '@elementor/editor-controls';
3
+ import { ControlAdornments, ControlFormLabel } from '@elementor/editor-controls';
4
4
  import { Stack } from '@elementor/ui';
5
5
 
6
- export const ControlLabelWithAdornments = ( { children }: PropsWithChildren< object > ) => {
6
+ export const ControlLabel = ( { children }: PropsWithChildren< object > ) => {
7
7
  return (
8
8
  <Stack direction="row" alignItems="center" justifyItems="start" gap={ 1 }>
9
- <ControlLabel>{ children }</ControlLabel>
9
+ <ControlFormLabel>{ children }</ControlFormLabel>
10
10
  <ControlAdornments />
11
11
  </Stack>
12
12
  );
@@ -9,6 +9,7 @@ import {
9
9
  Chip,
10
10
  type ChipOwnProps,
11
11
  Stack,
12
+ type Theme,
12
13
  Typography,
13
14
  UnstableChipGroup,
14
15
  usePopupState,
@@ -70,7 +71,15 @@ export function CssClassItem( {
70
71
 
71
72
  return (
72
73
  <>
73
- <UnstableChipGroup ref={ setChipRef } { ...chipGroupProps } aria-label={ `Edit ${ label }` } role="group">
74
+ <UnstableChipGroup
75
+ ref={ setChipRef }
76
+ { ...chipGroupProps }
77
+ aria-label={ `Edit ${ label }` }
78
+ role="group"
79
+ sx={ ( theme: Theme ) => ( {
80
+ '&.MuiChipGroup-root.MuiAutocomplete-tag': { margin: theme.spacing( 0.125 ) },
81
+ } ) }
82
+ >
74
83
  <Chip
75
84
  size={ CHIP_SIZE }
76
85
  label={
@@ -98,12 +107,13 @@ export function CssClassItem( {
98
107
  onClickActive( id );
99
108
  } }
100
109
  aria-pressed={ isActive }
101
- sx={ {
110
+ sx={ ( theme: Theme ) => ( {
102
111
  cursor: isActive && allowRename && ! isShowingState ? 'text' : 'pointer',
112
+ borderRadius: `${ theme.shape.borderRadius * 0.75 }px`,
103
113
  '&.Mui-focusVisible': {
104
114
  boxShadow: 'none !important',
105
115
  },
106
- } }
116
+ } ) }
107
117
  />
108
118
  { ! isEditing && (
109
119
  <Chip
@@ -122,11 +132,12 @@ export function CssClassItem( {
122
132
  color={ color }
123
133
  { ...bindTrigger( popupState ) }
124
134
  aria-label={ __( 'Open CSS Class Menu', 'elementor' ) }
125
- sx={ {
135
+ sx={ ( theme: Theme ) => ( {
136
+ borderRadius: `${ theme.shape.borderRadius * 0.75 }px`,
126
137
  paddingRight: 0,
127
138
  ...( ! isShowingState ? { paddingLeft: 0 } : {} ),
128
139
  '.MuiChip-label': isShowingState ? { paddingRight: 0 } : { padding: 0 },
129
- } }
140
+ } ) }
130
141
  />
131
142
  ) }
132
143
  </UnstableChipGroup>
@@ -1,7 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { type StyleDefinitionState } from '@elementor/editor-styles';
3
3
  import { stylesRepository } from '@elementor/editor-styles-repository';
4
- import { bindMenu, Divider, ListSubheader, Menu, MenuItem, type PopupState } from '@elementor/ui';
4
+ import { MenuListItem } from '@elementor/editor-ui';
5
+ import { bindMenu, Divider, Menu, MenuSubheader, type PopupState } from '@elementor/ui';
5
6
  import { __ } from '@wordpress/i18n';
6
7
 
7
8
  import { useStyle } from '../../contexts/style-context';
@@ -39,9 +40,9 @@ export function CssClassMenu( { styleId, provider, popupState, handleRename, anc
39
40
  >
40
41
  { /* It has to be an array since MUI menu doesn't accept a Fragment as a child, and wrapping the items with an HTML element disrupts keyboard navigation */ }
41
42
  { getMenuItemsByProvider( { provider, styleId, handleRename, closeMenu: popupState.close } ) }
42
- <ListSubheader sx={ { typography: 'caption', color: 'text.secondary', pb: 0.5, pt: 1 } }>
43
+ <MenuSubheader sx={ { typography: 'caption', color: 'text.secondary', pb: 0.5, pt: 1 } }>
43
44
  { __( 'Pseudo classes', 'elementor' ) }
44
- </ListSubheader>
45
+ </MenuSubheader>
45
46
  <StateMenuItem key="normal" state={ null } styleId={ styleId } closeMenu={ popupState.close } />
46
47
  { STATES.map( ( state ) => {
47
48
  return (
@@ -79,12 +80,12 @@ function getMenuItemsByProvider( {
79
80
 
80
81
  if ( actions.length ) {
81
82
  actions.unshift(
82
- <ListSubheader
83
+ <MenuSubheader
83
84
  key="provider-label"
84
85
  sx={ { typography: 'caption', color: 'text.secondary', pb: 0.5, pt: 1 } }
85
86
  >
86
87
  { providerInstance?.labels?.singular }
87
- </ListSubheader>
88
+ </MenuSubheader>
88
89
  );
89
90
  actions.push( <Divider key="provider-actions-divider" /> );
90
91
  }
@@ -106,7 +107,7 @@ function StateMenuItem( { state, styleId, closeMenu, ...props }: StateMenuItemPr
106
107
  const isSelected = state === activeState && isActive;
107
108
 
108
109
  return (
109
- <StyledMenuItem
110
+ <MenuListItem
110
111
  { ...props }
111
112
  selected={ isSelected }
112
113
  sx={ { textTransform: 'capitalize' } }
@@ -121,7 +122,7 @@ function StateMenuItem( { state, styleId, closeMenu, ...props }: StateMenuItemPr
121
122
  } }
122
123
  >
123
124
  { state ? state : 'Normal' }
124
- </StyledMenuItem>
125
+ </MenuListItem>
125
126
  );
126
127
  }
127
128
 
@@ -129,7 +130,7 @@ function UnapplyClassMenuItem( { styleId, closeMenu, ...props }: { styleId: stri
129
130
  const unapplyClass = useUnapplyClass( styleId );
130
131
 
131
132
  return (
132
- <StyledMenuItem
133
+ <MenuListItem
133
134
  { ...props }
134
135
  onClick={ () => {
135
136
  unapplyClass();
@@ -137,7 +138,7 @@ function UnapplyClassMenuItem( { styleId, closeMenu, ...props }: { styleId: stri
137
138
  } }
138
139
  >
139
140
  { __( 'Remove', 'elementor' ) }
140
- </StyledMenuItem>
141
+ </MenuListItem>
141
142
  );
142
143
  }
143
144
 
@@ -150,7 +151,7 @@ function RenameClassMenuItem( {
150
151
  closeMenu: () => void;
151
152
  } ) {
152
153
  return (
153
- <StyledMenuItem
154
+ <MenuListItem
154
155
  { ...props }
155
156
  onClick={ () => {
156
157
  closeMenu();
@@ -158,10 +159,6 @@ function RenameClassMenuItem( {
158
159
  } }
159
160
  >
160
161
  { __( 'Rename', 'elementor' ) }
161
- </StyledMenuItem>
162
+ </MenuListItem>
162
163
  );
163
164
  }
164
-
165
- const StyledMenuItem = ( { ...props } ) => (
166
- <MenuItem { ...props } sx={ { ...( props.sx ?? {} ), typography: 'caption', color: 'text.primary' } } />
167
- );
@@ -26,7 +26,7 @@ const ID = 'elementor-css-class-selector';
26
26
  const TAGS_LIMIT = 50;
27
27
 
28
28
  type StyleDefOption = Option & {
29
- color: 'primary' | 'global';
29
+ color: 'accent' | 'global';
30
30
  icon: ReactElement | null;
31
31
  provider: string;
32
32
  };
@@ -35,7 +35,7 @@ const EMPTY_OPTION = {
35
35
  label: __( 'local', 'elementor' ),
36
36
  value: null,
37
37
  fixed: true,
38
- color: 'primary',
38
+ color: 'accent',
39
39
  icon: <MapPinIcon />,
40
40
  provider: ELEMENTS_STYLES_PROVIDER_KEY,
41
41
  } satisfies StyleDefOption;
@@ -145,7 +145,7 @@ function useOptions() {
145
145
  label: styleDef.label,
146
146
  value: styleDef.id,
147
147
  fixed: isElements,
148
- color: isElements ? 'primary' : 'global',
148
+ color: isElements ? 'accent' : 'global',
149
149
  icon: isElements ? <MapPinIcon /> : null,
150
150
  provider: provider.key,
151
151
  group: provider.labels?.plural,
@@ -19,7 +19,14 @@ export const EditingPanelTabs = () => {
19
19
  // Reference: https://react.dev/learn/preserving-and-resetting-state#resetting-a-form-with-a-key
20
20
  <Fragment key={ element.id }>
21
21
  <Stack direction="column" sx={ { width: '100%' } }>
22
- <Tabs variant="fullWidth" indicatorColor="secondary" textColor="inherit" { ...getTabsProps() }>
22
+ <Tabs
23
+ variant="fullWidth"
24
+ indicatorColor="secondary"
25
+ textColor="inherit"
26
+ size="small"
27
+ sx={ { mt: 0.5 } }
28
+ { ...getTabsProps() }
29
+ >
23
30
  <Tab label={ __( 'General', 'elementor' ) } { ...getTabProps( 'settings' ) } />
24
31
  <Tab label={ __( 'Style', 'elementor' ) } { ...getTabProps( 'style' ) } />
25
32
  </Tabs>
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { ControlActionsProvider, ControlReplacementProvider } from '@elementor/editor-controls';
3
3
  import { useSelectedElement } from '@elementor/editor-elements';
4
4
  import { Panel, PanelBody, PanelHeader, PanelHeaderTitle } from '@elementor/editor-panels';
5
+ import { ThemeProvider } from '@elementor/editor-ui';
5
6
  import { AtomIcon } from '@elementor/icons';
6
7
  import { SessionStorageProvider } from '@elementor/session';
7
8
  import { ErrorBoundary } from '@elementor/ui';
@@ -30,21 +31,23 @@ export const EditingPanel = () => {
30
31
  return (
31
32
  <ErrorBoundary fallback={ <EditorPanelErrorFallback /> }>
32
33
  <SessionStorageProvider prefix={ 'elementor' }>
33
- <Panel>
34
- <PanelHeader>
35
- <PanelHeaderTitle>{ panelTitle }</PanelHeaderTitle>
36
- <AtomIcon fontSize="small" sx={ { color: 'text.tertiary' } } />
37
- </PanelHeader>
38
- <PanelBody>
39
- <ControlActionsProvider items={ menuItems }>
40
- <ControlReplacementProvider { ...controlReplacement }>
41
- <ElementProvider element={ element } elementType={ elementType }>
42
- <EditingPanelTabs />
43
- </ElementProvider>
44
- </ControlReplacementProvider>
45
- </ControlActionsProvider>
46
- </PanelBody>
47
- </Panel>
34
+ <ThemeProvider>
35
+ <Panel>
36
+ <PanelHeader>
37
+ <PanelHeaderTitle>{ panelTitle }</PanelHeaderTitle>
38
+ <AtomIcon fontSize="small" sx={ { color: 'text.tertiary' } } />
39
+ </PanelHeader>
40
+ <PanelBody>
41
+ <ControlActionsProvider items={ menuItems }>
42
+ <ControlReplacementProvider { ...controlReplacement }>
43
+ <ElementProvider element={ element } elementType={ elementType }>
44
+ <EditingPanelTabs />
45
+ </ElementProvider>
46
+ </ControlReplacementProvider>
47
+ </ControlActionsProvider>
48
+ </PanelBody>
49
+ </Panel>
50
+ </ThemeProvider>
48
51
  </SessionStorageProvider>
49
52
  </ErrorBoundary>
50
53
  );
@@ -8,6 +8,7 @@ import {
8
8
  createFilterOptions,
9
9
  styled,
10
10
  TextField,
11
+ type Theme,
11
12
  } from '@elementor/ui';
12
13
 
13
14
  export type Option = {
@@ -63,7 +64,17 @@ export function MultiCombobox< TOption extends Option >( {
63
64
  value={ selected }
64
65
  options={ options }
65
66
  renderGroup={ ( params ) => <Group { ...params } /> }
66
- renderInput={ ( params ) => <TextField { ...params } /> }
67
+ renderInput={ ( params ) => (
68
+ <TextField
69
+ { ...params }
70
+ sx={ ( theme: Theme ) => ( {
71
+ '.MuiAutocomplete-inputRoot.MuiInputBase-adornedStart': {
72
+ paddingLeft: theme.spacing( 0.25 ),
73
+ paddingRight: theme.spacing( 0.25 ),
74
+ },
75
+ } ) }
76
+ />
77
+ ) }
67
78
  onChange={ ( _, selectedOrInputValue, reason ) => {
68
79
  const inputValue = selectedOrInputValue.find( ( option ) => typeof option === 'string' );
69
80
  const optionsAndActions = selectedOrInputValue.filter( ( option ) => typeof option !== 'string' );
@@ -26,7 +26,7 @@ export function Section( { title, children, defaultExpanded = false }: Props ) {
26
26
  >
27
27
  <ListItemText
28
28
  secondary={ title }
29
- secondaryTypographyProps={ { sx: { typography: 'caption', fontWeight: 'bold' } } }
29
+ secondaryTypographyProps={ { color: 'text.primary', variant: 'caption', fontWeight: 'bold' } }
30
30
  />
31
31
  <CollapseIcon open={ isOpen } color="secondary" fontSize="tiny" />
32
32
  </ListItemButton>
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel } from '@elementor/editor-controls';
2
+ import { ControlFormLabel } from '@elementor/editor-controls';
3
3
  import { type Control } from '@elementor/editor-elements';
4
4
  import { SessionStorageProvider } from '@elementor/session';
5
5
 
@@ -52,7 +52,7 @@ const Control = ( { control }: { control: Control[ 'value' ] } ) => {
52
52
  return (
53
53
  <SettingsField bind={ control.bind }>
54
54
  <ControlTypeContainer controlType={ control.type as ControlType }>
55
- { control.label ? <ControlLabel>{ control.label }</ControlLabel> : null }
55
+ { control.label ? <ControlFormLabel>{ control.label }</ControlFormLabel> : null }
56
56
  <BaseControl type={ control.type as ControlType } props={ control.props } />
57
57
  </ControlTypeContainer>
58
58
  </SettingsField>
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
- import { ColorControl, ControlLabel } from '@elementor/editor-controls';
2
+ import { ColorControl } from '@elementor/editor-controls';
3
3
  import { Grid } from '@elementor/ui';
4
4
  import { __ } from '@wordpress/i18n';
5
5
 
6
6
  import { StylesField } from '../../../controls-registry/styles-field';
7
+ import { ControlLabel } from '../../control-label';
7
8
 
8
9
  export const BorderColorField = () => {
9
10
  return (
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, SelectControl } from '@elementor/editor-controls';
2
+ import { SelectControl } from '@elementor/editor-controls';
3
3
  import { Grid } from '@elementor/ui';
4
4
  import { __ } from '@wordpress/i18n';
5
5
 
6
6
  import { StylesField } from '../../../controls-registry/styles-field';
7
+ import { ControlLabel } from '../../control-label';
7
8
 
8
9
  const borderStyles = [
9
10
  { value: 'none', label: __( 'None', 'elementor' ) },
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
2
+ import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
3
3
  import {
4
4
  JustifyBottomIcon,
5
5
  JustifyCenterIcon as CenterIcon,
@@ -13,6 +13,7 @@ import { __ } from '@wordpress/i18n';
13
13
 
14
14
  import { StylesField } from '../../../controls-registry/styles-field';
15
15
  import { useDirection } from '../../../hooks/use-direction';
16
+ import { ControlLabel } from '../../control-label';
16
17
  import { RotatedIcon } from './utils/rotated-icon';
17
18
 
18
19
  type AlignContent = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
2
+ import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
3
3
  import {
4
4
  LayoutAlignCenterIcon as CenterIcon,
5
5
  LayoutAlignLeftIcon,
@@ -11,6 +11,7 @@ import { __ } from '@wordpress/i18n';
11
11
 
12
12
  import { StylesField } from '../../../controls-registry/styles-field';
13
13
  import { useDirection } from '../../../hooks/use-direction';
14
+ import { ControlLabel } from '../../control-label';
14
15
  import { RotatedIcon } from './utils/rotated-icon';
15
16
 
16
17
  type AlignItems = 'start' | 'center' | 'end' | 'stretch';
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
2
+ import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
3
3
  import {
4
4
  LayoutAlignCenterIcon as CenterIcon,
5
5
  LayoutAlignLeftIcon,
@@ -11,6 +11,7 @@ import { __ } from '@wordpress/i18n';
11
11
 
12
12
  import { StylesField } from '../../../controls-registry/styles-field';
13
13
  import { useDirection } from '../../../hooks/use-direction';
14
+ import { ControlLabel } from '../../control-label';
14
15
  import { RotatedIcon } from './utils/rotated-icon';
15
16
 
16
17
  type AlignItems = 'start' | 'center' | 'end' | 'stretch';
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
2
+ import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
3
3
  import { Stack } from '@elementor/ui';
4
4
  import { __ } from '@wordpress/i18n';
5
5
 
6
6
  import { StylesField } from '../../../controls-registry/styles-field';
7
+ import { ControlLabel } from '../../control-label';
7
8
 
8
9
  type Displays = 'block' | 'flex' | 'inline-block' | 'inline-flex';
9
10
 
@@ -1,11 +1,12 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
2
+ import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
3
3
  import { ArrowDownSmallIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpSmallIcon } from '@elementor/icons';
4
4
  import { DirectionProvider, Grid, ThemeProvider, withDirection } from '@elementor/ui';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
7
  import { StylesField } from '../../../controls-registry/styles-field';
8
8
  import { useDirection } from '../../../hooks/use-direction';
9
+ import { ControlLabel } from '../../control-label';
9
10
 
10
11
  export type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
11
12
 
@@ -1,11 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useState } from 'react';
3
- import {
4
- ControlLabel,
5
- ControlToggleButtonGroup,
6
- NumberControl,
7
- type ToggleButtonGroupItem,
8
- } from '@elementor/editor-controls';
3
+ import { ControlToggleButtonGroup, NumberControl, type ToggleButtonGroupItem } from '@elementor/editor-controls';
9
4
  import { type NumberPropValue } from '@elementor/editor-props';
10
5
  import { ArrowDownSmallIcon, ArrowUpSmallIcon, PencilIcon } from '@elementor/icons';
11
6
  import { DirectionProvider, Grid, ThemeProvider } from '@elementor/ui';
@@ -14,6 +9,7 @@ import { __ } from '@wordpress/i18n';
14
9
  import { StylesField } from '../../../controls-registry/styles-field';
15
10
  import { useDirection } from '../../../hooks/use-direction';
16
11
  import { useStylesField } from '../../../hooks/use-styles-field';
12
+ import { ControlLabel } from '../../control-label';
17
13
  import { SectionContent } from '../../section-content';
18
14
 
19
15
  type GroupControlItemOption = 'first' | 'last' | 'custom';
@@ -71,23 +67,23 @@ export const FlexOrderField = () => {
71
67
  return (
72
68
  <DirectionProvider rtl={ isSiteRtl }>
73
69
  <ThemeProvider>
74
- <SectionContent>
75
- <Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
76
- <Grid item xs={ 6 }>
77
- <ControlLabel>{ __( 'Order', 'elementor' ) }</ControlLabel>
78
- </Grid>
79
- <Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
80
- <ControlToggleButtonGroup
81
- items={ items }
82
- value={ groupControlValue }
83
- onChange={ handleToggleButtonChange }
84
- exclusive={ true }
85
- />
70
+ <StylesField bind={ 'order' }>
71
+ <SectionContent>
72
+ <Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
73
+ <Grid item xs={ 6 }>
74
+ <ControlLabel>{ __( 'Order', 'elementor' ) }</ControlLabel>
75
+ </Grid>
76
+ <Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
77
+ <ControlToggleButtonGroup
78
+ items={ items }
79
+ value={ groupControlValue }
80
+ onChange={ handleToggleButtonChange }
81
+ exclusive={ true }
82
+ />
83
+ </Grid>
86
84
  </Grid>
87
- </Grid>
88
85
 
89
- { CUSTOM === groupControlValue && (
90
- <StylesField bind={ 'order' }>
86
+ { CUSTOM === groupControlValue && (
91
87
  <Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
92
88
  <Grid item xs={ 6 }>
93
89
  <ControlLabel>{ __( 'Custom order', 'elementor' ) }</ControlLabel>
@@ -100,9 +96,9 @@ export const FlexOrderField = () => {
100
96
  />
101
97
  </Grid>
102
98
  </Grid>
103
- </StylesField>
104
- ) }
105
- </SectionContent>
99
+ ) }
100
+ </SectionContent>
101
+ </StylesField>
106
102
  </ThemeProvider>
107
103
  </DirectionProvider>
108
104
  );
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useMemo, useState } from 'react';
3
3
  import {
4
- ControlLabel,
5
4
  ControlToggleButtonGroup,
6
5
  NumberControl,
7
6
  SizeControl,
@@ -9,12 +8,13 @@ import {
9
8
  } from '@elementor/editor-controls';
10
9
  import type { NumberPropValue, SizePropValue } from '@elementor/editor-props';
11
10
  import { ExpandIcon, PencilIcon, ShrinkIcon } from '@elementor/icons';
12
- import { DirectionProvider, Grid, ThemeProvider } from '@elementor/ui';
11
+ import { DirectionProvider, Grid, ThemeProvider, Typography } from '@elementor/ui';
13
12
  import { __ } from '@wordpress/i18n';
14
13
 
15
14
  import { StylesField } from '../../../controls-registry/styles-field';
16
15
  import { useDirection } from '../../../hooks/use-direction';
17
16
  import { useStylesField } from '../../../hooks/use-styles-field';
17
+ import { ControlLabel } from '../../control-label';
18
18
  import { SectionContent } from '../../section-content';
19
19
 
20
20
  type GroupItem = 'flex-grow' | 'flex-shrink' | 'custom';
@@ -81,9 +81,12 @@ export const FlexSizeField = () => {
81
81
  <DirectionProvider rtl={ isSiteRtl }>
82
82
  <ThemeProvider>
83
83
  <SectionContent>
84
+ <Typography fontSize="large">{ activeGroup }</Typography>
84
85
  <Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
85
86
  <Grid item xs={ 6 }>
86
- <ControlLabel>{ __( 'Size', 'elementor' ) }</ControlLabel>
87
+ <StylesField bind={ activeGroup ?? '' }>
88
+ <ControlLabel>{ __( 'Size', 'elementor' ) }</ControlLabel>
89
+ </StylesField>
87
90
  </Grid>
88
91
  <Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
89
92
  <ControlToggleButtonGroup
@@ -94,7 +97,6 @@ export const FlexSizeField = () => {
94
97
  />
95
98
  </Grid>
96
99
  </Grid>
97
-
98
100
  { 'custom' === activeGroup && <FlexCustomField /> }
99
101
  </SectionContent>
100
102
  </ThemeProvider>
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
2
+ import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
3
3
  import {
4
4
  JustifyBottomIcon,
5
5
  JustifyCenterIcon as CenterIcon,
@@ -13,9 +13,10 @@ import { __ } from '@wordpress/i18n';
13
13
 
14
14
  import { StylesField } from '../../../controls-registry/styles-field';
15
15
  import { useDirection } from '../../../hooks/use-direction';
16
+ import { ControlLabel } from '../../control-label';
16
17
  import { RotatedIcon } from './utils/rotated-icon';
17
18
 
18
- type JustifyContent = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly';
19
+ type JustifyContent = 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly';
19
20
 
20
21
  const StartIcon = withDirection( JustifyTopIcon );
21
22
  const EndIcon = withDirection( JustifyBottomIcon );
@@ -27,7 +28,7 @@ const iconProps = {
27
28
 
28
29
  const options: ToggleButtonGroupItem< JustifyContent >[] = [
29
30
  {
30
- value: 'start',
31
+ value: 'flex-start',
31
32
  label: __( 'Start', 'elementor' ),
32
33
  renderContent: ( { size } ) => <RotatedIcon icon={ StartIcon } size={ size } { ...iconProps } />,
33
34
  showTooltip: true,
@@ -39,7 +40,7 @@ const options: ToggleButtonGroupItem< JustifyContent >[] = [
39
40
  showTooltip: true,
40
41
  },
41
42
  {
42
- value: 'end',
43
+ value: 'flex-end',
43
44
  label: __( 'End', 'elementor' ),
44
45
  renderContent: ( { size } ) => <RotatedIcon icon={ EndIcon } size={ size } { ...iconProps } />,
45
46
  showTooltip: true,
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel } from '@elementor/editor-controls';
2
+ import { ControlFormLabel } from '@elementor/editor-controls';
3
3
  import { useParentElement } from '@elementor/editor-elements';
4
4
  import { type StringPropValue } from '@elementor/editor-props';
5
5
  import { __ } from '@wordpress/i18n';
@@ -54,7 +54,7 @@ const FlexFields = () => {
54
54
  const FlexChildFields = () => (
55
55
  <>
56
56
  <PanelDivider />
57
- <ControlLabel>{ __( 'Flex child', 'elementor' ) }</ControlLabel>
57
+ <ControlFormLabel>{ __( 'Flex child', 'elementor' ) }</ControlFormLabel>
58
58
  <AlignSelfChild />
59
59
  <FlexOrderField />
60
60
  <FlexSizeField />
@@ -36,8 +36,10 @@ export const RotatedIcon = ( {
36
36
  disableRotationForReversed = false,
37
37
  }: Props ) => {
38
38
  const rotate = useRef( useGetTargetAngle( isClockwise, offset, disableRotationForReversed ) );
39
+ // eslint-disable-next-line react-compiler/react-compiler
39
40
  rotate.current = useGetTargetAngle( isClockwise, offset, disableRotationForReversed, rotate );
40
41
 
42
+ // eslint-disable-next-line react-compiler/react-compiler
41
43
  return <Icon fontSize={ size } sx={ { transition: '.3s', rotate: `${ rotate.current }deg` } } />;
42
44
  };
43
45