@elementor/editor-editing-panel 1.47.0 → 1.50.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 (35) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/dist/index.d.mts +4 -4
  3. package/dist/index.d.ts +4 -4
  4. package/dist/index.js +486 -378
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.mjs +503 -398
  7. package/dist/index.mjs.map +1 -1
  8. package/package.json +13 -14
  9. package/src/components/css-classes/css-class-item.tsx +3 -2
  10. package/src/components/css-classes/css-class-menu.tsx +2 -2
  11. package/src/components/css-classes/css-class-selector.tsx +10 -2
  12. package/src/components/popover-body.tsx +12 -0
  13. package/src/components/style-sections/border-section/border-field.tsx +14 -7
  14. package/src/components/style-sections/effects-section/effects-section.tsx +18 -4
  15. package/src/components/style-sections/layout-section/flex-order-field.tsx +30 -19
  16. package/src/components/style-sections/layout-section/flex-size-field.tsx +14 -16
  17. package/src/components/style-sections/layout-section/layout-section.tsx +9 -2
  18. package/src/components/style-sections/layout-section/utils/rotated-icon.tsx +6 -1
  19. package/src/components/style-sections/position-section/position-section.tsx +19 -8
  20. package/src/components/style-sections/size-section/size-section.tsx +4 -1
  21. package/src/components/style-sections/typography-section/text-stroke-field.tsx +3 -1
  22. package/src/components/style-sections/typography-section/typography-section.tsx +6 -1
  23. package/src/components/style-tab.tsx +1 -1
  24. package/src/controls-registry/settings-field.tsx +21 -5
  25. package/src/controls-registry/styles-field.tsx +5 -3
  26. package/src/dynamics/components/dynamic-selection-control.tsx +22 -14
  27. package/src/dynamics/components/dynamic-selection.tsx +32 -36
  28. package/src/hooks/use-styles-field.ts +3 -4
  29. package/src/hooks/use-styles-fields.ts +141 -73
  30. package/src/index.ts +1 -1
  31. package/src/init.ts +0 -6
  32. package/src/reset-style-props.tsx +1 -1
  33. package/src/styles-inheritance/components/styles-inheritance-infotip.tsx +1 -1
  34. package/src/utils/get-styles-provider-color.ts +8 -0
  35. package/src/components/popover-scrollable-content.tsx +0 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-editing-panel",
3
- "version": "1.47.0",
3
+ "version": "1.50.0",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,25 +39,24 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "0.20.1",
43
- "@elementor/editor-canvas": "0.25.0",
44
- "@elementor/editor-controls": "1.2.0",
45
- "@elementor/editor-current-user": "0.5.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",
42
+ "@elementor/editor": "0.21.1",
43
+ "@elementor/editor-canvas": "0.28.0",
44
+ "@elementor/editor-controls": "1.5.0",
45
+ "@elementor/editor-documents": "0.13.10",
46
+ "@elementor/editor-elements": "0.9.2",
47
+ "@elementor/editor-panels": "0.17.1",
48
+ "@elementor/editor-props": "0.18.0",
50
49
  "@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",
50
+ "@elementor/editor-styles": "0.6.14",
51
+ "@elementor/editor-styles-repository": "0.10.7",
52
+ "@elementor/editor-ui": "0.14.2",
54
53
  "@elementor/editor-v1-adapters": "0.12.1",
55
- "@elementor/icons": "1.44.0",
54
+ "@elementor/icons": "1.46.0",
56
55
  "@elementor/locations": "0.8.0",
57
56
  "@elementor/menus": "0.1.5",
58
57
  "@elementor/schema": "0.1.2",
59
58
  "@elementor/session": "0.1.0",
60
- "@elementor/ui": "1.35.5",
59
+ "@elementor/ui": "1.36.0",
61
60
  "@elementor/utils": "0.5.0",
62
61
  "@elementor/wp-media": "0.6.1",
63
62
  "@wordpress/i18n": "^5.13.0"
@@ -10,6 +10,7 @@ import {
10
10
  type ChipOwnProps,
11
11
  Stack,
12
12
  type Theme,
13
+ ThemeProvider,
13
14
  Typography,
14
15
  UnstableChipGroup,
15
16
  usePopupState,
@@ -69,7 +70,7 @@ export function CssClassItem( props: CssClassItemProps ) {
69
70
  const isShowingState = isActive && meta.state;
70
71
 
71
72
  return (
72
- <>
73
+ <ThemeProvider palette="default">
73
74
  <UnstableChipGroup
74
75
  ref={ setChipRef }
75
76
  { ...chipGroupProps }
@@ -144,7 +145,7 @@ export function CssClassItem( props: CssClassItemProps ) {
144
145
  <CssClassProvider { ...classProps } handleRename={ openEditMode }>
145
146
  <CssClassMenu popupState={ popupState } anchorEl={ chipRef } fixed={ fixed } />
146
147
  </CssClassProvider>
147
- </>
148
+ </ThemeProvider>
148
149
  );
149
150
  }
150
151
 
@@ -7,7 +7,7 @@ import { __ } from '@wordpress/i18n';
7
7
 
8
8
  import { useStyle } from '../../contexts/style-context';
9
9
  import { type StyleDefinitionStateWithNormal } from '../../styles-inheritance/types';
10
- import { getStylesProviderThemeColor } from '../../utils/get-styles-provider-color';
10
+ import { getTempStylesProviderThemeColor } from '../../utils/get-styles-provider-color';
11
11
  import { StyleIndicator } from '../style-indicator';
12
12
  import { useCssClass } from './css-class-context';
13
13
  import { useUnapplyClass } from './use-apply-and-unapply-class';
@@ -161,7 +161,7 @@ function StateMenuItem( { state, closeMenu, ...props }: StateMenuItemProps ) {
161
161
  { isStyled && (
162
162
  <StyleIndicator
163
163
  aria-label={ __( 'Has style', 'elementor' ) }
164
- getColor={ getStylesProviderThemeColor( provider ?? '' ) }
164
+ getColor={ getTempStylesProviderThemeColor( provider ?? '' ) }
165
165
  />
166
166
  ) }
167
167
  { state ?? 'normal' }
@@ -53,7 +53,7 @@ const EMPTY_OPTION = {
53
53
  label: __( 'local', 'elementor' ),
54
54
  value: null,
55
55
  fixed: true,
56
- color: 'accent',
56
+ color: getTempStylesProviderColorName( 'accent' ),
57
57
  icon: <MapPinIcon />,
58
58
  provider: null,
59
59
  } satisfies StyleDefOption;
@@ -221,7 +221,7 @@ function useOptions() {
221
221
  label: styleDef.label,
222
222
  value: styleDef.id,
223
223
  fixed: isElements,
224
- color: getStylesProviderColorName( provider.getKey() ),
224
+ color: getTempStylesProviderColorName( getStylesProviderColorName( provider.getKey() ) ),
225
225
  icon: isElements ? <MapPinIcon /> : null,
226
226
  provider: provider.getKey(),
227
227
  };
@@ -229,6 +229,14 @@ function useOptions() {
229
229
  } );
230
230
  }
231
231
 
232
+ function getTempStylesProviderColorName( color: ChipOwnProps[ 'color' ] ): ChipOwnProps[ 'color' ] {
233
+ if ( color === 'accent' ) {
234
+ return 'primary';
235
+ }
236
+
237
+ return color;
238
+ }
239
+
232
240
  function useCreateAction() {
233
241
  const [ provider, createAction ] = useCreateAndApplyClass();
234
242
  if ( ! provider || ! createAction ) {
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { PopoverBody as BasePopoverBody } from '@elementor/editor-ui';
3
+
4
+ import { useSectionWidth } from '../contexts/section-context';
5
+
6
+ type Props = React.ComponentProps< typeof BasePopoverBody >;
7
+
8
+ export const PopoverBody = ( props: Props ) => {
9
+ const sectionWidth = useSectionWidth();
10
+
11
+ return <BasePopoverBody { ...props } width={ sectionWidth } />;
12
+ };
@@ -8,6 +8,8 @@ import { BorderColorField } from './border-color-field';
8
8
  import { BorderStyleField } from './border-style-field';
9
9
  import { BorderWidthField } from './border-width-field';
10
10
 
11
+ const BORDER_LABEL = __( 'Border', 'elementor' );
12
+
11
13
  const initialBorder = {
12
14
  'border-width': { $$type: 'size', value: { size: 1, unit: 'px' } },
13
15
  'border-color': { $$type: 'color', value: '#000000' },
@@ -17,16 +19,21 @@ const initialBorder = {
17
19
  export const BorderField = () => {
18
20
  const { values, setValues, canEdit } = useStylesFields( Object.keys( initialBorder ) );
19
21
 
22
+ const meta = { history: { propDisplayName: BORDER_LABEL } };
23
+
20
24
  const addBorder = () => {
21
- setValues( initialBorder );
25
+ setValues( initialBorder, meta );
22
26
  };
23
27
 
24
28
  const removeBorder = () => {
25
- setValues( {
26
- 'border-width': null,
27
- 'border-color': null,
28
- 'border-style': null,
29
- } );
29
+ setValues(
30
+ {
31
+ 'border-width': null,
32
+ 'border-color': null,
33
+ 'border-style': null,
34
+ },
35
+ meta
36
+ );
30
37
  };
31
38
 
32
39
  const hasBorder = Object.values( values ?? {} ).some( Boolean );
@@ -37,7 +44,7 @@ export const BorderField = () => {
37
44
  onAdd={ addBorder }
38
45
  onRemove={ removeBorder }
39
46
  disabled={ ! canEdit }
40
- renderLabel={ () => <ControlFormLabel>{ __( 'Border', 'elementor' ) }</ControlFormLabel> }
47
+ renderLabel={ () => <ControlFormLabel>{ BORDER_LABEL }</ControlFormLabel> }
41
48
  >
42
49
  <BorderWidthField />
43
50
  <BorderColorField />
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { BoxShadowRepeaterControl, FilterRepeaterControl } from '@elementor/editor-controls';
2
+ import { BoxShadowRepeaterControl, FilterRepeaterControl, TransformRepeaterControl } from '@elementor/editor-controls';
3
3
  import { isExperimentActive } from '@elementor/editor-v1-adapters';
4
4
  import { __ } from '@wordpress/i18n';
5
5
 
@@ -10,24 +10,38 @@ import { SectionContent } from '../../section-content';
10
10
  import { OpacityControlField } from '../layout-section/opacity-control-field';
11
11
 
12
12
  const BOX_SHADOW_LABEL = __( 'Box shadow', 'elementor' );
13
- const FILTER_LABEL = __( 'Filter', 'elementor' );
13
+ const FILTER_LABEL = __( 'Filters', 'elementor' );
14
+ const TRANSFORM_LABEL = __( 'Transform', 'elementor' );
15
+ const BACKDROP_FILTER_LABEL = __( 'Backdrop filters', 'elementor' );
14
16
 
15
17
  export const EffectsSection = () => {
16
18
  const isVersion331Active = isExperimentActive( EXPERIMENTAL_FEATURES.V_3_31 );
17
19
 
18
20
  return (
19
21
  <SectionContent>
20
- <OpacityControlField />
21
- <PanelDivider />
22
+ { isVersion331Active && (
23
+ <>
24
+ <OpacityControlField />
25
+ <PanelDivider />
26
+ </>
27
+ ) }
22
28
  <StylesField bind="box-shadow" propDisplayName={ BOX_SHADOW_LABEL }>
23
29
  <BoxShadowRepeaterControl />
24
30
  </StylesField>
25
31
  { isVersion331Active && (
26
32
  <>
33
+ <PanelDivider />
34
+ <StylesField bind="transform" propDisplayName={ TRANSFORM_LABEL }>
35
+ <TransformRepeaterControl />
36
+ </StylesField>
27
37
  <PanelDivider />
28
38
  <StylesField bind="filter" propDisplayName={ FILTER_LABEL }>
29
39
  <FilterRepeaterControl />
30
40
  </StylesField>
41
+ <PanelDivider />
42
+ <StylesField bind="backdrop-filter" propDisplayName={ BACKDROP_FILTER_LABEL }>
43
+ <FilterRepeaterControl filterPropName="backdrop-filter" />
44
+ </StylesField>
31
45
  </>
32
46
  ) }
33
47
  </SectionContent>
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { useState } from 'react';
2
+ import { useEffect, useState } from 'react';
3
3
  import { ControlToggleButtonGroup, NumberControl, type ToggleButtonGroupItem } from '@elementor/editor-controls';
4
4
  import { type NumberPropValue } from '@elementor/editor-props';
5
5
  import { ArrowDownSmallIcon, ArrowUpSmallIcon, PencilIcon } from '@elementor/icons';
@@ -50,10 +50,21 @@ const items: ToggleButtonGroupItem< GroupControlItemOption >[] = [
50
50
  ];
51
51
 
52
52
  export const FlexOrderField = () => {
53
- const { value: order, setValue: setOrder, canEdit } = useStylesField< NumberPropValue | null >( 'order' );
53
+ const {
54
+ value: order,
55
+ setValue: setOrder,
56
+ canEdit,
57
+ } = useStylesField< NumberPropValue | null >( 'order', {
58
+ history: { propDisplayName: ORDER_LABEL },
59
+ } );
54
60
 
55
61
  const [ groupControlValue, setGroupControlValue ] = useState( getGroupControlValue( order?.value || null ) );
56
62
 
63
+ useEffect( () => {
64
+ const newGroupControlValue = getGroupControlValue( order?.value || null );
65
+ setGroupControlValue( newGroupControlValue );
66
+ }, [ order?.value ] );
67
+
57
68
  const handleToggleButtonChange = ( group: GroupControlItemOption | null ) => {
58
69
  setGroupControlValue( group );
59
70
 
@@ -69,8 +80,8 @@ export const FlexOrderField = () => {
69
80
  return (
70
81
  <StylesField bind="order" propDisplayName={ ORDER_LABEL }>
71
82
  <UiProviders>
72
- <StylesFieldLayout label={ ORDER_LABEL }>
73
- <SectionContent>
83
+ <SectionContent>
84
+ <StylesFieldLayout label={ ORDER_LABEL }>
74
85
  <ControlToggleButtonGroup
75
86
  items={ items }
76
87
  value={ groupControlValue }
@@ -78,22 +89,22 @@ export const FlexOrderField = () => {
78
89
  exclusive={ true }
79
90
  disabled={ ! canEdit }
80
91
  />
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>
92
+ </StylesFieldLayout>
93
+ { CUSTOM === groupControlValue && (
94
+ <Grid container gap={ 2 } alignItems="center" flexWrap="nowrap">
95
+ <Grid item xs={ 6 }>
96
+ <ControlLabel>{ __( 'Custom order', 'elementor' ) }</ControlLabel>
97
+ </Grid>
98
+ <Grid item xs={ 6 } sx={ { display: 'flex', justifyContent: 'end' } }>
99
+ <NumberControl
100
+ min={ FIRST_DEFAULT_VALUE + 1 }
101
+ max={ LAST_DEFAULT_VALUE - 1 }
102
+ shouldForceInt={ true }
103
+ />
93
104
  </Grid>
94
- ) }
95
- </SectionContent>
96
- </StylesFieldLayout>
105
+ </Grid>
106
+ ) }
107
+ </SectionContent>
97
108
  </UiProviders>
98
109
  </StylesField>
99
110
  );
@@ -60,31 +60,29 @@ export const FlexSizeField = () => {
60
60
  const onChangeGroup = ( group: GroupItem | null = null ) => {
61
61
  setActiveGroup( group );
62
62
 
63
+ let props;
64
+
63
65
  if ( ! group || group === 'custom' ) {
64
- setValues( {
66
+ props = {
65
67
  'flex-basis': null,
66
68
  'flex-grow': null,
67
69
  'flex-shrink': null,
68
- } );
69
-
70
- return;
71
- }
72
-
73
- if ( group === 'flex-grow' ) {
74
- setValues( {
70
+ };
71
+ } else if ( group === 'flex-grow' ) {
72
+ props = {
75
73
  'flex-basis': null,
76
74
  'flex-grow': numberPropTypeUtil.create( DEFAULT ),
77
75
  'flex-shrink': null,
78
- } );
79
-
80
- return;
76
+ };
77
+ } else {
78
+ props = {
79
+ 'flex-basis': null,
80
+ 'flex-grow': null,
81
+ 'flex-shrink': numberPropTypeUtil.create( DEFAULT ),
82
+ };
81
83
  }
82
84
 
83
- setValues( {
84
- 'flex-basis': null,
85
- 'flex-grow': null,
86
- 'flex-shrink': numberPropTypeUtil.create( DEFAULT ),
87
- } );
85
+ setValues( props, { history: { propDisplayName: FLEX_SIZE_LABEL } } );
88
86
  };
89
87
 
90
88
  return (
@@ -20,8 +20,13 @@ import { GapControlField } from './gap-control-field';
20
20
  import { JustifyContentField } from './justify-content-field';
21
21
  import { WrapField } from './wrap-field';
22
22
 
23
+ const DISPLAY_LABEL = __( 'Display', 'elementor' );
24
+ const FLEX_WRAP_LABEL = __( 'Flex wrap', 'elementor' );
25
+
23
26
  export const LayoutSection = () => {
24
- const { value: display } = useStylesField< StringPropValue >( 'display' );
27
+ const { value: display } = useStylesField< StringPropValue >( 'display', {
28
+ history: { propDisplayName: DISPLAY_LABEL },
29
+ } );
25
30
  const displayPlaceholder = useDisplayPlaceholderValue();
26
31
  const isDisplayFlex = shouldDisplayFlexFields( display, displayPlaceholder as StringPropValue );
27
32
  const { element } = useElement();
@@ -39,7 +44,9 @@ export const LayoutSection = () => {
39
44
  };
40
45
 
41
46
  const FlexFields = () => {
42
- const { value: flexWrap } = useStylesField< StringPropValue >( 'flex-wrap' );
47
+ const { value: flexWrap } = useStylesField< StringPropValue >( 'flex-wrap', {
48
+ history: { propDisplayName: FLEX_WRAP_LABEL },
49
+ } );
43
50
 
44
51
  return (
45
52
  <>
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { useRef } from 'react';
3
3
  import { type StringPropValue } from '@elementor/editor-props';
4
4
  import { type ToggleButtonProps, useTheme } from '@elementor/ui';
5
+ import { __ } from '@wordpress/i18n';
5
6
 
6
7
  import { useStylesField } from '../../../../hooks/use-styles-field';
7
8
  import type { FlexDirection } from '../flex-direction-field';
@@ -14,6 +15,8 @@ type Props = {
14
15
  disableRotationForReversed?: boolean;
15
16
  };
16
17
 
18
+ const FLEX_DIRECTION_LABEL = __( 'Flex direction', 'elementor' );
19
+
17
20
  const CLOCKWISE_ANGLES: Record< FlexDirection, number > = {
18
21
  row: 0,
19
22
  column: 90,
@@ -48,7 +51,9 @@ const useGetTargetAngle = (
48
51
  disableRotationForReversed: boolean,
49
52
  existingRef?: React.MutableRefObject< number >
50
53
  ) => {
51
- const { value: direction } = useStylesField< StringPropValue >( 'flex-direction' );
54
+ const { value: direction } = useStylesField< StringPropValue >( 'flex-direction', {
55
+ history: { propDisplayName: FLEX_DIRECTION_LABEL },
56
+ } );
52
57
  const isRtl = 'rtl' === useTheme().direction;
53
58
  const rotationMultiplier = isRtl ? -1 : 1;
54
59
  const angleMap = isClockwise ? CLOCKWISE_ANGLES : COUNTER_CLOCKWISE_ANGLES;
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { type StringPropValue } from '@elementor/editor-props';
3
3
  import { isExperimentActive } from '@elementor/editor-v1-adapters';
4
4
  import { useSessionStorage } from '@elementor/session';
5
+ import { __ } from '@wordpress/i18n';
5
6
 
6
7
  import { useStyle } from '../../../contexts/style-context';
7
8
  import { useStylesField } from '../../../hooks/use-styles-field';
@@ -28,8 +29,13 @@ type DimensionsValues = {
28
29
  'inset-inline-end': DimensionValue;
29
30
  };
30
31
 
32
+ const POSITION_LABEL = __( 'Position', 'elementor' );
33
+ const DIMENSIONS_LABEL = __( 'Dimensions', 'elementor' );
34
+
31
35
  export const PositionSection = () => {
32
- const { value: positionValue } = useStylesField< StringPropValue >( 'position' );
36
+ const { value: positionValue } = useStylesField< StringPropValue >( 'position', {
37
+ history: { propDisplayName: POSITION_LABEL },
38
+ } );
33
39
  const { values: dimensions, setValues: setDimensions } = useStylesFields< DimensionsValues >( [
34
40
  'inset-block-start',
35
41
  'inset-block-end',
@@ -41,19 +47,24 @@ export const PositionSection = () => {
41
47
  const isCssIdFeatureActive = isExperimentActive( 'e_v_3_30' );
42
48
 
43
49
  const onPositionChange = ( newPosition: string | null, previousPosition: string | null | undefined ) => {
50
+ const meta = { history: { propDisplayName: DIMENSIONS_LABEL } };
51
+
44
52
  if ( newPosition === 'static' ) {
45
53
  if ( dimensions ) {
46
54
  updateDimensionsHistory( dimensions );
47
- setDimensions( {
48
- 'inset-block-start': undefined,
49
- 'inset-block-end': undefined,
50
- 'inset-inline-start': undefined,
51
- 'inset-inline-end': undefined,
52
- } );
55
+ setDimensions(
56
+ {
57
+ 'inset-block-start': undefined,
58
+ 'inset-block-end': undefined,
59
+ 'inset-inline-start': undefined,
60
+ 'inset-inline-end': undefined,
61
+ },
62
+ meta
63
+ );
53
64
  }
54
65
  } else if ( previousPosition === 'static' ) {
55
66
  if ( dimensionsValuesFromHistory ) {
56
- setDimensions( dimensionsValuesFromHistory );
67
+ setDimensions( dimensionsValuesFromHistory, meta );
57
68
  clearDimensionsHistory();
58
69
  }
59
70
  }
@@ -52,9 +52,12 @@ const CssSizeProps = [
52
52
  ];
53
53
 
54
54
  const ASPECT_RATIO_LABEL = __( 'Aspect Ratio', 'elementor' );
55
+ const OBJECT_FIT_LABEL = __( 'Object fit', 'elementor' );
55
56
 
56
57
  export const SizeSection = () => {
57
- const { value: fitValue } = useStylesField< StringPropValue >( 'object-fit' );
58
+ const { value: fitValue } = useStylesField< StringPropValue >( 'object-fit', {
59
+ history: { propDisplayName: OBJECT_FIT_LABEL },
60
+ } );
58
61
 
59
62
  const isNotFill = fitValue && fitValue?.value !== 'fill';
60
63
 
@@ -27,7 +27,9 @@ const initTextStroke = {
27
27
  const TEXT_STROKE_LABEL = __( 'Text stroke', 'elementor' );
28
28
 
29
29
  export const TextStrokeField = () => {
30
- const { value, setValue, canEdit } = useStylesField( 'stroke' );
30
+ const { value, setValue, canEdit } = useStylesField( 'stroke', {
31
+ history: { propDisplayName: TEXT_STROKE_LABEL },
32
+ } );
31
33
 
32
34
  const addTextStroke = () => {
33
35
  setValue( initTextStroke );
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import type { NumberPropValue } from '@elementor/editor-props';
3
3
  import { isExperimentActive } from '@elementor/editor-v1-adapters';
4
+ import { __ } from '@wordpress/i18n';
4
5
 
5
6
  import { useStylesField } from '../../../hooks/use-styles-field';
6
7
  import { PanelDivider } from '../../panel-divider';
@@ -22,8 +23,12 @@ import { TextStrokeField } from './text-stroke-field';
22
23
  import { TransformField } from './transform-field';
23
24
  import { WordSpacingField } from './word-spacing-field';
24
25
 
26
+ const COLUMN_COUNT_LABEL = __( 'Column count', 'elementor' );
27
+
25
28
  export const TypographySection = () => {
26
- const { value: columnCount } = useStylesField< NumberPropValue >( 'column-count' );
29
+ const { value: columnCount } = useStylesField< NumberPropValue >( 'column-count', {
30
+ history: { propDisplayName: COLUMN_COUNT_LABEL },
31
+ } );
27
32
  const hasMultiColumns = !! ( columnCount?.value && columnCount?.value > 1 );
28
33
 
29
34
  const isVersion330Active = isExperimentActive( 'e_v_3_30' );
@@ -29,7 +29,7 @@ const TABS_HEADER_HEIGHT = '37px';
29
29
 
30
30
  export const stickyHeaderStyles = {
31
31
  position: 'sticky',
32
- zIndex: 1,
32
+ zIndex: 1100,
33
33
  opacity: 1,
34
34
  backgroundColor: 'background.default',
35
35
  transition: 'top 300ms ease',
@@ -7,9 +7,9 @@ import {
7
7
  getElementLabel,
8
8
  getElementSetting,
9
9
  updateElementSettings,
10
- useElementSetting,
10
+ useElementSettings,
11
11
  } from '@elementor/editor-elements';
12
- import { type PropKey, type PropValue } from '@elementor/editor-props';
12
+ import { type PropKey, type PropType, type PropValue, shouldApplyEffect } from '@elementor/editor-props';
13
13
  import { isExperimentActive, undoable } from '@elementor/editor-v1-adapters';
14
14
  import { __ } from '@wordpress/i18n';
15
15
 
@@ -26,9 +26,9 @@ type Props = {
26
26
  export const SettingsField = ( { bind, children, propDisplayName }: Props ) => {
27
27
  const { element, elementType } = useElement();
28
28
 
29
- const settingsValue = useElementSetting< PropValue >( element.id, bind );
29
+ const elementSettingValues = useElementSettings< PropValue >( element.id, Object.keys( elementType.propsSchema ) );
30
30
 
31
- const value = { [ bind ]: settingsValue };
31
+ const value = { [ bind ]: elementSettingValues?.[ bind ] };
32
32
 
33
33
  const propType = createTopLevelOjectType( { schema: elementType.propsSchema } );
34
34
 
@@ -48,13 +48,29 @@ export const SettingsField = ( { bind, children, propDisplayName }: Props ) => {
48
48
  }
49
49
  };
50
50
 
51
+ const isDisabled = ( prop: PropType ) => getDisableState( prop, elementSettingValues );
52
+
51
53
  return (
52
- <PropProvider propType={ propType } value={ value } setValue={ setValue }>
54
+ <PropProvider propType={ propType } value={ value } setValue={ setValue } isDisabled={ isDisabled }>
53
55
  <PropKeyProvider bind={ bind }>{ children }</PropKeyProvider>
54
56
  </PropProvider>
55
57
  );
56
58
  };
57
59
 
60
+ function getDisableState( propType: PropType, elementValues: PropValue ): boolean | undefined {
61
+ const disablingDependencies = propType.dependencies?.filter( ( { effect } ) => effect === 'disable' ) || [];
62
+
63
+ if ( ! disablingDependencies.length ) {
64
+ return false;
65
+ }
66
+
67
+ if ( disablingDependencies.length > 1 ) {
68
+ throw new Error( 'Multiple disabling dependencies are not supported.' );
69
+ }
70
+
71
+ return shouldApplyEffect( disablingDependencies[ 0 ], elementValues );
72
+ }
73
+
58
74
  type UndoableUpdateElementSettingsArgs = {
59
75
  newValue: Record< string, PropValue >;
60
76
  };
@@ -16,8 +16,10 @@ export type StylesFieldProps = {
16
16
  propDisplayName: string;
17
17
  };
18
18
 
19
- export const StylesField = ( { bind, placeholder, children }: StylesFieldProps ) => {
20
- const { value, setValue, canEdit } = useStylesField( bind );
19
+ export const StylesField = ( { bind, placeholder, propDisplayName, children }: StylesFieldProps ) => {
20
+ const { value, setValue, canEdit } = useStylesField( bind, {
21
+ history: { propDisplayName },
22
+ } );
21
23
 
22
24
  const isVersion331Active = isExperimentActive( 'e_v_3_31' );
23
25
  const stylesInheritanceChain = useStylesInheritanceChain( [ bind ] );
@@ -49,7 +51,7 @@ export const StylesField = ( { bind, placeholder, children }: StylesFieldProps )
49
51
  value={ values }
50
52
  setValue={ setValues }
51
53
  placeholder={ placeholderValues }
52
- disabled={ ! canEdit }
54
+ isDisabled={ () => ! canEdit }
53
55
  >
54
56
  <PropKeyProvider bind={ bind }>{ children }</PropKeyProvider>
55
57
  </PropProvider>