@flozy/editor 4.1.1 → 4.1.2

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.
@@ -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;
@@ -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
- width: "100%",
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 === 'undo' ? !canUndo : type === 'redo' ? !canRedo : false;
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 === 'undo' && !canUndo || type === 'redo' && !canRedo ? "disabled" : ""}`,
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"