@elementor/editor-components 4.1.0-733 → 4.1.0-735
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 +15 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +23 -23
- package/src/components/instance-editing-panel/override-prop-control.tsx +4 -1
- package/src/components/instance-editing-panel/utils/correct-exposed-empty-override.ts +28 -0
package/dist/index.mjs
CHANGED
|
@@ -1918,6 +1918,19 @@ function hasValue(value) {
|
|
|
1918
1918
|
return value !== null && value !== void 0;
|
|
1919
1919
|
}
|
|
1920
1920
|
|
|
1921
|
+
// src/components/instance-editing-panel/utils/correct-exposed-empty-override.ts
|
|
1922
|
+
function correctExposedEmptyOverride(newPropValue, matchingOverride) {
|
|
1923
|
+
const newOverridableValue = componentOverridablePropTypeUtil.extract(newPropValue);
|
|
1924
|
+
const isExposingEmptyOverride = newOverridableValue && matchingOverride === null;
|
|
1925
|
+
if (!isExposingEmptyOverride) {
|
|
1926
|
+
return newPropValue;
|
|
1927
|
+
}
|
|
1928
|
+
return componentOverridablePropTypeUtil.create({
|
|
1929
|
+
override_key: newOverridableValue.override_key,
|
|
1930
|
+
origin_value: null
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1921
1934
|
// src/components/instance-editing-panel/override-prop-control.tsx
|
|
1922
1935
|
function OverridePropControl({ overrideKey }) {
|
|
1923
1936
|
const overridableProps = useComponentOverridableProps();
|
|
@@ -1963,11 +1976,12 @@ function OverrideControl({ overridableProp }) {
|
|
|
1963
1976
|
});
|
|
1964
1977
|
return;
|
|
1965
1978
|
}
|
|
1966
|
-
|
|
1979
|
+
let newPropValue = getTempNewValueForDynamicProp(
|
|
1967
1980
|
propType,
|
|
1968
1981
|
propValue,
|
|
1969
1982
|
newValue[overridableProp.overrideKey]
|
|
1970
1983
|
);
|
|
1984
|
+
newPropValue = correctExposedEmptyOverride(newPropValue, matchingOverride);
|
|
1971
1985
|
const newOverrideValue = createOverrideValue({
|
|
1972
1986
|
matchingOverride,
|
|
1973
1987
|
overrideKey: overridableProp.overrideKey,
|