@elementor/editor-components 4.0.0-512 → 4.0.0-514
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
|
@@ -3934,12 +3934,10 @@ var getPropTypeForComponentOverride = (overridableProp) => {
|
|
|
3934
3934
|
if (overridableProp.originPropFields) {
|
|
3935
3935
|
return getPropType(overridableProp.originPropFields);
|
|
3936
3936
|
}
|
|
3937
|
-
const {
|
|
3937
|
+
const { widgetType, propKey } = overridableProp;
|
|
3938
3938
|
return getPropType({
|
|
3939
|
-
elType,
|
|
3940
3939
|
widgetType,
|
|
3941
|
-
propKey
|
|
3942
|
-
elementId
|
|
3940
|
+
propKey
|
|
3943
3941
|
});
|
|
3944
3942
|
};
|
|
3945
3943
|
function getPropType({ widgetType, propKey }) {
|
|
@@ -4066,11 +4064,6 @@ function OverrideControl({ overridableProp, overrides }) {
|
|
|
4066
4064
|
if (!propType) {
|
|
4067
4065
|
return null;
|
|
4068
4066
|
}
|
|
4069
|
-
const propTypeSchema = (0, import_editor_editing_panel3.createTopLevelObjectType)({
|
|
4070
|
-
schema: {
|
|
4071
|
-
[overridableProp.overrideKey]: propType
|
|
4072
|
-
}
|
|
4073
|
-
});
|
|
4074
4067
|
const componentInstanceId = instanceValue.component_id?.value;
|
|
4075
4068
|
if (!componentInstanceId) {
|
|
4076
4069
|
throw new Error("Component ID is required");
|
|
@@ -4081,7 +4074,11 @@ function OverrideControl({ overridableProp, overrides }) {
|
|
|
4081
4074
|
[overridableProp.overrideKey]: propValue
|
|
4082
4075
|
};
|
|
4083
4076
|
const setValue = (newValue) => {
|
|
4084
|
-
const newPropValue =
|
|
4077
|
+
const newPropValue = getTempNewValueForDynamicProp(
|
|
4078
|
+
propType,
|
|
4079
|
+
propValue,
|
|
4080
|
+
newValue[overridableProp.overrideKey]
|
|
4081
|
+
);
|
|
4085
4082
|
const newOverrideValue = createOverrideValue({
|
|
4086
4083
|
matchingOverride,
|
|
4087
4084
|
overrideKey: overridableProp.overrideKey,
|
|
@@ -4123,6 +4120,11 @@ function OverrideControl({ overridableProp, overrides }) {
|
|
|
4123
4120
|
if (!elementType) {
|
|
4124
4121
|
return null;
|
|
4125
4122
|
}
|
|
4123
|
+
const propTypeSchema = (0, import_editor_editing_panel3.createTopLevelObjectType)({
|
|
4124
|
+
schema: {
|
|
4125
|
+
[overridableProp.overrideKey]: propType
|
|
4126
|
+
}
|
|
4127
|
+
});
|
|
4126
4128
|
return /* @__PURE__ */ React26.createElement(
|
|
4127
4129
|
OverridablePropProvider,
|
|
4128
4130
|
{
|
|
@@ -4143,6 +4145,13 @@ function OverrideControl({ overridableProp, overrides }) {
|
|
|
4143
4145
|
)))
|
|
4144
4146
|
);
|
|
4145
4147
|
}
|
|
4148
|
+
function getTempNewValueForDynamicProp(propType, propValue, newPropValue) {
|
|
4149
|
+
const isRemovingOverride = newPropValue === null;
|
|
4150
|
+
if (isRemovingOverride && (0, import_editor_editing_panel3.isDynamicPropValue)(propValue)) {
|
|
4151
|
+
return propType.default ?? null;
|
|
4152
|
+
}
|
|
4153
|
+
return newPropValue;
|
|
4154
|
+
}
|
|
4146
4155
|
function getMatchingOverride(overrides, overrideKey) {
|
|
4147
4156
|
const result = overrides?.find((override) => {
|
|
4148
4157
|
const overridableValue = componentOverridablePropTypeUtil.extract(override);
|