@elementor/editor-global-classes 3.35.0-341 → 3.35.0-343
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 +18 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -20
- package/src/store.ts +18 -5
package/dist/index.mjs
CHANGED
|
@@ -43,7 +43,6 @@ var GlobalClassTrackingError = createError({
|
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
// src/store.ts
|
|
46
|
-
import { mergeProps } from "@elementor/editor-props";
|
|
47
46
|
import {
|
|
48
47
|
getVariantByMeta
|
|
49
48
|
} from "@elementor/editor-styles";
|
|
@@ -183,9 +182,7 @@ var slice = createSlice({
|
|
|
183
182
|
let customCss = ("custom_css" in payload ? payload.custom_css : variant?.custom_css) ?? null;
|
|
184
183
|
customCss = customCss?.raw ? customCss : null;
|
|
185
184
|
if (variant) {
|
|
186
|
-
|
|
187
|
-
const payloadProps = JSON.parse(JSON.stringify(payload.props));
|
|
188
|
-
variant.props = mergeProps(variantProps, payloadProps);
|
|
185
|
+
variant.props = mergeProps(variant.props, payload.props);
|
|
189
186
|
variant.custom_css = customCss;
|
|
190
187
|
style.variants = getNonEmptyVariants(style);
|
|
191
188
|
} else {
|
|
@@ -230,6 +227,17 @@ var slice = createSlice({
|
|
|
230
227
|
}
|
|
231
228
|
}
|
|
232
229
|
});
|
|
230
|
+
var mergeProps = (current, updates) => {
|
|
231
|
+
const props = Array.isArray(current) ? {} : current;
|
|
232
|
+
Object.entries(updates).forEach(([key, value]) => {
|
|
233
|
+
if (value === null || value === void 0) {
|
|
234
|
+
delete props[key];
|
|
235
|
+
} else {
|
|
236
|
+
props[key] = value;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
return props;
|
|
240
|
+
};
|
|
233
241
|
var getNonEmptyVariants = (style) => {
|
|
234
242
|
return style.variants.filter(
|
|
235
243
|
({ props, custom_css: customCss }) => Object.keys(props).length || customCss?.raw
|