@flozy/editor 11.1.3 → 11.1.4

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
- backgroundImage: sectionBackgroundImage ? `url('${sectionBackgroundImage}')` : "",
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
- let imgUrl = "";
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]: imgUrl
46
+ [key]: img
53
47
  });
54
48
  handleClose();
55
49
  };
@@ -1056,4 +1056,15 @@ 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
+ return {
1063
+ backgroundImage: `url(${sectionBackgroundImage})`
1064
+ };
1065
+ } else {
1066
+ return {
1067
+ backgroundImage: "none"
1068
+ };
1069
+ }
1059
1070
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "11.1.3",
3
+ "version": "11.1.4",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"