@flozy/editor 4.6.1 → 4.6.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/CommonEditor.js +17 -17
- package/dist/Editor/Editor.css +1 -32
- package/dist/Editor/Elements/AI/AIInput.js +5 -4
- package/dist/Editor/Elements/AI/PopoverAIInput.js +29 -40
- package/dist/Editor/Elements/AI/Styles.js +1 -1
- package/dist/Editor/Elements/Button/EditorButton.js +4 -8
- package/dist/Editor/Elements/Divider/Divider.js +8 -107
- package/dist/Editor/Elements/Embed/Embed.css +1 -1
- package/dist/Editor/Elements/Embed/Image.js +3 -4
- package/dist/Editor/Elements/Embed/Video.js +7 -9
- package/dist/Editor/Elements/Emoji/EmojiButton.js +23 -1
- package/dist/Editor/Elements/Form/Form.js +1 -0
- package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +12 -3
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +3 -56
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +0 -2
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +3 -7
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +2 -16
- package/dist/Editor/Elements/FreeGrid/Options/sectionItemOptions.js +2 -8
- package/dist/Editor/Elements/FreeGrid/styles.js +1 -82
- package/dist/Editor/Elements/Signature/SignaturePopup.js +7 -24
- package/dist/Editor/Elements/Signature/Signed.js +1 -1
- package/dist/Editor/Elements/SimpleText/index.js +8 -7
- package/dist/Editor/Elements/Table/TableRow.js +1 -1
- package/dist/Editor/Styles/EditorStyles.js +2 -2
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +29 -35
- package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +30 -35
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +4 -4
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +38 -22
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +1 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +5 -5
- package/dist/Editor/common/FontLoader/FontLoader.js +6 -6
- package/dist/Editor/common/Icon.js +1 -1
- package/dist/Editor/common/LinkSettings/index.js +3 -3
- package/dist/Editor/common/LinkSettings/navOptions.js +1 -4
- package/dist/Editor/common/RnD/DragOver/index.js +1 -0
- package/dist/Editor/common/RnD/ElementOptions/Actions.js +2 -15
- package/dist/Editor/common/RnD/ElementOptions/styles.js +0 -5
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +1 -1
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/index.js +2 -32
- package/dist/Editor/common/RnD/ElementSettings/Settings/index.js +1 -3
- package/dist/Editor/common/RnD/ElementSettings/settingsConstants.js +2 -5
- package/dist/Editor/common/RnD/RnDCopy.js +0 -2
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +3 -5
- package/dist/Editor/common/RnD/VirtualElement/index.js +1 -1
- package/dist/Editor/common/RnD/index.js +37 -67
- package/dist/Editor/common/Section/index.js +1 -11
- package/dist/Editor/common/Section/styles.js +0 -16
- package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +0 -19
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +4 -19
- package/dist/Editor/common/SwipeableDrawer/index.js +15 -4
- package/dist/Editor/common/SwipeableDrawer/style.js +11 -3
- package/dist/Editor/common/iconslist.js +0 -23
- package/dist/Editor/helper/index.js +2 -5
- package/dist/Editor/helper/theme.js +2 -2
- package/dist/Editor/hooks/useBreakpoints.js +1 -1
- package/dist/Editor/hooks/useMouseMove.js +4 -5
- package/dist/Editor/hooks/withCommon.js +0 -1
- package/dist/Editor/utils/Decorators/index.js +2 -3
- package/dist/Editor/utils/RnD/RnDCtrlCmds.js +1 -16
- package/dist/Editor/utils/SlateUtilityFunctions.js +5 -33
- package/dist/Editor/utils/customHooks/useResize.js +5 -4
- package/dist/Editor/utils/events.js +0 -71
- package/dist/Editor/utils/helper.js +0 -16
- package/package.json +1 -1
- package/dist/Editor/Elements/Divider/DividerPopup.js +0 -24
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Signature.js +0 -53
- package/dist/Editor/common/RnD/ElementSettings/Settings/DividerSettings.js +0 -49
- package/dist/Editor/common/StyleBuilder/dividerStyles.js +0 -56
- package/dist/Editor/helper/RnD/focusNode.js +0 -74
- package/dist/Editor/hooks/useDragging.js +0 -51
- package/dist/Editor/hooks/withRestrictedNodes.js +0 -48
- package/dist/Editor/utils/Decorators/highlightSelection.js +0 -16
@@ -13,7 +13,7 @@ import PopperHeader from "../PopperHeader";
|
|
13
13
|
import MiniColorPicker from "./MiniColorPicker";
|
14
14
|
import SelectAlignment from "./SelectAlignment";
|
15
15
|
import SelectFontSize from "./SelectFontSize";
|
16
|
-
import InfinityAITool from "./InfinityAITool";
|
16
|
+
// import InfinityAITool from "./InfinityAITool";
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
18
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
19
19
|
const DEFAULT_COLOR = {
|
@@ -27,8 +27,8 @@ const MiniTextFormat = props => {
|
|
27
27
|
const {
|
28
28
|
classes,
|
29
29
|
editor,
|
30
|
-
closeMainPopup
|
31
|
-
customProps
|
30
|
+
closeMainPopup
|
31
|
+
// customProps
|
32
32
|
} = props;
|
33
33
|
const [anchorEl, setAnchorEl] = useState(null);
|
34
34
|
const open = Boolean(anchorEl);
|
@@ -50,7 +50,7 @@ const MiniTextFormat = props => {
|
|
50
50
|
xs: 12,
|
51
51
|
children: /*#__PURE__*/_jsxs("div", {
|
52
52
|
className: "toolWrapper",
|
53
|
-
children: [
|
53
|
+
children: [/*#__PURE__*/_jsx(SelectTypography, {
|
54
54
|
classes: classes,
|
55
55
|
editor: editor,
|
56
56
|
closeMainPopup: closeMainPopup
|
@@ -3,10 +3,9 @@ const usePopupStyle = theme => ({
|
|
3
3
|
boxShadow: "1px 2px 15px 0px #2563EB40",
|
4
4
|
zIndex: 1300,
|
5
5
|
marginBottom: "12px !important",
|
6
|
-
borderRadius: "6px",
|
7
6
|
border: "1px solid #D8DDE1",
|
7
|
+
borderRadius: "6px",
|
8
8
|
maxWidth: "100%",
|
9
|
-
// maxHeight: "40px",
|
10
9
|
"&.fullscreen": {
|
11
10
|
marginBottom: "0px !important",
|
12
11
|
"& .papper-wrpr": {
|
@@ -482,9 +481,10 @@ const usePopupStyle = theme => ({
|
|
482
481
|
}
|
483
482
|
},
|
484
483
|
fullViewCardMedia: {
|
484
|
+
margin: "5px 0px",
|
485
485
|
width: "100%",
|
486
486
|
backgroundPosition: "left top",
|
487
|
-
backgroundSize: "100
|
487
|
+
backgroundSize: "100%, auto",
|
488
488
|
zIndex: 1,
|
489
489
|
position: "relative",
|
490
490
|
"&.fullscreen": {
|
@@ -499,9 +499,10 @@ const usePopupStyle = theme => ({
|
|
499
499
|
}
|
500
500
|
},
|
501
501
|
buttonCardMedia: {
|
502
|
+
margin: "5px 0px",
|
502
503
|
width: "100%",
|
503
|
-
height: "
|
504
|
-
backgroundPosition: "
|
504
|
+
height: "40px",
|
505
|
+
backgroundPosition: "center",
|
505
506
|
backgroundSize: "contain",
|
506
507
|
zIndex: 1,
|
507
508
|
position: "relative",
|
@@ -510,26 +511,25 @@ const usePopupStyle = theme => ({
|
|
510
511
|
}
|
511
512
|
},
|
512
513
|
buttonCardMediaWrpr: {
|
514
|
+
padding: "5px",
|
513
515
|
position: "relative",
|
514
516
|
margin: "8px",
|
515
|
-
|
516
|
-
"
|
517
|
-
"
|
518
|
-
|
517
|
+
height: "50px",
|
518
|
+
"& .img-wrapper": {
|
519
|
+
"&:hover": {
|
520
|
+
padding: "0px 2px 0px 2px",
|
521
|
+
backgroundColor: "#E9F3FE",
|
522
|
+
border: "1px solid #2563EB40",
|
523
|
+
borderRadius: "5px",
|
524
|
+
// height: "100%",
|
525
|
+
margin: "0px"
|
526
|
+
// "& .template-card-action": {
|
527
|
+
// display: "flex",
|
528
|
+
// },
|
519
529
|
}
|
520
|
-
},
|
521
|
-
"& .img-loader-wrapper": {
|
522
|
-
position: "absolute",
|
523
|
-
width: "12px",
|
524
|
-
height: "12px",
|
525
|
-
left: 0,
|
526
|
-
right: 0,
|
527
|
-
top: 0,
|
528
|
-
bottom: 0,
|
529
|
-
margin: "auto",
|
530
|
-
zIndex: 0
|
531
530
|
}
|
532
531
|
},
|
532
|
+
|
533
533
|
paperOverrides: {
|
534
534
|
"&.MuiPaper-root": {
|
535
535
|
background: "transparent",
|
@@ -587,12 +587,13 @@ const usePopupStyle = theme => ({
|
|
587
587
|
},
|
588
588
|
customSelectPopoverWrapper: {
|
589
589
|
"& .MuiPopover-paper": {
|
590
|
-
maxHeight: "140px",
|
591
590
|
// minWidth: "130px",
|
592
591
|
border: "1px solid #E4E8EB",
|
592
|
+
maxHeight: "140px",
|
593
593
|
background: `${theme?.palette?.editor?.background} !important`,
|
594
|
-
overflowY: "
|
594
|
+
// overflowY: "hidden",
|
595
595
|
padding: "6px 12px 6px 0px",
|
596
|
+
overflowY: "scroll",
|
596
597
|
"@media only screen and (max-width: 600px)": {
|
597
598
|
marginTop: "-40px"
|
598
599
|
}
|
@@ -642,6 +643,21 @@ const usePopupStyle = theme => ({
|
|
642
643
|
"& fieldset": {
|
643
644
|
border: "none !important"
|
644
645
|
}
|
646
|
+
},
|
647
|
+
fullViewCardMediaWrpr: {
|
648
|
+
padding: "5px",
|
649
|
+
position: "relative",
|
650
|
+
margin: "8px",
|
651
|
+
height: "140px",
|
652
|
+
"& .img-wrapper": {
|
653
|
+
"&:hover": {
|
654
|
+
padding: "0px 2px 0px 2px",
|
655
|
+
backgroundColor: "#E9F3FE",
|
656
|
+
border: "1px solid #2563EB40",
|
657
|
+
borderRadius: "5px",
|
658
|
+
margin: "0px"
|
659
|
+
}
|
660
|
+
}
|
645
661
|
}
|
646
662
|
});
|
647
663
|
export default usePopupStyle;
|
@@ -80,16 +80,16 @@ const PopupTool = props => {
|
|
80
80
|
updateAnchorEl();
|
81
81
|
}
|
82
82
|
}, [selection]);
|
83
|
-
useEffect(() => {
|
84
|
-
if (selectedElement?.enable === 1) {
|
85
|
-
setAnchorEl(null);
|
86
|
-
}
|
87
|
-
}, [selection, selectedElement?.path, selectedElement?.enable]);
|
88
83
|
const handleClose = () => {
|
89
84
|
setAnchorEl(null);
|
90
85
|
setOpen(false);
|
91
86
|
setPopupType("");
|
92
87
|
};
|
88
|
+
useEffect(() => {
|
89
|
+
if (selectedElement?.enable === 1) {
|
90
|
+
setAnchorEl(null);
|
91
|
+
}
|
92
|
+
}, [selection, selectedElement?.path, selectedElement?.enable]);
|
93
93
|
return open && !openAI ? /*#__PURE__*/_jsx(ClickAwayListener, {
|
94
94
|
onClickAway: e => {
|
95
95
|
// close the mini toolbar, if user clicks outside the editor (in Flozy app.)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { useEffect } from "react";
|
2
2
|
import WebFont from "webfontloader";
|
3
3
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
4
|
-
const defaultFonts = [
|
4
|
+
const defaultFonts = ['PoppinsRegular', 'PoppinsBold', 'Helvetica', 'Georgia', 'Times New Roman', 'Monaco', 'Courier New', 'Qwitcher Grypen', 'EB Garamond', 'Anton', 'DM Serif Text', 'Libre Baskerville', 'Montserrat', 'Open Sans', 'Public Sans', 'Raleway', 'Space Mono', 'Bulgarian Garamond', 'Impact', 'Redacted Script', 'Great Vibes', 'Zeyada', 'Allura', 'Pinyon Script', 'Herr Von Muellerhoff', 'Dawning of a New Day', 'Coming Soon', 'Dancing Script', 'Engagement', 'Gaegu', 'Ingrid Darling', 'Kite One', 'La Belle Aurore', 'Mea Culpa', 'Meddon', 'Merriweather', 'The Girl Next Door'];
|
5
5
|
const FontLoader = props => {
|
6
6
|
const {
|
7
7
|
otherProps,
|
@@ -15,7 +15,7 @@ const FontLoader = props => {
|
|
15
15
|
let retryCount = 0;
|
16
16
|
function loadNextBatch() {
|
17
17
|
if (currentIndex >= families?.length) {
|
18
|
-
console.log(
|
18
|
+
console.log('All fonts have been loaded');
|
19
19
|
return;
|
20
20
|
}
|
21
21
|
const batch = families?.slice(currentIndex, currentIndex + batchSize);
|
@@ -68,13 +68,13 @@ const FontLoader = props => {
|
|
68
68
|
});
|
69
69
|
} else {
|
70
70
|
function correctFontArray(fontString) {
|
71
|
-
let fontsArray = fontString.split(
|
71
|
+
let fontsArray = fontString.split(',');
|
72
72
|
let cleanedFontsArray = [...new Set(fontsArray.map(font => font.trim()))];
|
73
73
|
return cleanedFontsArray;
|
74
74
|
}
|
75
75
|
function sanitizeFontFamily(fontFamily) {
|
76
76
|
const correctedFonts = correctFontArray(fontFamily);
|
77
|
-
return correctedFonts.join(
|
77
|
+
return correctedFonts.join(', ');
|
78
78
|
}
|
79
79
|
const elements = Array.from(document?.querySelectorAll("*"));
|
80
80
|
const fontSet = new Set();
|
@@ -83,8 +83,8 @@ const FontLoader = props => {
|
|
83
83
|
fontSet.add(sanitizeFontFamily(computedStyles?.fontFamily));
|
84
84
|
});
|
85
85
|
let families = Array.from(fontSet);
|
86
|
-
families = correctFontArray(families.join(
|
87
|
-
families = families.map(font => font.replace(/\"/g,
|
86
|
+
families = correctFontArray(families.join(', '));
|
87
|
+
families = families.map(font => font.replace(/\"/g, ''));
|
88
88
|
loadFontsInBatches(families);
|
89
89
|
}
|
90
90
|
}, []);
|
@@ -224,6 +224,7 @@ const iconList = {
|
|
224
224
|
fill: "#64748B"
|
225
225
|
}
|
226
226
|
}),
|
227
|
+
calenderNewIcon: /*#__PURE__*/_jsx(CalendlyIcon, {}),
|
227
228
|
freegrid: /*#__PURE__*/_jsx(CiGrid32, {
|
228
229
|
size: 20,
|
229
230
|
style: {
|
@@ -233,7 +234,6 @@ const iconList = {
|
|
233
234
|
text: /*#__PURE__*/_jsx(Text, {
|
234
235
|
stroke: "#64748B"
|
235
236
|
}),
|
236
|
-
calenderNewIcon: /*#__PURE__*/_jsx(CalendlyIcon, {}),
|
237
237
|
textArea: /*#__PURE__*/_jsx(TextAreaIcon, {}),
|
238
238
|
phone: /*#__PURE__*/_jsx(Phone, {}),
|
239
239
|
briefCase: /*#__PURE__*/_jsx(BriefCase, {}),
|
@@ -41,10 +41,9 @@ export default function LinkSettings(props) {
|
|
41
41
|
navType
|
42
42
|
} = props;
|
43
43
|
const {
|
44
|
-
isMobile
|
45
|
-
tagName
|
44
|
+
isMobile
|
46
45
|
} = customProps;
|
47
|
-
const navOptions = getNavOptions(customProps.hideTools
|
46
|
+
const navOptions = getNavOptions(customProps.hideTools);
|
48
47
|
const classes = LinkSettingsStyles(theme);
|
49
48
|
const [nav, setNav] = useState(getNav(navType, navOptions));
|
50
49
|
const [navValue, setNavValue] = useState(props?.navValue || "");
|
@@ -62,6 +61,7 @@ export default function LinkSettings(props) {
|
|
62
61
|
};
|
63
62
|
if (isMobile) {
|
64
63
|
return /*#__PURE__*/_jsxs(SwipeableDrawer, {
|
64
|
+
open: true,
|
65
65
|
onClose: handleClose,
|
66
66
|
children: [/*#__PURE__*/_jsx(Typography, {
|
67
67
|
variant: "subtitle1",
|
@@ -1,4 +1,4 @@
|
|
1
|
-
export const getNavOptions = (hideTools = []
|
1
|
+
export const getNavOptions = (hideTools = []) => {
|
2
2
|
let navOptions = [{
|
3
3
|
label: "None",
|
4
4
|
value: ""
|
@@ -33,8 +33,5 @@ export const getNavOptions = (hideTools = [], tagName = "") => {
|
|
33
33
|
placeholder: "phone"
|
34
34
|
}];
|
35
35
|
navOptions = navOptions.filter(n => !hideTools.includes(n.value));
|
36
|
-
if (tagName !== "Pages") {
|
37
|
-
navOptions = navOptions.filter(n => n.value !== "page");
|
38
|
-
}
|
39
36
|
return navOptions;
|
40
37
|
};
|
@@ -17,6 +17,7 @@ const DragOver = props => {
|
|
17
17
|
const open = Boolean(anchorEl);
|
18
18
|
const isSectionHover = status && type === "parent";
|
19
19
|
const isContainerHover = hover_on === path && type === "parent-container";
|
20
|
+
console.log(isSectionHover, isContainerHover);
|
20
21
|
useEffect(() => {
|
21
22
|
if (ref?.current) {
|
22
23
|
const getBoundingClientRect = () => ref?.current?.getBoundingClientRect();
|
@@ -12,8 +12,7 @@ import SaveIcon from "@mui/icons-material/Save";
|
|
12
12
|
import LinkIcon from "./Icons/LinkIcon";
|
13
13
|
import CodeIcon from "@mui/icons-material/Code";
|
14
14
|
import FilterFramesIcon from "@mui/icons-material/FilterFrames";
|
15
|
-
import { GridAddSectionIcon,
|
16
|
-
import Delete from "@mui/icons-material/Delete";
|
15
|
+
import { GridAddSectionIcon, WorkflowIcon } from "../../iconslist";
|
17
16
|
const Actions = {
|
18
17
|
ai: {
|
19
18
|
type: "ai",
|
@@ -27,7 +26,7 @@ const Actions = {
|
|
27
26
|
Icon: null,
|
28
27
|
title: "Add Section"
|
29
28
|
},
|
30
|
-
|
29
|
+
addElement: {
|
31
30
|
type: "addElement",
|
32
31
|
Button: IconButton,
|
33
32
|
Icon: AddIcon,
|
@@ -46,18 +45,6 @@ const Actions = {
|
|
46
45
|
Icon: LinkIcon,
|
47
46
|
title: "Link"
|
48
47
|
},
|
49
|
-
signatureSettings: {
|
50
|
-
type: "signatureSettings",
|
51
|
-
Button: IconButton,
|
52
|
-
Icon: SignatureIcon,
|
53
|
-
title: "Signature"
|
54
|
-
},
|
55
|
-
removeSign: {
|
56
|
-
type: "removeSign",
|
57
|
-
Button: IconButton,
|
58
|
-
Icon: Delete,
|
59
|
-
title: "Remove Sign"
|
60
|
-
},
|
61
48
|
more: {
|
62
49
|
type: "more",
|
63
50
|
Button: IconButton,
|
@@ -1,39 +1,9 @@
|
|
1
1
|
import Settings from "./Settings";
|
2
2
|
import Link from "./Link";
|
3
3
|
import SavePopup from "./SaveAsTemplate";
|
4
|
-
import Signature from "./Signature";
|
5
|
-
import { Path, Transforms } from "slate";
|
6
4
|
const OtherSettings = {
|
7
5
|
link: Link,
|
8
6
|
settings: Settings,
|
9
|
-
saveAsTemplate: SavePopup
|
10
|
-
signatureSettings: Signature
|
7
|
+
saveAsTemplate: SavePopup
|
11
8
|
};
|
12
|
-
export default OtherSettings;
|
13
|
-
export const removeSign = (editor, path = []) => {
|
14
|
-
const pPath = path?.split("|")?.map(m => parseInt(m));
|
15
|
-
const element_path = [...pPath, 0];
|
16
|
-
Transforms.removeNodes(editor, {
|
17
|
-
at: element_path
|
18
|
-
}); // remove signature
|
19
|
-
|
20
|
-
Transforms.insertNodes(editor, [{
|
21
|
-
type: "signature",
|
22
|
-
children: [{
|
23
|
-
text: ""
|
24
|
-
}],
|
25
|
-
data: {
|
26
|
-
name: "",
|
27
|
-
email: "",
|
28
|
-
date: ""
|
29
|
-
}
|
30
|
-
}], {
|
31
|
-
at: element_path
|
32
|
-
});
|
33
|
-
const parentPath = Path.parent(element_path);
|
34
|
-
Transforms.setNodes(editor, {
|
35
|
-
childType: "signature"
|
36
|
-
}, {
|
37
|
-
at: parentPath
|
38
|
-
});
|
39
|
-
};
|
9
|
+
export default OtherSettings;
|
@@ -7,7 +7,6 @@ import AppHeaderSettings from "./AppHeaderSettings";
|
|
7
7
|
import FormSettings from "./FormSettings";
|
8
8
|
import TableSettings from "./TableSettings";
|
9
9
|
import CodeSettings from "./CodeSettings";
|
10
|
-
import DividerSettings from "./DividerSettings";
|
11
10
|
const SettingsComponents = {
|
12
11
|
text: TextSettings,
|
13
12
|
button: ButtonSettings,
|
@@ -17,7 +16,6 @@ const SettingsComponents = {
|
|
17
16
|
appHeader: AppHeaderSettings,
|
18
17
|
form: FormSettings,
|
19
18
|
table: TableSettings,
|
20
|
-
embedScript: CodeSettings
|
21
|
-
divider: DividerSettings
|
19
|
+
embedScript: CodeSettings
|
22
20
|
};
|
23
21
|
export default SettingsComponents;
|
@@ -7,8 +7,7 @@ export const settingsLabel = {
|
|
7
7
|
appHeader: "App Header Settings",
|
8
8
|
form: "Form Settings",
|
9
9
|
table: "Table Settings",
|
10
|
-
embedScript: "Code Settings"
|
11
|
-
divider: 'Divider Settings'
|
10
|
+
embedScript: "Code Settings"
|
12
11
|
};
|
13
12
|
export const ItemTypes = {
|
14
13
|
text: "Text",
|
@@ -19,7 +18,5 @@ export const ItemTypes = {
|
|
19
18
|
appHeader: "App Header",
|
20
19
|
form: "Form",
|
21
20
|
table: "Table",
|
22
|
-
embedScript: "Code"
|
23
|
-
signature: "Signature",
|
24
|
-
divider: 'Divider'
|
21
|
+
embedScript: "Code"
|
25
22
|
};
|
@@ -12,8 +12,6 @@ const RnDCopy = props => {
|
|
12
12
|
useEffect(() => {
|
13
13
|
if (selectedElement?.path) {
|
14
14
|
window.selectedRnDElement = selectedElement;
|
15
|
-
} else {
|
16
|
-
window.selectedRnDElement = {};
|
17
15
|
}
|
18
16
|
}, [selectedElement?.path, selectedElement?.enable]);
|
19
17
|
return !readOnly ? /*#__PURE__*/_jsx(Box, {
|
@@ -123,8 +123,8 @@ export function onDropItem(props, parentClass) {
|
|
123
123
|
dragOver,
|
124
124
|
parentPath,
|
125
125
|
path,
|
126
|
-
|
127
|
-
|
126
|
+
diffX,
|
127
|
+
x: cx,
|
128
128
|
breakpoint
|
129
129
|
// calX,
|
130
130
|
} = props;
|
@@ -134,9 +134,7 @@ export function onDropItem(props, parentClass) {
|
|
134
134
|
let newPath = [];
|
135
135
|
newPath = moveTo;
|
136
136
|
const cCalx = isContainerElement(editor, moveTo, props);
|
137
|
-
|
138
|
-
// cx - window.innerWidth / 2 + MARGIN_OF[breakpoint] - diffX
|
139
|
-
// );
|
137
|
+
const posX = parseInt(cx - window.innerWidth / 2 + MARGIN_OF[breakpoint] - diffX);
|
140
138
|
const toSectionNode = Node.get(editor, newPath);
|
141
139
|
const addToSectionDOM = ReactEditor.toDOMNode(editor, toSectionNode);
|
142
140
|
const rect = addToSectionDOM.getBoundingClientRect();
|