@flozy/editor 11.1.3 → 11.1.5
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.
@@ -24,6 +24,7 @@ import { getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
|
|
24
24
|
import { useDebouncedCallback } from "use-debounce";
|
25
25
|
import { getElementValues } from "./helper";
|
26
26
|
import updateFormName from "../../utils/updateFormName";
|
27
|
+
import { GetsectionBgImage } from "../../utils/helper";
|
27
28
|
import { jsx as _jsx } from "react/jsx-runtime";
|
28
29
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
29
30
|
const MAX_DEVICE_WIDTH = {
|
@@ -457,6 +458,7 @@ const FreeGrid = props => {
|
|
457
458
|
// return eleId;
|
458
459
|
// }, [autoAlign, updated_at, breakpoint, path]);
|
459
460
|
|
461
|
+
const sectionBgImage = GetsectionBgImage(sectionBackgroundImage);
|
460
462
|
return /*#__PURE__*/_jsx(FreeGridContext.Provider, {
|
461
463
|
value: {
|
462
464
|
isInteracting,
|
@@ -575,7 +577,7 @@ const FreeGrid = props => {
|
|
575
577
|
...classes.root,
|
576
578
|
...freegridSX,
|
577
579
|
background: sectionBgColor || "rgba(255,255,255,1)",
|
578
|
-
|
580
|
+
...sectionBgImage,
|
579
581
|
backgroundSize: "cover"
|
580
582
|
},
|
581
583
|
"data-path": path.join("|"),
|
@@ -41,15 +41,9 @@ const BackgroundImage = props => {
|
|
41
41
|
setOpen(false);
|
42
42
|
};
|
43
43
|
const onSelectImage = img => {
|
44
|
-
|
45
|
-
if (typeof img === "object") {
|
46
|
-
imgUrl = img?.embedURL;
|
47
|
-
} else {
|
48
|
-
imgUrl = img;
|
49
|
-
}
|
50
|
-
setBase64(imgUrl);
|
44
|
+
setBase64(img);
|
51
45
|
onChange({
|
52
|
-
[key]:
|
46
|
+
[key]: img
|
53
47
|
});
|
54
48
|
handleClose();
|
55
49
|
};
|
@@ -1056,4 +1056,19 @@ export const getSelectedElementColor = (editor, format, theme) => {
|
|
1056
1056
|
}
|
1057
1057
|
const color = getSelectedElementStyle(format, editor, format);
|
1058
1058
|
return getSelectedColor(color, theme);
|
1059
|
+
};
|
1060
|
+
export const GetsectionBgImage = sectionBackgroundImage => {
|
1061
|
+
if (sectionBackgroundImage && sectionBackgroundImage !== "none") {
|
1062
|
+
if (typeof sectionBackgroundImage === "object") {
|
1063
|
+
return {
|
1064
|
+
backgroundImage: `url(${sectionBackgroundImage?.embedURL})`
|
1065
|
+
};
|
1066
|
+
} else if (typeof sectionBackgroundImage === "string") {
|
1067
|
+
return {
|
1068
|
+
backgroundImage: `url(${sectionBackgroundImage})`
|
1069
|
+
};
|
1070
|
+
}
|
1071
|
+
} else {
|
1072
|
+
return {};
|
1073
|
+
}
|
1059
1074
|
};
|