@flozy/editor 5.8.9 → 5.9.1
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/Editor/CommonEditor.js +15 -22
- package/dist/Editor/Editor.css +16 -22
- package/dist/Editor/Elements/AI/PopoverAIInput.js +12 -2
- package/dist/Editor/Elements/Button/EditorButton.js +1 -3
- package/dist/Editor/Elements/DataView/DataView.js +3 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +14 -8
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/NumberType.js +1 -5
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +1 -5
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +19 -23
- package/dist/Editor/Elements/Form/Form.js +0 -1
- package/dist/Editor/Elements/FreeGrid/styles.js +0 -1
- package/dist/Editor/Elements/Grid/GridItem.js +2 -1
- package/dist/Editor/Elements/Link/Link.js +31 -42
- package/dist/Editor/Elements/List/CheckList.js +1 -2
- package/dist/Editor/Elements/Search/SearchAttachment.js +0 -1
- package/dist/Editor/Elements/Search/SearchList.js +1 -8
- package/dist/Editor/Elements/SimpleText/index.js +11 -13
- package/dist/Editor/Elements/SimpleText/style.js +1 -5
- package/dist/Editor/Elements/Table/Table.js +3 -3
- package/dist/Editor/Elements/Table/TableCell.js +9 -14
- package/dist/Editor/Elements/Title/title.js +1 -13
- package/dist/Editor/Elements/Variables/Style.js +2 -28
- package/dist/Editor/Elements/Variables/VariableButton.js +4 -17
- package/dist/Editor/MiniEditor.js +2 -4
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +28 -37
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +1 -3
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +1 -3
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +3 -9
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +0 -5
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +0 -45
- package/dist/Editor/Toolbar/PopupTool/index.js +31 -30
- package/dist/Editor/common/FontLoader/FontList.js +11 -3
- package/dist/Editor/common/FontLoader/FontLoader.js +11 -28
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +0 -1
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -14
- package/dist/Editor/common/Section/index.js +97 -78
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +1 -3
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +0 -4
- package/dist/Editor/common/Uploader.js +0 -8
- package/dist/Editor/common/iconslist.js +2 -1
- package/dist/Editor/commonStyle.js +57 -58
- package/dist/Editor/helper/index.js +2 -2
- package/dist/Editor/helper/theme.js +1 -24
- package/dist/Editor/hooks/useEditorScroll.js +1 -1
- package/dist/Editor/hooks/useMouseMove.js +2 -5
- package/dist/Editor/plugins/withLayout.js +1 -1
- package/dist/Editor/utils/SlateUtilityFunctions.js +4 -15
- package/dist/Editor/utils/button.js +4 -4
- package/dist/Editor/utils/customHooks/useTableResize.js +1 -2
- package/dist/Editor/utils/draftToSlate.js +2 -3
- package/dist/Editor/utils/helper.js +19 -60
- package/dist/Editor/utils/pageSettings.js +2 -14
- package/dist/Editor/utils/table.js +0 -21
- package/package.json +2 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +0 -79
- package/dist/Editor/helper/ensureWrappedVariables.js +0 -28
@@ -1,5 +1,5 @@
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
2
|
-
import { Popper, Paper, ClickAwayListener } from "@mui/material";
|
1
|
+
import React, { useCallback, useEffect, useState } from "react";
|
2
|
+
import { Popper, Fade, Paper, ClickAwayListener } from "@mui/material";
|
3
3
|
import { Editor, Range, Transforms } from "slate";
|
4
4
|
import { ReactEditor, useSlate } from "slate-react";
|
5
5
|
import useDrag from "../../hooks/useDrag";
|
@@ -9,7 +9,6 @@ import { useEditorContext } from "../../hooks/useMouseMove";
|
|
9
9
|
import usePopupStyles from "../PopupTool/PopupToolStyle";
|
10
10
|
import useEditorScroll from "../../hooks/useEditorScroll";
|
11
11
|
import { isCarouselSelected } from "../../helper";
|
12
|
-
import { hideSlateSelection } from "../../utils/helper";
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
14
13
|
const PopupTool = props => {
|
15
14
|
const {
|
@@ -21,8 +20,7 @@ const PopupTool = props => {
|
|
21
20
|
const classes = usePopupStyles(theme);
|
22
21
|
const {
|
23
22
|
setPopupType,
|
24
|
-
openAI
|
25
|
-
selectedElement
|
23
|
+
openAI
|
26
24
|
} = useEditorContext();
|
27
25
|
const [anchorEl, setAnchorEl] = useState(null);
|
28
26
|
const [open, setOpen] = useState(false);
|
@@ -33,10 +31,13 @@ const PopupTool = props => {
|
|
33
31
|
const [event] = useDrag(anchorEl);
|
34
32
|
const id = open ? "popup-edit-tool" : "";
|
35
33
|
const [size] = useWindowResize();
|
36
|
-
const
|
34
|
+
const {
|
35
|
+
selectedElement
|
36
|
+
} = useEditorContext();
|
37
|
+
const updateAnchorEl = useCallback(() => {
|
37
38
|
try {
|
38
39
|
const isHavingSelection = selection && !Range.isCollapsed(selection);
|
39
|
-
if (isHavingSelection
|
40
|
+
if (isHavingSelection) {
|
40
41
|
const domRange = ReactEditor.toDOMRange(editor, editor.selection);
|
41
42
|
const editorContainer = document.querySelector("#slate-wrapper-scroll-container")?.getBoundingClientRect();
|
42
43
|
const rect = domRange.getBoundingClientRect();
|
@@ -45,21 +46,16 @@ const PopupTool = props => {
|
|
45
46
|
rect.y = -500; // hide the popper
|
46
47
|
}
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
document.body.appendChild(anchor);
|
54
|
-
if (!anchorEl || isScroll === "scroll") {
|
55
|
-
setAnchorEl(anchor);
|
56
|
-
setOpen(true);
|
57
|
-
}
|
49
|
+
setAnchorEl({
|
50
|
+
clientWidth: rect.width,
|
51
|
+
clientHeight: rect.height,
|
52
|
+
getBoundingClientRect: () => rect
|
53
|
+
});
|
58
54
|
}
|
59
55
|
} catch (err) {
|
60
56
|
console.log(err);
|
61
57
|
}
|
62
|
-
};
|
58
|
+
}, [selection]);
|
63
59
|
useEditorScroll(editorWrapper, updateAnchorEl);
|
64
60
|
useEffect(() => {
|
65
61
|
const userStoppedSelection = size?.device === "xs" ? true : event === "end"; // for mobile, when user starts the selection, we are gonna show the popup tool
|
@@ -87,9 +83,8 @@ const PopupTool = props => {
|
|
87
83
|
setAnchorEl(null);
|
88
84
|
} else {
|
89
85
|
updateAnchorEl();
|
90
|
-
hideSlateSelection(); // removes slate selection background, when there is no selection
|
91
86
|
}
|
92
|
-
}, [selection
|
87
|
+
}, [selection]);
|
93
88
|
useEffect(() => {
|
94
89
|
if (selectedElement?.enable === 1) {
|
95
90
|
setAnchorEl(null);
|
@@ -120,18 +115,24 @@ const PopupTool = props => {
|
|
120
115
|
id: id,
|
121
116
|
open: open,
|
122
117
|
anchorEl: anchorEl,
|
118
|
+
transition: true,
|
123
119
|
sx: classes.popupWrapper,
|
124
120
|
placement: "top-start",
|
125
|
-
children:
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
121
|
+
children: ({
|
122
|
+
TransitionProps
|
123
|
+
}) => /*#__PURE__*/_jsx(Fade, {
|
124
|
+
...TransitionProps,
|
125
|
+
children: /*#__PURE__*/_jsx(Paper, {
|
126
|
+
style: {
|
127
|
+
borderRadius: "6px",
|
128
|
+
border: "1px solid #8360FD"
|
129
|
+
},
|
130
|
+
children: /*#__PURE__*/_jsx(MiniTextFormat, {
|
131
|
+
editor: editor,
|
132
|
+
classes: classes,
|
133
|
+
closeMainPopup: handleClose,
|
134
|
+
customProps: customProps
|
135
|
+
})
|
135
136
|
})
|
136
137
|
})
|
137
138
|
})
|
@@ -1,3 +1,11 @@
|
|
1
|
-
const
|
2
|
-
|
3
|
-
|
1
|
+
export const defaultFonts = [
|
2
|
+
// "EB Garamond",
|
3
|
+
"Anton", "DM Serif Text", "Libre Baskerville", "Montserrat", "Open Sans", "Public Sans", "Raleway", "Space Mono", "Great Vibes", "Zeyada", "Allura", "Pinyon Script", "Dancing Script", "Gaegu", "Kite One", "Merriweather"];
|
4
|
+
export const otherFonts = ["PoppinsRegular", "PoppinsBold", "Monaco", "Qwitcher Grypen", "Bulgarian Garamond", "Redacted Script", "Herr Von Muellerhoff", "Dawning of a New Day", "Coming Soon", "Engagement", "Ingrid Darling", "La Belle Aurore", "Mea Culpa", "The Girl Next Door", "Helvetica", "Georgia", "Times New Roman", "Courier New", "Impact"];
|
5
|
+
export const googleFontList = ["Roboto", "Noto Sans JP", "Poppins", "Lato", "Inter", "Roboto Condensed", "Roboto Mono", "Oswald", "Noto Sans", "Nunito", "Nunito Sans", "Ubuntu", "Rubik", "Playfair Display", "Noto Sans KR", "Roboto Slab", "PT Sans", "Kanit", "Work Sans", "Lora", "DM Sans", "Mulish", "Quicksand", "Fira Sans", "Noto Sans TC", "Inconsolata", "Barlow", "Manrope", "IBM Plex Sans", "PT Serif", "Karla", "Titillium Web", "Heebo", "Noto Serif", "Nanum Gothic", "Noto Color Emoji", "Agdasima", "Bebas Neue", "Libre Franklin", "Mukta", "Outfit", "Josefin Sans", "Source Code Pro", "Jost", "Space Grotesk", "Hind Siliguri", "Arimo", "Cabin", "Barlow Condensed", "Dosis", "Fira Sans Condensed", "Bitter", "Archivo", "Figtree", "Noto Serif JP", "PT Sans Narrow", "Abel", "Noto Sans SC",
|
6
|
+
// "Source Sans 3",
|
7
|
+
"Hind",
|
8
|
+
// "Exo 2",
|
9
|
+
"Teko", "Oxygen", "Cairo", "Crimson Text", "Plus Jakarta Sans", "Overpass", "Pacifico", "Prompt", "Red Hat Display", "Varela Round", "Cormorant Garamond", "Assistant", "Comfortaa", "Lexend", "Signika Negative",
|
10
|
+
// "M PLUS Rounded 1c",
|
11
|
+
"Fjalla One", "Caveat", "IBM Plex Mono", "Arvo", "Lobster", "Schibsted Grotesk", "Chakra Petch", "Maven Pro", "Sora", "Kalam", "Onest", "Space Grotesk", "Outfit", 'Titillium Web', ...defaultFonts];
|
@@ -1,9 +1,7 @@
|
|
1
|
-
import { useEffect
|
1
|
+
import { useEffect } from "react";
|
2
2
|
import WebFont from "webfontloader";
|
3
|
-
import { Backdrop, CircularProgress } from "@mui/material";
|
4
3
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
5
|
-
import { googleFontList } from "./FontList";
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
4
|
+
import { defaultFonts, googleFontList, otherFonts } from "./FontList";
|
7
5
|
const FontLoader = props => {
|
8
6
|
const {
|
9
7
|
otherProps,
|
@@ -12,20 +10,14 @@ const FontLoader = props => {
|
|
12
10
|
const {
|
13
11
|
setFontFamilies
|
14
12
|
} = useEditorContext();
|
15
|
-
const [loader, setLoader] = useState(true);
|
16
13
|
const loadFontsInBatches = (families, batchSize = 5, maxRetries = 3) => {
|
17
14
|
let currentIndex = 0;
|
18
15
|
let retryCount = 0;
|
19
|
-
let hideLoaderOn = 30;
|
20
16
|
function loadNextBatch() {
|
21
17
|
if (currentIndex >= families?.length) {
|
22
18
|
// console.log("All fonts have been loaded");
|
23
|
-
setLoader(false);
|
24
19
|
return;
|
25
20
|
}
|
26
|
-
if (currentIndex >= hideLoaderOn) {
|
27
|
-
setLoader(false);
|
28
|
-
}
|
29
21
|
const batch = families?.slice(currentIndex, currentIndex + batchSize);
|
30
22
|
const batchWithWeights = batch.map(font => `${font}:300,400,600,700`);
|
31
23
|
WebFont.load({
|
@@ -49,9 +41,9 @@ const FontLoader = props => {
|
|
49
41
|
// Retry loading the same batch
|
50
42
|
loadNextBatch();
|
51
43
|
} else {
|
52
|
-
|
53
|
-
|
54
|
-
|
44
|
+
console.log(
|
45
|
+
// `Max retries reached for batch: ${batch}. Moving to the next batch.`
|
46
|
+
);
|
55
47
|
currentIndex += batchSize;
|
56
48
|
retryCount = 0; // Reset retry count for the next batch
|
57
49
|
loadNextBatch();
|
@@ -62,21 +54,21 @@ const FontLoader = props => {
|
|
62
54
|
loadNextBatch();
|
63
55
|
};
|
64
56
|
useEffect(() => {
|
65
|
-
let families = [...
|
57
|
+
let families = [...otherFonts, ...defaultFonts];
|
66
58
|
if (!readOnly) {
|
67
59
|
otherProps?.services("listGoogleFont", []).then(data => {
|
68
|
-
families = [...(data?.data || [])];
|
60
|
+
families = [...families, ...(data?.data || [])];
|
61
|
+
const filteredfamilies = families?.filter(font => !font?.includes("Material"));
|
69
62
|
setFontFamilies({
|
70
63
|
id: 1,
|
71
64
|
format: "fontFamily",
|
72
65
|
type: "fontfamilydropdown",
|
73
|
-
options:
|
66
|
+
options: filteredfamilies || []
|
74
67
|
});
|
75
68
|
loadFontsInBatches(families);
|
76
69
|
}).catch(err => {
|
77
|
-
|
70
|
+
console.log(err);
|
78
71
|
});
|
79
|
-
// setLoading(true);
|
80
72
|
} else {
|
81
73
|
function correctFontArray(fontString) {
|
82
74
|
let fontsArray = fontString.split(",");
|
@@ -101,15 +93,6 @@ const FontLoader = props => {
|
|
101
93
|
loadFontsInBatches(families);
|
102
94
|
}
|
103
95
|
}, []);
|
104
|
-
return
|
105
|
-
open: loader,
|
106
|
-
sx: {
|
107
|
-
color: "#fff",
|
108
|
-
zIndex: theme => theme.zIndex.drawer + 1 // Ensure it's above other UI elements
|
109
|
-
},
|
110
|
-
children: /*#__PURE__*/_jsx(CircularProgress, {
|
111
|
-
color: "inherit"
|
112
|
-
})
|
113
|
-
});
|
96
|
+
return null;
|
114
97
|
};
|
115
98
|
export default FontLoader;
|
@@ -3,35 +3,24 @@ import PersonalVideoIcon from "@mui/icons-material/PersonalVideo";
|
|
3
3
|
import PhoneIphoneIcon from "@mui/icons-material/PhoneIphone";
|
4
4
|
import useSwitchViewport from "./styles";
|
5
5
|
import { useEffect } from "react";
|
6
|
-
import { useEditorContext } from "../../../hooks/useMouseMove";
|
7
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
8
|
const SwitchViewport = props => {
|
10
9
|
const {
|
11
10
|
breakpoint,
|
12
|
-
onChange
|
13
|
-
show
|
11
|
+
onChange
|
14
12
|
} = props;
|
15
13
|
const classes = useSwitchViewport();
|
16
|
-
const {
|
17
|
-
setSelectedElement,
|
18
|
-
setActiveBreakPoint
|
19
|
-
} = useEditorContext();
|
20
14
|
useEffect(() => {
|
21
|
-
|
22
|
-
setSelectedElement({});
|
15
|
+
console.log(breakpoint);
|
23
16
|
}, [breakpoint]);
|
24
17
|
return /*#__PURE__*/_jsxs(Box, {
|
25
18
|
sx: classes.root,
|
26
|
-
style: {
|
27
|
-
display: show ? "block" : "none"
|
28
|
-
},
|
29
19
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
30
20
|
title: "Desktop View",
|
31
21
|
children: /*#__PURE__*/_jsx(IconButton, {
|
32
22
|
className: `${!breakpoint || breakpoint === "lg" ? "active" : ""}`,
|
33
23
|
onClick: () => {
|
34
|
-
setActiveBreakPoint("");
|
35
24
|
onChange("");
|
36
25
|
},
|
37
26
|
children: /*#__PURE__*/_jsx(PersonalVideoIcon, {})
|
@@ -41,7 +30,6 @@ const SwitchViewport = props => {
|
|
41
30
|
children: /*#__PURE__*/_jsx(IconButton, {
|
42
31
|
className: `${breakpoint === "xs" ? "active" : ""}`,
|
43
32
|
onClick: () => {
|
44
|
-
setActiveBreakPoint("xs");
|
45
33
|
onChange("xs");
|
46
34
|
},
|
47
35
|
children: /*#__PURE__*/_jsx(PhoneIphoneIcon, {})
|
@@ -2,44 +2,18 @@ import React, { useRef, useState } from "react";
|
|
2
2
|
import { useTheme } from "@mui/material";
|
3
3
|
import { Transforms } from "slate";
|
4
4
|
import { ReactEditor, useSlateStatic } from "slate-react";
|
5
|
-
import { Box, IconButton, Tooltip } from "@mui/material";
|
5
|
+
import { Box, IconButton, Popper, Tooltip } from "@mui/material";
|
6
6
|
import SectionPopup from "../../Elements/Grid/SectionPopup";
|
7
7
|
import { getBreakPointsValue, getTRBLBreakPoints, groupByBreakpoint } from "../../helper/theme";
|
8
|
-
|
9
|
-
|
8
|
+
import DragHandle from "../DnD/DragHandleButton";
|
9
|
+
import { useEditorSelection } from "../../hooks/useMouseMove";
|
10
10
|
import SectionStyle from "./styles";
|
11
11
|
import useWindowResize from "../../hooks/useWindowResize";
|
12
12
|
import { SectionSettingIcon } from "../iconListV2";
|
13
|
-
|
14
|
-
// const list_types = ["orderedList", "unorderedList"];
|
15
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
16
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
17
|
-
|
18
|
-
|
19
|
-
showTool,
|
20
|
-
onSettings,
|
21
|
-
isSectionFullWidth
|
22
|
-
}) => {
|
23
|
-
return !readOnly && !showTool ? /*#__PURE__*/_jsx(Box, {
|
24
|
-
component: "div",
|
25
|
-
className: `element-toolbar no-border-button hr section-tw sectionIcon`,
|
26
|
-
contentEditable: false,
|
27
|
-
sx: {
|
28
|
-
left: isSectionFullWidth ? "0px" : "-28px",
|
29
|
-
top: isSectionFullWidth ? "-28px" : "1px",
|
30
|
-
"&:hover": {
|
31
|
-
backgroundColor: "rgba(0,0,0,0.5)"
|
32
|
-
}
|
33
|
-
},
|
34
|
-
children: /*#__PURE__*/_jsx(Tooltip, {
|
35
|
-
title: "Section Settings",
|
36
|
-
children: /*#__PURE__*/_jsx(IconButton, {
|
37
|
-
onClick: onSettings,
|
38
|
-
children: /*#__PURE__*/_jsx(SectionSettingIcon, {})
|
39
|
-
})
|
40
|
-
})
|
41
|
-
}) : null;
|
42
|
-
};
|
15
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
16
|
+
const list_types = ["orderedList", "unorderedList"];
|
43
17
|
const Section = props => {
|
44
18
|
const themeReact = useTheme();
|
45
19
|
const theme = props?.theme;
|
@@ -53,8 +27,7 @@ const Section = props => {
|
|
53
27
|
readOnly
|
54
28
|
} = customProps;
|
55
29
|
const editor = useSlateStatic();
|
56
|
-
|
57
|
-
const [size] = useWindowResize();
|
30
|
+
const [showTool] = useEditorSelection(editor);
|
58
31
|
const [openSetttings, setOpenSettings] = useState(false);
|
59
32
|
const {
|
60
33
|
sectionBgColor,
|
@@ -71,46 +44,45 @@ const Section = props => {
|
|
71
44
|
} = sectionAlignment || {};
|
72
45
|
const path = ReactEditor.findPath(editor, element);
|
73
46
|
const anchorEl = useRef(null);
|
74
|
-
|
75
|
-
|
47
|
+
const popperEl = useRef(null);
|
48
|
+
const [size] = useWindowResize();
|
76
49
|
const isSectionFullWidth = sectionGridSize && sectionGridSize[size?.device] >= 12;
|
77
|
-
const
|
78
|
-
const
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
};
|
85
|
-
}
|
86
|
-
const sectionBgImage = sectionBackgroundImage && sectionBackgroundImage !== "none" ? {
|
87
|
-
backgroundImage: `url(${sectionBackgroundImage})`
|
88
|
-
} : {};
|
89
|
-
const edSectionSp = groupByBreakpoint({
|
90
|
-
padding: {
|
91
|
-
...getTRBLBreakPoints(sectionBannerSpacing)
|
92
|
-
},
|
93
|
-
borderRadius: {
|
94
|
-
...getBreakPointsValue(sectionBorderRadius || {}, null, "overrideBorderRadius", true)
|
95
|
-
}
|
96
|
-
}, themeReact);
|
97
|
-
const edInnerSp = groupByBreakpoint({
|
98
|
-
width: {
|
99
|
-
...getBreakPointsValue(sectionGridSize || 8, null, "overrideGridSize", true)
|
100
|
-
}
|
101
|
-
}, themeReact);
|
102
|
-
|
103
|
-
// const onMouseEnter = () => {
|
104
|
-
// setIsHovering(true);
|
105
|
-
// };
|
106
|
-
|
107
|
-
// const onMouseLeave = () => {
|
108
|
-
// setIsHovering(false);
|
109
|
-
// };
|
110
|
-
|
50
|
+
const [isHovering, setIsHovering] = useState(false);
|
51
|
+
const onMouseEnter = () => {
|
52
|
+
setIsHovering(true);
|
53
|
+
};
|
54
|
+
const onMouseLeave = () => {
|
55
|
+
setIsHovering(false);
|
56
|
+
};
|
111
57
|
const onSettings = () => {
|
112
58
|
setOpenSettings(true);
|
113
59
|
};
|
60
|
+
const Toolbar = ({
|
61
|
+
fromPopper
|
62
|
+
}) => {
|
63
|
+
return !readOnly && !showTool ? /*#__PURE__*/_jsx(Box, {
|
64
|
+
component: "div",
|
65
|
+
className: `element-toolbar no-border-button hr section-tw sectionIcon`,
|
66
|
+
contentEditable: false,
|
67
|
+
style: fromPopper ? {
|
68
|
+
position: "unset",
|
69
|
+
marginLeft: "28px",
|
70
|
+
paddingTop: "4px",
|
71
|
+
marginRight: "10px",
|
72
|
+
height: "100%"
|
73
|
+
} : {
|
74
|
+
left: "-28px",
|
75
|
+
top: "1px"
|
76
|
+
},
|
77
|
+
children: /*#__PURE__*/_jsx(Tooltip, {
|
78
|
+
title: "Section Settings",
|
79
|
+
children: /*#__PURE__*/_jsx(IconButton, {
|
80
|
+
onClick: onSettings,
|
81
|
+
children: /*#__PURE__*/_jsx(SectionSettingIcon, {})
|
82
|
+
})
|
83
|
+
})
|
84
|
+
}) : null;
|
85
|
+
};
|
114
86
|
const onSave = data => {
|
115
87
|
const updateData = {
|
116
88
|
...data
|
@@ -131,6 +103,31 @@ const Section = props => {
|
|
131
103
|
at: path
|
132
104
|
});
|
133
105
|
};
|
106
|
+
const isFreeGrid = element?.children?.find(f => f.type === "freegrid");
|
107
|
+
const needHover = element?.children?.find(f => f.type === "grid" && !list_types.includes(element.type)) ? "" : "";
|
108
|
+
let tempProps = {};
|
109
|
+
if (element?.type === "temp") {
|
110
|
+
tempProps = {
|
111
|
+
"--left": `${element?.left}px`,
|
112
|
+
"--top": `${element?.top}px`
|
113
|
+
};
|
114
|
+
}
|
115
|
+
const sectionBgImage = sectionBackgroundImage && sectionBackgroundImage !== "none" ? {
|
116
|
+
backgroundImage: `url(${sectionBackgroundImage})`
|
117
|
+
} : {};
|
118
|
+
const edSectionSp = groupByBreakpoint({
|
119
|
+
padding: {
|
120
|
+
...getTRBLBreakPoints(sectionBannerSpacing)
|
121
|
+
},
|
122
|
+
borderRadius: {
|
123
|
+
...getBreakPointsValue(sectionBorderRadius || {}, null, "overrideBorderRadius", true)
|
124
|
+
}
|
125
|
+
}, themeReact);
|
126
|
+
const edInnerSp = groupByBreakpoint({
|
127
|
+
width: {
|
128
|
+
...getBreakPointsValue(sectionGridSize || 8, null, "overrideGridSize", true)
|
129
|
+
}
|
130
|
+
}, themeReact);
|
134
131
|
return path.length === 1 && !isFreeGrid ? /*#__PURE__*/_jsxs(Box, {
|
135
132
|
component: "div",
|
136
133
|
className: `ed-section-wrapper ${readOnly ? "" : "hselect"} ${needHover} is-${element?.type}`,
|
@@ -145,10 +142,9 @@ const Section = props => {
|
|
145
142
|
flexDirection: flexDirection || "column",
|
146
143
|
alignItems: horizantal,
|
147
144
|
justifyContent: vertical
|
148
|
-
}
|
149
|
-
|
150
|
-
|
151
|
-
,
|
145
|
+
},
|
146
|
+
onMouseEnter: onMouseEnter,
|
147
|
+
onMouseLeave: onMouseLeave,
|
152
148
|
children: [/*#__PURE__*/_jsxs(Box, {
|
153
149
|
className: "ed-section-inner",
|
154
150
|
sx: {
|
@@ -156,11 +152,34 @@ const Section = props => {
|
|
156
152
|
...edInnerSp
|
157
153
|
},
|
158
154
|
ref: anchorEl,
|
159
|
-
children: [/*#__PURE__*/_jsx(
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
155
|
+
children: [isHovering && isSectionFullWidth ? /*#__PURE__*/_jsx(Popper, {
|
156
|
+
open: isHovering && isSectionFullWidth,
|
157
|
+
anchorEl: anchorEl?.current,
|
158
|
+
placement: "top-start",
|
159
|
+
sx: {
|
160
|
+
zIndex: 9999
|
161
|
+
},
|
162
|
+
disablePortal: true,
|
163
|
+
ref: popperEl,
|
164
|
+
className: "sectionPopper",
|
165
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
166
|
+
sx: {
|
167
|
+
bgcolor: "background.paper",
|
168
|
+
height: "30px",
|
169
|
+
position: "relative",
|
170
|
+
background: theme?.palette?.type === 'dark' ? theme?.palette?.editor?.miniToolBarBackground : '#F6F6F6'
|
171
|
+
},
|
172
|
+
children: [!readOnly && !showTool ? /*#__PURE__*/_jsx(DragHandle, {
|
173
|
+
...props,
|
174
|
+
fromPopper: true
|
175
|
+
}) : null, /*#__PURE__*/_jsx(Toolbar, {
|
176
|
+
fromPopper: true
|
177
|
+
})]
|
178
|
+
})
|
179
|
+
}) : /*#__PURE__*/_jsxs(_Fragment, {
|
180
|
+
children: [!readOnly && !showTool ? /*#__PURE__*/_jsx(DragHandle, {
|
181
|
+
...props
|
182
|
+
}) : null, /*#__PURE__*/_jsx(Toolbar, {})]
|
164
183
|
}), children]
|
165
184
|
}), openSetttings ? /*#__PURE__*/_jsx(SectionPopup, {
|
166
185
|
element: {
|
@@ -73,11 +73,6 @@ const BackgroundImage = props => {
|
|
73
73
|
children: "REMOVE"
|
74
74
|
}) : /*#__PURE__*/_jsx(Grid, {
|
75
75
|
className: "uploadImageText",
|
76
|
-
sx: {
|
77
|
-
padding: 0,
|
78
|
-
background: `${theme?.palette?.editor?.inputFieldBgColor}`,
|
79
|
-
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
|
80
|
-
},
|
81
76
|
children: /*#__PURE__*/_jsxs(Button, {
|
82
77
|
component: "label",
|
83
78
|
variant: "text",
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { Box, Card, Checkbox, FormControlLabel, Grid, Tooltip, Typography } from "@mui/material";
|
2
2
|
import React from "react";
|
3
3
|
import Icon from "../../Icon";
|
4
|
-
import { useEditorContext } from "../../../hooks/useMouseMove";
|
5
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
5
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
7
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -16,10 +15,7 @@ const RenderCard = ({
|
|
16
15
|
return /*#__PURE__*/_jsx(Card, {
|
17
16
|
sx: {
|
18
17
|
position: 'relative',
|
19
|
-
padding: "10px"
|
20
|
-
'& .MuiCheckbox-root svg': {
|
21
|
-
fill: 'unset !important'
|
22
|
-
}
|
18
|
+
padding: "10px"
|
23
19
|
},
|
24
20
|
children: /*#__PURE__*/_jsx(FormControlLabel, {
|
25
21
|
control: /*#__PURE__*/_jsx(Checkbox, {
|
@@ -85,9 +81,6 @@ const CardsMapping = props => {
|
|
85
81
|
selectedCard,
|
86
82
|
infoIcon
|
87
83
|
} = data;
|
88
|
-
const {
|
89
|
-
theme
|
90
|
-
} = useEditorContext();
|
91
84
|
const activeCard = value === selectedCard;
|
92
85
|
const handleChange = e => {
|
93
86
|
if (selectedCard === data?.value) {
|
@@ -106,8 +99,7 @@ const CardsMapping = props => {
|
|
106
99
|
sx: {
|
107
100
|
marginBottom: "12px",
|
108
101
|
"& .MuiPaper-root": {
|
109
|
-
|
110
|
-
border: activeCard ? "1px solid #2563EB" : `1px solid ${theme?.palette?.editor?.inputFieldBorder}`,
|
102
|
+
border: activeCard ? "1px solid #2563EB" : "1px solid #C8D8FA",
|
111
103
|
borderRadius: "8px",
|
112
104
|
boxShadow: activeCard ? "0px 4px 16px 0px #2563EB40" : "unset"
|
113
105
|
}
|
@@ -18,7 +18,6 @@ import FontSize from "./fontSize";
|
|
18
18
|
import SelectSwitch from "./selectSwitch";
|
19
19
|
import CardsMapping from "./card";
|
20
20
|
import MetaDataMapping from "./metaDataMapping";
|
21
|
-
import LineSpacing from "./lineSpacing";
|
22
21
|
const FieldMap = {
|
23
22
|
text: Text,
|
24
23
|
bannerSpacing: BannerSpacing,
|
@@ -39,7 +38,6 @@ const FieldMap = {
|
|
39
38
|
fontSize: FontSize,
|
40
39
|
selectSwitch: SelectSwitch,
|
41
40
|
card: CardsMapping,
|
42
|
-
metadatamapping: MetaDataMapping
|
43
|
-
lineSpacing: LineSpacing
|
41
|
+
metadatamapping: MetaDataMapping
|
44
42
|
};
|
45
43
|
export default FieldMap;
|
@@ -4,7 +4,6 @@ import { convertBase64 } from "../utils/helper";
|
|
4
4
|
import { uploadFile } from "../service/fileupload";
|
5
5
|
import Icon from "./Icon";
|
6
6
|
import UploadStyles from "../common/ImageSelector/UploadStyles";
|
7
|
-
import { useEditorContext } from "../hooks/useMouseMove";
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
8
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
10
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -19,9 +18,6 @@ const Uploader = props => {
|
|
19
18
|
const [base64, setBase64] = useState(value?.url);
|
20
19
|
const [fileName, setFileName] = useState("");
|
21
20
|
const [uploading, setUploading] = useState(false);
|
22
|
-
const {
|
23
|
-
theme
|
24
|
-
} = useEditorContext();
|
25
21
|
const handleChange = async e => {
|
26
22
|
const uFile = e.target.files[0];
|
27
23
|
const strImage = await convertBase64(uFile);
|
@@ -103,10 +99,6 @@ const Uploader = props => {
|
|
103
99
|
className: "uploadImageSection",
|
104
100
|
children: base64 ? renderThumb() : /*#__PURE__*/_jsx(Grid, {
|
105
101
|
className: "uploadImageText",
|
106
|
-
sx: {
|
107
|
-
background: `${theme?.palette?.editor?.inputFieldBgColor}`,
|
108
|
-
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
|
109
|
-
},
|
110
102
|
children: /*#__PURE__*/_jsxs(Button, {
|
111
103
|
component: "label",
|
112
104
|
variant: "text",
|
@@ -1654,12 +1654,13 @@ export const CsvIcon = () => /*#__PURE__*/_jsxs("svg", {
|
|
1654
1654
|
fill: "white"
|
1655
1655
|
})]
|
1656
1656
|
});
|
1657
|
-
export const CloseIcon =
|
1657
|
+
export const CloseIcon = props => /*#__PURE__*/_jsxs("svg", {
|
1658
1658
|
width: "20",
|
1659
1659
|
height: "20",
|
1660
1660
|
viewBox: "0 0 20 20",
|
1661
1661
|
fill: "none",
|
1662
1662
|
xmlns: "http://www.w3.org/2000/svg",
|
1663
|
+
...(props || {}),
|
1663
1664
|
children: [/*#__PURE__*/_jsx("path", {
|
1664
1665
|
d: "M14.1245 5.875L5.87493 14.1246",
|
1665
1666
|
stroke: "#64748B",
|