@elementor/editor-editing-panel 4.2.0-beta2 → 4.3.0-1000

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-editing-panel",
3
- "version": "4.2.0-beta2",
3
+ "version": "4.3.0-1000",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,31 +39,31 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "4.2.0-beta2",
43
- "@elementor/editor-canvas": "4.2.0-beta2",
44
- "@elementor/editor-controls": "4.2.0-beta2",
45
- "@elementor/editor-documents": "4.2.0-beta2",
46
- "@elementor/editor-elements": "4.2.0-beta2",
47
- "@elementor/editor-interactions": "4.2.0-beta2",
48
- "@elementor/editor-notifications": "4.2.0-beta2",
49
- "@elementor/editor-panels": "4.2.0-beta2",
50
- "@elementor/editor-props": "4.2.0-beta2",
51
- "@elementor/editor-responsive": "4.2.0-beta2",
52
- "@elementor/editor-styles": "4.2.0-beta2",
53
- "@elementor/editor-styles-repository": "4.2.0-beta2",
54
- "@elementor/editor-ui": "4.2.0-beta2",
55
- "@elementor/editor-v1-adapters": "4.2.0-beta2",
56
- "@elementor/http-client": "4.2.0-beta2",
42
+ "@elementor/editor": "4.3.0-1000",
43
+ "@elementor/editor-canvas": "4.3.0-1000",
44
+ "@elementor/editor-controls": "4.3.0-1000",
45
+ "@elementor/editor-documents": "4.3.0-1000",
46
+ "@elementor/editor-elements": "4.3.0-1000",
47
+ "@elementor/editor-interactions": "4.3.0-1000",
48
+ "@elementor/editor-notifications": "4.3.0-1000",
49
+ "@elementor/editor-panels": "4.3.0-1000",
50
+ "@elementor/editor-props": "4.3.0-1000",
51
+ "@elementor/editor-responsive": "4.3.0-1000",
52
+ "@elementor/editor-styles": "4.3.0-1000",
53
+ "@elementor/editor-styles-repository": "4.3.0-1000",
54
+ "@elementor/editor-ui": "4.3.0-1000",
55
+ "@elementor/editor-v1-adapters": "4.3.0-1000",
56
+ "@elementor/http-client": "4.3.0-1000",
57
57
  "@elementor/icons": "~1.75.1",
58
- "@elementor/editor-variables": "4.2.0-beta2",
59
- "@elementor/locations": "4.2.0-beta2",
60
- "@elementor/menus": "4.2.0-beta2",
61
- "@elementor/query": "4.2.0-beta2",
62
- "@elementor/schema": "4.2.0-beta2",
63
- "@elementor/session": "4.2.0-beta2",
58
+ "@elementor/editor-variables": "4.3.0-1000",
59
+ "@elementor/locations": "4.3.0-1000",
60
+ "@elementor/menus": "4.3.0-1000",
61
+ "@elementor/query": "4.3.0-1000",
62
+ "@elementor/schema": "4.3.0-1000",
63
+ "@elementor/session": "4.3.0-1000",
64
64
  "@elementor/ui": "1.37.5",
65
- "@elementor/utils": "4.2.0-beta2",
66
- "@elementor/wp-media": "4.2.0-beta2",
65
+ "@elementor/utils": "4.3.0-1000",
66
+ "@elementor/wp-media": "4.3.0-1000",
67
67
  "@wordpress/i18n": "^5.13.0"
68
68
  },
69
69
  "peerDependencies": {
@@ -6,6 +6,7 @@ import { styled } from '@elementor/ui';
6
6
  import { __ } from '@wordpress/i18n';
7
7
 
8
8
  import { useStyle } from '../../../contexts/style-context';
9
+ import { useInheritedValues } from '../../../contexts/styles-inheritance-context';
9
10
  import { useStylesField } from '../../../hooks/use-styles-field';
10
11
  import { useStylesFields } from '../../../hooks/use-styles-fields';
11
12
  import { PanelDivider } from '../../panel-divider';
@@ -38,6 +39,10 @@ const DEPENDENT_PROP_NAMES: Array< keyof DependentValues > = [
38
39
 
39
40
  export const PositionSection = () => {
40
41
  const { value: position } = useStylesField< StringPropValue >( 'position', withHistoryLabel( POSITION_LABEL ) );
42
+ const inheritedPosition = useInheritedValues( [ 'position' ] ).position as StringPropValue | null;
43
+ const resolvedPosition = position ?? inheritedPosition ?? null;
44
+ const isPositionUnsetOrStatic = ! resolvedPosition || resolvedPosition.value === POSITION_STATIC;
45
+
41
46
  const positionPrevRef = useRef( position );
42
47
  const { values: dependentValues, setValues: setDependentValues } =
43
48
  useStylesFields< DependentValues >( DEPENDENT_PROP_NAMES );
@@ -55,19 +60,19 @@ export const PositionSection = () => {
55
60
  clearHistory();
56
61
  }
57
62
 
58
- if ( ( ! position || position?.value === POSITION_STATIC ) && dependentValues?.[ 'z-index' ] ) {
63
+ if ( isPositionUnsetOrStatic && dependentValues?.[ 'z-index' ] ) {
59
64
  setDependentValues( { 'z-index': null }, withHistoryLabel( DIMENSIONS_LABEL ) );
60
65
  }
61
66
 
62
67
  positionPrevRef.current = position;
63
68
  // eslint-disable-next-line react-hooks/exhaustive-deps
64
- }, [ position?.value ] );
69
+ }, [ position?.value, isPositionUnsetOrStatic ] );
65
70
 
66
71
  return (
67
72
  <StyledSectionContent>
68
73
  <PositionField />
69
74
  <DimensionsField />
70
- <ZIndexField disabled={ ! position || position?.value === POSITION_STATIC } />
75
+ <ZIndexField disabled={ isPositionUnsetOrStatic } />
71
76
  <PanelDivider />
72
77
  <OffsetField />
73
78
  </StyledSectionContent>