@elementor/editor-components 4.1.0-744 → 4.1.0-746
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
|
@@ -2043,10 +2043,17 @@ function OverrideControl({ overridableProp }) {
|
|
|
2043
2043
|
if (!propType || !elementType) {
|
|
2044
2044
|
return null;
|
|
2045
2045
|
}
|
|
2046
|
-
const propValue =
|
|
2046
|
+
const { propValue, placeholderValue } = resolveValueAndPlaceholder(
|
|
2047
|
+
matchingOverride,
|
|
2048
|
+
settingsWithInnerOverrides,
|
|
2049
|
+
propKey
|
|
2050
|
+
);
|
|
2047
2051
|
const value = {
|
|
2048
2052
|
[overridableProp.overrideKey]: propValue
|
|
2049
2053
|
};
|
|
2054
|
+
const placeholder = {
|
|
2055
|
+
[overridableProp.overrideKey]: placeholderValue
|
|
2056
|
+
};
|
|
2050
2057
|
const setValue = (newValue) => {
|
|
2051
2058
|
if (!overridableProps) {
|
|
2052
2059
|
setInstanceValue({
|
|
@@ -2119,6 +2126,7 @@ function OverrideControl({ overridableProp }) {
|
|
|
2119
2126
|
propType: propTypeSchema,
|
|
2120
2127
|
value,
|
|
2121
2128
|
setValue,
|
|
2129
|
+
placeholder,
|
|
2122
2130
|
isDisabled: () => {
|
|
2123
2131
|
return false;
|
|
2124
2132
|
}
|
|
@@ -2128,6 +2136,15 @@ function OverrideControl({ overridableProp }) {
|
|
|
2128
2136
|
)
|
|
2129
2137
|
);
|
|
2130
2138
|
}
|
|
2139
|
+
function resolveValueAndPlaceholder(matchingOverride, settingsWithInnerOverrides, propKey) {
|
|
2140
|
+
const overrideValue = matchingOverride ? resolveOverridePropValue(matchingOverride) : null;
|
|
2141
|
+
const placeholderSettings = unwrapOverridableSettings(settingsWithInnerOverrides);
|
|
2142
|
+
const inheritedValue = placeholderSettings[propKey] ?? null;
|
|
2143
|
+
const isInheritedDynamic = isDynamicPropValue(inheritedValue);
|
|
2144
|
+
const propValue = isInheritedDynamic && !matchingOverride ? inheritedValue : overrideValue;
|
|
2145
|
+
const placeholderValue = matchingOverride || isInheritedDynamic ? null : inheritedValue;
|
|
2146
|
+
return { propValue, placeholderValue };
|
|
2147
|
+
}
|
|
2131
2148
|
function getTempNewValueForDynamicProp(propType, propValue, newPropValue) {
|
|
2132
2149
|
const isRemovingOverride = newPropValue === null;
|
|
2133
2150
|
if (isRemovingOverride && isDynamicPropValue(propValue)) {
|