@flozy/editor 7.0.4 → 7.0.5
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 +17 -14
- package/dist/Editor/Editor.css +2 -3
- package/dist/Editor/Elements/SimpleText/index.js +7 -12
- package/dist/Editor/Styles/EditorStyles.js +287 -291
- package/dist/Editor/Toolbar/PopupTool/index.js +32 -48
- package/dist/Editor/common/FontLoader/FontList.js +11 -11
- package/dist/Editor/common/FontLoader/FontLoader.js +75 -45
- package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -1
- package/dist/Editor/common/ImageSelector/UploadStyles.js +1 -1
- package/dist/Editor/common/RnD/ElementSettings/styles.js +1 -1
- package/dist/Editor/common/Section/index.js +58 -87
- package/dist/Editor/helper/deserialize/index.js +1 -1
- package/dist/Editor/hooks/useDrag.js +17 -11
- package/dist/Editor/hooks/useEditorScroll.js +1 -2
- package/dist/Editor/hooks/useMouseMove.js +2 -1
- package/dist/Editor/utils/SlateUtilityFunctions.js +5 -0
- package/package.json +3 -3
@@ -54,13 +54,14 @@ const Item = /*#__PURE__*/forwardRef(({
|
|
54
54
|
});
|
55
55
|
});
|
56
56
|
Item.displayName = "Item";
|
57
|
-
const Element = props => {
|
57
|
+
const Element = /*#__PURE__*/React.memo(props => {
|
58
58
|
return /*#__PURE__*/_jsx(Section, {
|
59
59
|
...props,
|
60
60
|
children: getBlock(props)
|
61
61
|
});
|
62
|
-
};
|
63
|
-
|
62
|
+
});
|
63
|
+
Element.displayName = "Element";
|
64
|
+
const Leaf = /*#__PURE__*/React.memo(({
|
64
65
|
attributes,
|
65
66
|
children,
|
66
67
|
leaf
|
@@ -71,7 +72,8 @@ const Leaf = ({
|
|
71
72
|
...attributes,
|
72
73
|
children: children
|
73
74
|
});
|
74
|
-
};
|
75
|
+
});
|
76
|
+
Leaf.displayName = "Leaf";
|
75
77
|
const updateTopBanner = (content = [], setTopBanner) => {
|
76
78
|
setTopBanner(() => {
|
77
79
|
const firstNode = content ? content[0] : {};
|
@@ -91,8 +93,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
91
93
|
otherProps,
|
92
94
|
isIframe,
|
93
95
|
theme,
|
94
|
-
showViewport = false
|
95
|
-
overrideWrapperStyles = {}
|
96
|
+
showViewport = false
|
96
97
|
} = props;
|
97
98
|
const editorWrapper = useRef();
|
98
99
|
const mentionsRef = useRef();
|
@@ -153,8 +154,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
153
154
|
const classes = editorStyles({
|
154
155
|
padHeight: !fullScreen ? otherProps?.padHeight : 20,
|
155
156
|
placeHolderColor: invertColor(pageColor || "#FFF"),
|
156
|
-
theme
|
157
|
-
overrideWrapperStyles
|
157
|
+
theme
|
158
158
|
});
|
159
159
|
const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
|
160
160
|
useEffect(() => {
|
@@ -314,7 +314,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
314
314
|
updateTopBanner(newValue, setTopBanner);
|
315
315
|
debounced(newValue);
|
316
316
|
if (!isInteracted) {
|
317
|
-
setIsInteracted(true);
|
317
|
+
// setIsInteracted(true);
|
318
318
|
}
|
319
319
|
}
|
320
320
|
};
|
@@ -495,7 +495,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
495
495
|
...props,
|
496
496
|
fullScreen: fullScreen,
|
497
497
|
footer: footer || "",
|
498
|
-
children: /*#__PURE__*/
|
498
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
499
499
|
component: "div",
|
500
500
|
className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
|
501
501
|
sx: classes.root,
|
@@ -505,7 +505,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
505
505
|
"data-breakpoint": breakpoint
|
506
506
|
// onContextMenu={handleContextMenu}
|
507
507
|
,
|
508
|
-
children: /*#__PURE__*/_jsxs(Slate, {
|
508
|
+
children: [/*#__PURE__*/_jsxs(Slate, {
|
509
509
|
editor: editor,
|
510
510
|
initialValue: getInitialValue(debouncedValue?.current, readOnly),
|
511
511
|
onChange: handleEditorChange,
|
@@ -606,10 +606,13 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
606
606
|
}), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
|
607
607
|
...htmlAction,
|
608
608
|
handleCodeToText: handleCodeToText
|
609
|
-
}), /*#__PURE__*/_jsx(FontLoader, {
|
610
|
-
...props
|
611
609
|
})]
|
612
|
-
}, id)
|
610
|
+
}, id), /*#__PURE__*/_jsx(FontLoader, {
|
611
|
+
otherProps: {
|
612
|
+
services: otherProps?.services
|
613
|
+
},
|
614
|
+
readOnly: readOnly
|
615
|
+
})]
|
613
616
|
})
|
614
617
|
})
|
615
618
|
});
|
package/dist/Editor/Editor.css
CHANGED
@@ -1279,10 +1279,9 @@ blockquote {
|
|
1279
1279
|
background: none !important;
|
1280
1280
|
}
|
1281
1281
|
@media (max-width: 899px) {
|
1282
|
-
|
1283
|
-
/* .MuiPopover-root {
|
1282
|
+
.MuiPopover-root {
|
1284
1283
|
z-index: 1302 !important;
|
1285
|
-
}
|
1284
|
+
}
|
1286
1285
|
|
1287
1286
|
canvas {
|
1288
1287
|
max-width: 100% !important;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { useSlateStatic, useSelected, ReactEditor } from "slate-react";
|
3
3
|
import { Box } from "@mui/material";
|
4
|
-
import { getPageSettings } from "../../utils/pageSettings";
|
4
|
+
// import { getPageSettings } from "../../utils/pageSettings";
|
5
5
|
import { isTextSelected } from "../../utils/helper";
|
6
6
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
7
7
|
import SimpleTextStyle from "./style";
|
@@ -12,7 +12,6 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { createElement as _createElement } from "react";
|
13
13
|
const SimpleText = props => {
|
14
14
|
const {
|
15
|
-
theme,
|
16
15
|
openAI
|
17
16
|
} = useEditorContext() || {};
|
18
17
|
const editor = useSlateStatic();
|
@@ -28,19 +27,15 @@ const SimpleText = props => {
|
|
28
27
|
readOnly,
|
29
28
|
editorPlaceholder
|
30
29
|
} = customProps;
|
31
|
-
const {
|
32
|
-
|
33
|
-
} = getPageSettings(editor) || {};
|
34
|
-
const {
|
35
|
-
pageColor
|
36
|
-
} = pageSt?.pageProps || {};
|
30
|
+
// const { element: pageSt } = getPageSettings(editor) || {};
|
31
|
+
// const { pageColor } = pageSt?.pageProps || {};
|
37
32
|
const {
|
38
33
|
activeBreakPoint
|
39
34
|
} = useEditorContext();
|
40
35
|
const lineHeight = element?.children[0]?.lineHeight;
|
41
36
|
const lineH = getBreakpointLineSpacing(lineHeight, activeBreakPoint);
|
42
37
|
const classes = SimpleTextStyle({
|
43
|
-
pageColor:
|
38
|
+
pageColor: "#FFFFFF",
|
44
39
|
lineHeight: lineH
|
45
40
|
});
|
46
41
|
const selected = useSelected();
|
@@ -59,14 +54,14 @@ const SimpleText = props => {
|
|
59
54
|
contentEditable: false,
|
60
55
|
className: "placeholder-simple-text",
|
61
56
|
children: isEmptyEditor ? editorPlaceholder || "Write Something..." : showPlaceHolder ? opacity && selected ? /*#__PURE__*/_jsxs(_Fragment, {
|
62
|
-
children: ["Type ", /*#__PURE__*/_jsx("span", {
|
57
|
+
children: ["Type", " ", /*#__PURE__*/_jsx("span", {
|
63
58
|
style: {
|
64
|
-
backgroundColor:
|
59
|
+
backgroundColor: "#F2F6FA",
|
65
60
|
padding: "0px 2px",
|
66
61
|
borderRadius: "2px"
|
67
62
|
},
|
68
63
|
children: "/"
|
69
|
-
}), " to browse elements"]
|
64
|
+
}), " ", "to browse elements"]
|
70
65
|
}) : "" : ""
|
71
66
|
}));
|
72
67
|
};
|