@elementor/editor-components 4.1.0-732 → 4.1.0-734

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.js CHANGED
@@ -1984,6 +1984,19 @@ function hasValue(value) {
1984
1984
  return value !== null && value !== void 0;
1985
1985
  }
1986
1986
 
1987
+ // src/components/instance-editing-panel/utils/correct-exposed-empty-override.ts
1988
+ function correctExposedEmptyOverride(newPropValue, matchingOverride) {
1989
+ const newOverridableValue = componentOverridablePropTypeUtil.extract(newPropValue);
1990
+ const isExposingEmptyOverride = newOverridableValue && matchingOverride === null;
1991
+ if (!isExposingEmptyOverride) {
1992
+ return newPropValue;
1993
+ }
1994
+ return componentOverridablePropTypeUtil.create({
1995
+ override_key: newOverridableValue.override_key,
1996
+ origin_value: null
1997
+ });
1998
+ }
1999
+
1987
2000
  // src/components/instance-editing-panel/override-prop-control.tsx
1988
2001
  function OverridePropControl({ overrideKey }) {
1989
2002
  const overridableProps = useComponentOverridableProps();
@@ -2029,11 +2042,12 @@ function OverrideControl({ overridableProp }) {
2029
2042
  });
2030
2043
  return;
2031
2044
  }
2032
- const newPropValue = getTempNewValueForDynamicProp(
2045
+ let newPropValue = getTempNewValueForDynamicProp(
2033
2046
  propType,
2034
2047
  propValue,
2035
2048
  newValue[overridableProp.overrideKey]
2036
2049
  );
2050
+ newPropValue = correctExposedEmptyOverride(newPropValue, matchingOverride);
2037
2051
  const newOverrideValue = createOverrideValue({
2038
2052
  matchingOverride,
2039
2053
  overrideKey: overridableProp.overrideKey,