@flozy/editor 11.1.7 → 11.2.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 +4 -3
- package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +9 -6
- package/dist/Editor/Elements/EmbedScript/styles.js +17 -1
- package/dist/Editor/Elements/Form/Workflow/Styles.js +1 -0
- package/dist/Editor/Styles/EditorStyles.js +1 -1
- package/dist/Editor/common/Shorthands/elements.js +1 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +3 -1
- package/dist/Editor/utils/SlateUtilityFunctions.js +2 -2
- package/dist/Editor/utils/helper.js +10 -0
- package/package.json +1 -1
@@ -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",
|
@@ -15,7 +15,7 @@ const editorStyles = ({
|
|
15
15
|
boxSizing: "border-box"
|
16
16
|
},
|
17
17
|
"& .blockQuoteComp": {
|
18
|
-
backgroundColor:
|
18
|
+
backgroundColor: theme?.palette?.editor?.colorBoxBg
|
19
19
|
},
|
20
20
|
"&.iframe-editor": {
|
21
21
|
"& .mini-tool-wrpr-ei": {
|
@@ -128,9 +128,7 @@ const ELEMENTS_LIST = [{
|
|
128
128
|
icon: /*#__PURE__*/_jsx(Icon, {
|
129
129
|
icon: "colorbox"
|
130
130
|
}),
|
131
|
-
onInsert: editor => toggleBlock(editor, "blockquote", false
|
132
|
-
bgColor: "rgb(227, 236, 255)"
|
133
|
-
})
|
131
|
+
onInsert: editor => toggleBlock(editor, "blockquote", false)
|
134
132
|
}, {
|
135
133
|
name: "Ordered List",
|
136
134
|
desc: "",
|
@@ -4,6 +4,7 @@ import ImageSelector from "../../ImageSelector/ImageSelector";
|
|
4
4
|
import UploadStyles from "../../ImageSelector/UploadStyles";
|
5
5
|
import Icon from "../../Icon";
|
6
6
|
import { useEditorContext } from "../../../hooks/useMouseMove";
|
7
|
+
import { GetPageBgImage } from "../../../utils/helper";
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
9
10
|
const BackgroundImage = props => {
|
@@ -15,6 +16,7 @@ const BackgroundImage = props => {
|
|
15
16
|
elementProps,
|
16
17
|
title
|
17
18
|
} = props;
|
19
|
+
const previewImg = GetPageBgImage(value);
|
18
20
|
const {
|
19
21
|
translation
|
20
22
|
} = customProps;
|
@@ -69,7 +71,7 @@ const BackgroundImage = props => {
|
|
69
71
|
item: true,
|
70
72
|
xs: 12,
|
71
73
|
style: {
|
72
|
-
backgroundImage: base64 ? `url(${
|
74
|
+
backgroundImage: base64 ? `url(${previewImg})` : "none"
|
73
75
|
// height: "200px",
|
74
76
|
},
|
75
77
|
|
@@ -482,8 +482,8 @@ export const getBlock = props => {
|
|
482
482
|
style: {
|
483
483
|
// borderColor: element?.color || "transparent",
|
484
484
|
...getBorderColor(element?.color || "transparent", 3),
|
485
|
-
background: element?.bgColor
|
486
|
-
padding:
|
485
|
+
background: element?.bgColor,
|
486
|
+
padding: "16px",
|
487
487
|
borderRadius: `${element?.color ? "0px" : "12px"} 12px 12px ${element?.color ? "0px" : "12px"}`,
|
488
488
|
margin: `${element?.bgColor ? "16px" : "0px"} 0px`,
|
489
489
|
width: element?.bgColor ? "calc(100% - 16px)" : "100%",
|
@@ -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
|
};
|