@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.js
CHANGED
|
@@ -2109,10 +2109,17 @@ function OverrideControl({ overridableProp }) {
|
|
|
2109
2109
|
if (!propType || !elementType) {
|
|
2110
2110
|
return null;
|
|
2111
2111
|
}
|
|
2112
|
-
const propValue =
|
|
2112
|
+
const { propValue, placeholderValue } = resolveValueAndPlaceholder(
|
|
2113
|
+
matchingOverride,
|
|
2114
|
+
settingsWithInnerOverrides,
|
|
2115
|
+
propKey
|
|
2116
|
+
);
|
|
2113
2117
|
const value = {
|
|
2114
2118
|
[overridableProp.overrideKey]: propValue
|
|
2115
2119
|
};
|
|
2120
|
+
const placeholder = {
|
|
2121
|
+
[overridableProp.overrideKey]: placeholderValue
|
|
2122
|
+
};
|
|
2116
2123
|
const setValue = (newValue) => {
|
|
2117
2124
|
if (!overridableProps) {
|
|
2118
2125
|
setInstanceValue({
|
|
@@ -2185,6 +2192,7 @@ function OverrideControl({ overridableProp }) {
|
|
|
2185
2192
|
propType: propTypeSchema,
|
|
2186
2193
|
value,
|
|
2187
2194
|
setValue,
|
|
2195
|
+
placeholder,
|
|
2188
2196
|
isDisabled: () => {
|
|
2189
2197
|
return false;
|
|
2190
2198
|
}
|
|
@@ -2194,6 +2202,15 @@ function OverrideControl({ overridableProp }) {
|
|
|
2194
2202
|
)
|
|
2195
2203
|
);
|
|
2196
2204
|
}
|
|
2205
|
+
function resolveValueAndPlaceholder(matchingOverride, settingsWithInnerOverrides, propKey) {
|
|
2206
|
+
const overrideValue = matchingOverride ? resolveOverridePropValue(matchingOverride) : null;
|
|
2207
|
+
const placeholderSettings = unwrapOverridableSettings(settingsWithInnerOverrides);
|
|
2208
|
+
const inheritedValue = placeholderSettings[propKey] ?? null;
|
|
2209
|
+
const isInheritedDynamic = (0, import_editor_editing_panel.isDynamicPropValue)(inheritedValue);
|
|
2210
|
+
const propValue = isInheritedDynamic && !matchingOverride ? inheritedValue : overrideValue;
|
|
2211
|
+
const placeholderValue = matchingOverride || isInheritedDynamic ? null : inheritedValue;
|
|
2212
|
+
return { propValue, placeholderValue };
|
|
2213
|
+
}
|
|
2197
2214
|
function getTempNewValueForDynamicProp(propType, propValue, newPropValue) {
|
|
2198
2215
|
const isRemovingOverride = newPropValue === null;
|
|
2199
2216
|
if (isRemovingOverride && (0, import_editor_editing_panel.isDynamicPropValue)(propValue)) {
|