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

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/dist/index.mjs CHANGED
@@ -4909,6 +4909,9 @@ var DEPENDENT_PROP_NAMES = [
4909
4909
  ];
4910
4910
  var PositionSection = () => {
4911
4911
  const { value: position } = useStylesField("position", withHistoryLabel(POSITION_LABEL2));
4912
+ const inheritedPosition = useInheritedValues(["position"]).position;
4913
+ const resolvedPosition = position ?? inheritedPosition ?? null;
4914
+ const isPositionUnsetOrStatic = !resolvedPosition || resolvedPosition.value === POSITION_STATIC;
4912
4915
  const positionPrevRef = useRef12(position);
4913
4916
  const { values: dependentValues, setValues: setDependentValues } = useStylesFields(DEPENDENT_PROP_NAMES);
4914
4917
  const [savedDependentValues, saveToHistory, clearHistory] = usePersistDimensions();
@@ -4920,12 +4923,12 @@ var PositionSection = () => {
4920
4923
  setDependentValues({ ...savedDependentValues }, withHistoryLabel(DIMENSIONS_LABEL));
4921
4924
  clearHistory();
4922
4925
  }
4923
- if ((!position || position?.value === POSITION_STATIC) && dependentValues?.["z-index"]) {
4926
+ if (isPositionUnsetOrStatic && dependentValues?.["z-index"]) {
4924
4927
  setDependentValues({ "z-index": null }, withHistoryLabel(DIMENSIONS_LABEL));
4925
4928
  }
4926
4929
  positionPrevRef.current = position;
4927
- }, [position?.value]);
4928
- return /* @__PURE__ */ React66.createElement(StyledSectionContent, null, /* @__PURE__ */ React66.createElement(PositionField, null), /* @__PURE__ */ React66.createElement(DimensionsField, null), /* @__PURE__ */ React66.createElement(ZIndexField, { disabled: !position || position?.value === POSITION_STATIC }), /* @__PURE__ */ React66.createElement(PanelDivider, null), /* @__PURE__ */ React66.createElement(OffsetField, null));
4930
+ }, [position?.value, isPositionUnsetOrStatic]);
4931
+ return /* @__PURE__ */ React66.createElement(StyledSectionContent, null, /* @__PURE__ */ React66.createElement(PositionField, null), /* @__PURE__ */ React66.createElement(DimensionsField, null), /* @__PURE__ */ React66.createElement(ZIndexField, { disabled: isPositionUnsetOrStatic }), /* @__PURE__ */ React66.createElement(PanelDivider, null), /* @__PURE__ */ React66.createElement(OffsetField, null));
4929
4932
  };
4930
4933
  var usePersistDimensions = () => {
4931
4934
  const { id: styleDefID, meta } = useStyle();