@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
@@ -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 { ArrowBackIcon, ArrowForwardIcon, ArrowRightIcon } from '@elementor/icons';
4
4
  import { DirectionProvider, Grid, ThemeProvider } 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
  type FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
11
12
 
@@ -1,11 +1,12 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, SizeControl } from '@elementor/editor-controls';
2
+ import { SizeControl } from '@elementor/editor-controls';
3
3
  import { SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from '@elementor/icons';
4
4
  import { Grid, Stack, 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
  import { RotatedIcon } from '../layout-section/utils/rotated-icon';
10
11
 
11
12
  type Side = 'inset-inline-start' | 'inset-inline-end' | 'inset-block-start' | 'inset-block-end';
@@ -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 positionOptions = [
9
10
  { label: __( 'Static', 'elementor' ), value: 'static' },
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, NumberControl } from '@elementor/editor-controls';
2
+ import { NumberControl } 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 ZIndexField = () => {
9
10
  return (
@@ -1,10 +1,11 @@
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 { EyeIcon, EyeOffIcon, LetterAIcon } from '@elementor/icons';
4
4
  import { Grid } from '@elementor/ui';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
7
  import { StylesField } from '../../../controls-registry/styles-field';
8
+ import { ControlLabel } from '../../control-label';
8
9
 
9
10
  type Overflows = 'visible' | 'hidden' | 'auto';
10
11
 
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, type ExtendedValue, SizeControl } from '@elementor/editor-controls';
2
+ import { type ExtendedValue, SizeControl } from '@elementor/editor-controls';
3
3
  import { Grid, Stack } from '@elementor/ui';
4
4
  import { __ } from '@wordpress/i18n';
5
5
 
6
6
  import { StylesField, type StylesFieldProps } from '../../../controls-registry/styles-field';
7
+ import { ControlLabel } from '../../control-label';
7
8
  import { PanelDivider } from '../../panel-divider';
8
9
  import { SectionContent } from '../../section-content';
9
10
  import { OverflowField } from './overflow-field';
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, FontFamilyControl } from '@elementor/editor-controls';
2
+ import { FontFamilyControl } 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
  import { useFontFamilies } from './hooks/use-font-families';
8
9
 
9
10
  export const FontFamilyField = () => {
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, SizeControl } from '@elementor/editor-controls';
2
+ import { SizeControl } 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 FontSizeField = () => {
9
10
  return (
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
2
+ import { ControlFormLabel, type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-controls';
3
3
  import { ItalicIcon, MinusIcon } from '@elementor/icons';
4
4
  import { Grid } from '@elementor/ui';
5
5
  import { __ } from '@wordpress/i18n';
@@ -26,7 +26,7 @@ export const FontStyleField = () => (
26
26
  <StylesField bind="font-style">
27
27
  <Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
28
28
  <Grid item xs={ 6 }>
29
- <ControlLabel>{ __( 'Font style', 'elementor' ) }</ControlLabel>
29
+ <ControlFormLabel>{ __( 'Font style', 'elementor' ) }</ControlFormLabel>
30
30
  </Grid>
31
31
  <Grid item xs={ 6 } display="flex" justifyContent="end">
32
32
  <ToggleControl options={ options } />
@@ -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 fontWeightOptions = [
9
10
  { value: '100', label: __( '100 - Thin', 'elementor' ) },
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, SizeControl } from '@elementor/editor-controls';
2
+ import { SizeControl } 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 LetterSpacingField = () => {
9
10
  return (
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, SizeControl } from '@elementor/editor-controls';
2
+ import { SizeControl } 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 LineHeightField = () => {
9
10
  return (
@@ -1,10 +1,11 @@
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 { AlignCenterIcon, AlignJustifiedIcon, AlignLeftIcon, AlignRightIcon } from '@elementor/icons';
4
4
  import { Grid, withDirection } from '@elementor/ui';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
7
  import { StylesField } from '../../../controls-registry/styles-field';
8
+ import { ControlLabel } from '../../control-label';
8
9
  import { RotatedIcon } from '../layout-section/utils/rotated-icon';
9
10
 
10
11
  type Alignments = 'start' | 'center' | 'end' | 'justify';
@@ -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 TextColorField = () => {
9
10
  return (
@@ -1,10 +1,11 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, ToggleControl, type ToggleControlProps } from '@elementor/editor-controls';
2
+ import { ToggleControl, type ToggleControlProps } from '@elementor/editor-controls';
3
3
  import { MinusIcon, OverlineIcon, StrikethroughIcon, UnderlineIcon } from '@elementor/icons';
4
4
  import { Grid } from '@elementor/ui';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
7
  import { StylesField } from '../../../controls-registry/styles-field';
8
+ import { ControlLabel } from '../../control-label';
8
9
 
9
10
  type Decoration = 'none' | 'underline' | 'line-through' | 'overline';
10
11
 
@@ -1,10 +1,11 @@
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 { TextDirectionLtrIcon, TextDirectionRtlIcon } from '@elementor/icons';
4
4
  import { Grid } from '@elementor/ui';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
7
  import { StylesField } from '../../../controls-registry/styles-field';
8
+ import { ControlLabel } from '../../control-label';
8
9
 
9
10
  type Direction = 'ltr' | 'rtl';
10
11
 
@@ -37,15 +37,15 @@ export const TextStrokeField = () => {
37
37
  const hasTextStroke = Boolean( textStroke );
38
38
 
39
39
  return (
40
- <AddOrRemoveContent
41
- label={ __( 'Text stroke', 'elementor' ) }
42
- isAdded={ hasTextStroke }
43
- onAdd={ addTextStroke }
44
- onRemove={ removeTextStroke }
45
- >
46
- <StylesField bind={ 'stroke' }>
40
+ <StylesField bind={ 'stroke' }>
41
+ <AddOrRemoveContent
42
+ label={ __( 'Text stroke', 'elementor' ) }
43
+ isAdded={ hasTextStroke }
44
+ onAdd={ addTextStroke }
45
+ onRemove={ removeTextStroke }
46
+ >
47
47
  <StrokeControl />
48
- </StylesField>
49
- </AddOrRemoveContent>
48
+ </AddOrRemoveContent>
49
+ </StylesField>
50
50
  );
51
51
  };
@@ -1,10 +1,11 @@
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 { LetterCaseIcon, LetterCaseLowerIcon, LetterCaseUpperIcon, MinusIcon } from '@elementor/icons';
4
4
  import { Grid } from '@elementor/ui';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
7
  import { StylesField } from '../../../controls-registry/styles-field';
8
+ import { ControlLabel } from '../../control-label';
8
9
 
9
10
  type Transforms = 'none' | 'capitalize' | 'uppercase' | 'lowercase';
10
11
 
@@ -1,9 +1,10 @@
1
1
  import * as React from 'react';
2
- import { ControlLabel, SizeControl } from '@elementor/editor-controls';
2
+ import { SizeControl } 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 WordSpacingField = () => {
9
10
  return (
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useId } from 'react';
3
- import { ControlLabel, useBoundProp } from '@elementor/editor-controls';
3
+ import { ControlFormLabel, useBoundProp } from '@elementor/editor-controls';
4
4
  import type { Control, ControlsSection } from '@elementor/editor-elements';
5
5
  import { DatabaseIcon, SettingsIcon, XIcon } from '@elementor/icons';
6
6
  import {
@@ -156,7 +156,7 @@ const DynamicSettings = ( { controls }: { controls: DynamicTag[ 'atomic_controls
156
156
  { tabs.map( ( { value }, index ) => {
157
157
  return (
158
158
  <TabPanel key={ index } sx={ { flexGrow: 1, py: 0 } } { ...getTabPanelProps( index ) }>
159
- <PopoverContent p={ 1.5 }>
159
+ <PopoverContent p={ 2 } gap={ 2 }>
160
160
  { value.items.map( ( item ) => {
161
161
  if ( item.type === 'control' ) {
162
162
  return <Control key={ item.value.bind } control={ item.value } />;
@@ -181,7 +181,7 @@ const Control = ( { control }: { control: Control[ 'value' ] } ) => {
181
181
  <Grid container gap={ 0.75 }>
182
182
  { control.label ? (
183
183
  <Grid item xs={ 12 }>
184
- <ControlLabel>{ control.label }</ControlLabel>
184
+ <ControlFormLabel>{ control.label }</ControlFormLabel>
185
185
  </Grid>
186
186
  ) : null }
187
187
  <Grid item xs={ 12 }>
@@ -7,9 +7,9 @@ import {
7
7
  Divider,
8
8
  InputAdornment,
9
9
  Link,
10
- ListSubheader,
11
10
  MenuItem,
12
11
  MenuList,
12
+ MenuSubheader,
13
13
  Stack,
14
14
  TextField,
15
15
  Typography,
@@ -58,12 +58,12 @@ export const DynamicSelection = ( { onSelect }: DynamicSelectionProps ) => {
58
58
  setSearchValue( event.target.value );
59
59
  };
60
60
 
61
- const handleSetDynamicTag = ( value: string ) => {
61
+ const handleSetDynamicTag = ( value: string, label: string ) => {
62
62
  if ( ! isCurrentValueDynamic ) {
63
63
  updatePropValueHistory( anyValue );
64
64
  }
65
65
 
66
- setValue( { name: value, settings: {} } );
66
+ setValue( { name: value, settings: { label } } );
67
67
 
68
68
  onSelect?.();
69
69
  };
@@ -96,11 +96,11 @@ export const DynamicSelection = ( { onSelect }: DynamicSelectionProps ) => {
96
96
  <MenuList role="listbox" tabIndex={ 0 }>
97
97
  { options.map( ( [ category, items ], index ) => (
98
98
  <Fragment key={ index }>
99
- <ListSubheader
99
+ <MenuSubheader
100
100
  sx={ { px: 1.5, typography: 'caption', color: 'text.tertiary' } }
101
101
  >
102
102
  { dynamicGroups?.[ category ]?.title || category }
103
- </ListSubheader>
103
+ </MenuSubheader>
104
104
  { items.map( ( { value, label: tagLabel } ) => {
105
105
  const isSelected = isCurrentValueDynamic && value === dynamicValue?.name;
106
106
 
@@ -110,8 +110,8 @@ export const DynamicSelection = ( { onSelect }: DynamicSelectionProps ) => {
110
110
  selected={ isSelected }
111
111
  // eslint-disable-next-line jsx-a11y/no-autofocus
112
112
  autoFocus={ isSelected }
113
- sx={ { px: 1.5, typography: 'caption' } }
114
- onClick={ () => handleSetDynamicTag( value ) }
113
+ sx={ { px: 3.5, typography: 'caption' } }
114
+ onClick={ () => handleSetDynamicTag( value, tagLabel ) }
115
115
  >
116
116
  { tagLabel }
117
117
  </MenuItem>
@@ -15,6 +15,7 @@ export const usePropDynamicTags = () => {
15
15
  categories = propDynamicType?.settings.categories || [];
16
16
  }
17
17
 
18
+ // eslint-disable-next-line react-compiler/react-compiler
18
19
  // eslint-disable-next-line react-hooks/exhaustive-deps
19
20
  return useMemo( () => getDynamicTagsByCategories( categories ), [ categories.join() ] );
20
21
  };
@@ -6,7 +6,6 @@ import { __ } from '@wordpress/i18n';
6
6
 
7
7
  import { useStyle } from '../contexts/style-context';
8
8
  import { useStylesInheritanceField } from '../contexts/styles-inheritance-context';
9
- import { useStylesField } from '../hooks/use-styles-field';
10
9
 
11
10
  const Circle = styled( 'div', {
12
11
  shouldForwardProp: ( prop ) => prop !== 'variant',
@@ -17,21 +16,23 @@ const Circle = styled( 'div', {
17
16
  background-color: ${ ( { theme, variant } ) => {
18
17
  switch ( variant ) {
19
18
  case 'overridden':
20
- return theme.palette.warning.main;
19
+ return theme.palette.warning.light;
21
20
  case 'global-affects':
22
- return theme.palette.global.main;
21
+ return theme.palette.global.dark;
23
22
  case 'local-affects':
24
23
  return theme.palette.primary.main;
25
24
  default:
26
- return theme.palette.text.secondary;
25
+ return theme.palette.text.disabled;
27
26
  }
28
27
  } };
29
28
  `;
30
29
 
31
30
  export const StylesInheritanceIndicator = () => {
32
- const { bind } = useBoundProp();
31
+ const { value, path } = useBoundProp();
33
32
  const { id: currentStyleId, provider: currentStyleProvider, meta: currentStyleMeta } = useStyle();
34
- const [ value ] = useStylesField( bind );
33
+
34
+ // in the styles inheritance snapshot the keys are only those of the top level style schema attributes
35
+ const [ bind ] = path;
35
36
  const inheritanceChain = useStylesInheritanceField( bind );
36
37
 
37
38
  if ( ! inheritanceChain.length ) {