@flozy/editor 4.1.0 → 4.1.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/CommonEditor.js +0 -3
- package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -6
- package/dist/Editor/Elements/FreeGrid/styles.js +7 -3
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +11 -3
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +2 -1
- package/dist/Editor/common/RnD/index.js +2 -1
- package/package.json +1 -1
@@ -366,9 +366,6 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
366
366
|
});
|
367
367
|
} else if (event.key === "Enter") {
|
368
368
|
enterEvent(event, editor, customProps?.isMobile);
|
369
|
-
} else if (event.key === 'Backspace') {
|
370
|
-
event.preventDefault();
|
371
|
-
editor.deleteBackward();
|
372
369
|
}
|
373
370
|
}, [chars, editor, target, mentions, setMentions, search, type, mentionsRef]);
|
374
371
|
const Overlay = collaborativeEditor && !isReadOnly ? RemoteCursorOverlay : React.Fragment;
|
@@ -25,11 +25,13 @@ const EmbedScriptPopup = props => {
|
|
25
25
|
error
|
26
26
|
} = apiStatus;
|
27
27
|
useEffect(() => {
|
28
|
-
customProps
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
if (customProps?.services) {
|
29
|
+
customProps.services("allowedDomains", {}).then(data => {
|
30
|
+
setAllowedDomains(data?.data || []);
|
31
|
+
}).catch(err => {
|
32
|
+
console.log(err);
|
33
|
+
});
|
34
|
+
}
|
33
35
|
}, []);
|
34
36
|
const updateApiStatus = update => {
|
35
37
|
setApiStatus(prev => ({
|
@@ -44,7 +46,7 @@ const EmbedScriptPopup = props => {
|
|
44
46
|
updateApiStatus({
|
45
47
|
loading: true
|
46
48
|
});
|
47
|
-
const result = await customProps
|
49
|
+
const result = await customProps?.services("validateCode", {
|
48
50
|
code
|
49
51
|
});
|
50
52
|
const {
|
@@ -160,6 +160,9 @@ const useFreeGridStyles = ({
|
|
160
160
|
}
|
161
161
|
},
|
162
162
|
"& .fgi_type_appHeader": {
|
163
|
+
maxWidth: "100%",
|
164
|
+
maxHeight: "100%",
|
165
|
+
overflow: "hidden",
|
163
166
|
"& .MuiAppBar-root": {
|
164
167
|
zIndex: 100
|
165
168
|
},
|
@@ -168,10 +171,11 @@ const useFreeGridStyles = ({
|
|
168
171
|
paddingRight: "0px !important",
|
169
172
|
"& .app-drawer-btn": {
|
170
173
|
marginRight: "0px",
|
171
|
-
|
174
|
+
paddingTop: "12px",
|
175
|
+
// width: "100%",
|
172
176
|
"& svg": {
|
173
|
-
width: "100%",
|
174
|
-
height: "100%"
|
177
|
+
// width: "100%",
|
178
|
+
// height: "100%",
|
175
179
|
}
|
176
180
|
}
|
177
181
|
}
|
@@ -52,7 +52,9 @@ const MiniToolbar = props => {
|
|
52
52
|
const boxRef = useRef(null); // Add ref to get the Box element
|
53
53
|
const UPDATED_MENU_OPTIONS = MENU_OPTIONS.filter(f => (hideTools || [])?.indexOf(f.type) === -1);
|
54
54
|
const {
|
55
|
-
popupType
|
55
|
+
popupType,
|
56
|
+
selectedElement,
|
57
|
+
setSelectedElement
|
56
58
|
} = useEditorContext();
|
57
59
|
const canUndo = editor.history.undos.length > 0;
|
58
60
|
const canRedo = editor.history.redos.length > 0;
|
@@ -75,6 +77,11 @@ const MiniToolbar = props => {
|
|
75
77
|
}
|
76
78
|
setPopper(type);
|
77
79
|
setAnchorEl(e.currentTarget);
|
80
|
+
setSelectedElement({
|
81
|
+
...selectedElement,
|
82
|
+
enable: 1,
|
83
|
+
selectedAction: null
|
84
|
+
});
|
78
85
|
};
|
79
86
|
const onClose = () => {
|
80
87
|
setPopper(null);
|
@@ -116,13 +123,14 @@ const MiniToolbar = props => {
|
|
116
123
|
label,
|
117
124
|
icon: Icon
|
118
125
|
}) => {
|
119
|
-
const isDisabled = popupType === type || type ===
|
126
|
+
const isDisabled = popupType === type || type === "undo" ? !canUndo : type === "redo" ? !canRedo : false; // for textFormat type
|
127
|
+
|
120
128
|
return /*#__PURE__*/_jsx(Tooltip, {
|
121
129
|
arrow: true,
|
122
130
|
title: label,
|
123
131
|
disableHoverListener: toolTip,
|
124
132
|
children: /*#__PURE__*/_jsx(IconButton, {
|
125
|
-
className: `${type === popper ? "active" : ""} ${type ===
|
133
|
+
className: `${type === popper ? "active" : ""} ${type === "undo" && !canUndo || type === "redo" && !canRedo ? "disabled" : ""}`,
|
126
134
|
onClick: handleClick(type),
|
127
135
|
disabled: isDisabled,
|
128
136
|
children: type === "page-settings" ? /*#__PURE__*/_jsx(PageSettingsButton, {
|
@@ -591,8 +591,9 @@ const usePopupStyle = theme => ({
|
|
591
591
|
border: "1px solid #E4E8EB",
|
592
592
|
maxHeight: "140px",
|
593
593
|
background: theme?.palette?.editor?.background,
|
594
|
-
overflowY: "hidden",
|
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
|
}
|
@@ -22,6 +22,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
22
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
23
23
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
24
24
|
const ITEM_TYPES = ["child", "parent-container"];
|
25
|
+
const EDIT_MODES = ["text", "form"];
|
25
26
|
let hover_on = new Set();
|
26
27
|
const RnD = props => {
|
27
28
|
const rndRef = useRef(null);
|
@@ -180,7 +181,7 @@ const RnD = props => {
|
|
180
181
|
});
|
181
182
|
setSelectedElement({
|
182
183
|
path: str_path,
|
183
|
-
enable: 2,
|
184
|
+
enable: EDIT_MODES.includes(childType) ? 2 : 1,
|
184
185
|
cursor: "auto",
|
185
186
|
anchorEl: rndRef?.current
|
186
187
|
});
|