@flozy/editor 11.1.5 → 11.1.9
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.
@@ -27,7 +27,7 @@ import DragAndDrop from "./common/DnD";
|
|
27
27
|
import Section from "./common/Section";
|
28
28
|
import decorators from "./utils/Decorators";
|
29
29
|
import { getTRBLBreakPoints, getVariableValue, getBreakpointLineSpacing } from "./helper/theme";
|
30
|
-
import { getInitialValue, handleCopy, handleInsertLastElement, isEverythingSelected, isFreeGrid, isFreeGridFragment, isRestrictedNode, outsideEditorClickLabel } from "./utils/helper";
|
30
|
+
import { getInitialValue, handleCopy, handleInsertLastElement, isEverythingSelected, isFreeGrid, isFreeGridFragment, isRestrictedNode, outsideEditorClickLabel, GetPageBgImage } from "./utils/helper";
|
31
31
|
import useWindowResize from "./hooks/useWindowResize";
|
32
32
|
import { getTheme } from "./theme";
|
33
33
|
import ThemeSettings from "./themeSettings";
|
@@ -538,8 +538,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
538
538
|
};
|
539
539
|
const editorWrapperStyle = useMemo(() => {
|
540
540
|
const style = {};
|
541
|
-
|
542
|
-
|
541
|
+
const bgImageUrl = GetPageBgImage(pageBgImage);
|
542
|
+
if (bgImageUrl) {
|
543
|
+
style.backgroundImage = `url(${bgImageUrl})`;
|
543
544
|
style.backgroundSize = `cover`;
|
544
545
|
style.backgroundRepeat = "repeat";
|
545
546
|
} else {
|
@@ -52,6 +52,12 @@ const EmbedScriptPopup = props => {
|
|
52
52
|
const handleChange = e => {
|
53
53
|
setCode(e.target.value);
|
54
54
|
};
|
55
|
+
const handleMouseDown = e => {
|
56
|
+
e.stopPropagation();
|
57
|
+
};
|
58
|
+
const handleMouseUp = e => {
|
59
|
+
e.stopPropagation();
|
60
|
+
};
|
55
61
|
const onSubmit = async () => {
|
56
62
|
updateApiStatus({
|
57
63
|
loading: true
|
@@ -135,12 +141,9 @@ const EmbedScriptPopup = props => {
|
|
135
141
|
children: [/*#__PURE__*/_jsx("textarea", {
|
136
142
|
value: code,
|
137
143
|
onChange: handleChange,
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
resize: "none",
|
142
|
-
padding: "4px"
|
143
|
-
}
|
144
|
+
onMouseDown: handleMouseDown,
|
145
|
+
onMouseUp: handleMouseUp,
|
146
|
+
className: "embed-textarea"
|
144
147
|
}), /*#__PURE__*/_jsx(Box, {
|
145
148
|
component: "div",
|
146
149
|
color: "red",
|
@@ -6,13 +6,29 @@ const Styles = theme => ({
|
|
6
6
|
border: `1px solid ${theme?.palette?.editor?.miniToolBarBorder}`,
|
7
7
|
overflow: "hidden"
|
8
8
|
},
|
9
|
-
"& textarea": {
|
9
|
+
"& .embed-textarea": {
|
10
10
|
backgroundColor: theme?.palette?.editor?.inputFieldBgColor,
|
11
11
|
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`,
|
12
12
|
borderRadius: "12px",
|
13
13
|
padding: "10px !important",
|
14
14
|
color: theme?.palette?.editor?.textColor,
|
15
15
|
boxShadow: "0px 4px 18px 0px #00000014",
|
16
|
+
minHeight: "260px",
|
17
|
+
width: "100%",
|
18
|
+
resize: "none",
|
19
|
+
userSelect: "text !important",
|
20
|
+
WebkitUserSelect: "text !important",
|
21
|
+
MozUserSelect: "text !important",
|
22
|
+
msUserSelect: "text !important",
|
23
|
+
pointerEvents: "auto !important",
|
24
|
+
"&::selection": {
|
25
|
+
background: "rgba(37, 99, 235, 0.2) !important",
|
26
|
+
color: "inherit !important"
|
27
|
+
},
|
28
|
+
"&::-moz-selection": {
|
29
|
+
background: "rgba(37, 99, 235, 0.2) !important",
|
30
|
+
color: "inherit !important"
|
31
|
+
},
|
16
32
|
"&:focus": {
|
17
33
|
border: `1px solid #2563EB`,
|
18
34
|
boxShadow: "0px 4px 18px 0px #2563EB1F",
|
@@ -9,7 +9,7 @@ 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 {
|
12
|
+
import { viewSlateSelection } from "../../utils/helper";
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
14
14
|
const isSlateDOM = event => {
|
15
15
|
return event.target.getAttribute("data-slate-string") === "true";
|
@@ -95,7 +95,6 @@ const PopupTool = props => {
|
|
95
95
|
const isFreeGridEnabled = enable === 1 && isFreeGridElement;
|
96
96
|
if (!selection || Range.isCollapsed(selection) || Editor.string(editor, selection) === "" || isFreeGridEnabled) {
|
97
97
|
setAnchorEl(null);
|
98
|
-
hideSlateSelection(); // removes slate selection background, when there is no selection
|
99
98
|
} else {
|
100
99
|
updateAnchorEl();
|
101
100
|
viewSlateSelection();
|
@@ -1071,4 +1071,14 @@ export const GetsectionBgImage = sectionBackgroundImage => {
|
|
1071
1071
|
} else {
|
1072
1072
|
return {};
|
1073
1073
|
}
|
1074
|
+
};
|
1075
|
+
export const GetPageBgImage = pageBgImage => {
|
1076
|
+
if (pageBgImage && pageBgImage !== "none") {
|
1077
|
+
if (typeof pageBgImage === "object") {
|
1078
|
+
return pageBgImage.embedURL;
|
1079
|
+
} else if (typeof pageBgImage === "string") {
|
1080
|
+
return pageBgImage;
|
1081
|
+
}
|
1082
|
+
}
|
1083
|
+
return null;
|
1074
1084
|
};
|