@flozy/editor 3.2.5 → 3.2.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -324,7 +324,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
324
324
  editor
325
325
  });
326
326
  } else if (event.key === "Enter") {
327
- enterEvent(event, editor);
327
+ enterEvent(event, editor, customProps?.isMobile);
328
328
  }
329
329
  }, [chars, editor, target, mentions, setMentions, search, type, mentionsRef]);
330
330
  const Overlay = collaborativeEditor && !isReadOnly ? RemoteCursorOverlay : React.Fragment;
@@ -187,6 +187,7 @@ const Grid = props => {
187
187
  const NewLineButtons = () => {
188
188
  return !readOnly && selected && path.length === 2 && !showTool ? /*#__PURE__*/_jsxs(_Fragment, {
189
189
  children: [/*#__PURE__*/_jsx("div", {
190
+ contentEditable: false,
190
191
  className: "element-selector-ctrl tc",
191
192
  children: /*#__PURE__*/_jsx(Tooltip, {
192
193
  title: "Add Space above",
@@ -197,6 +198,7 @@ const Grid = props => {
197
198
  })
198
199
  })
199
200
  }), /*#__PURE__*/_jsx("div", {
201
+ contentEditable: false,
200
202
  className: "element-selector-ctrl bc",
201
203
  children: /*#__PURE__*/_jsx(Tooltip, {
202
204
  title: "Add Space below",
@@ -69,6 +69,7 @@ const SignaturePopup = props => {
69
69
  });
70
70
  };
71
71
  const onChange = e => {
72
+ e?.stopPropagation();
72
73
  setSignedData({
73
74
  ...signedData,
74
75
  [e.target.name]: e.target.value
@@ -92,7 +93,8 @@ const SignaturePopup = props => {
92
93
  ...data
93
94
  });
94
95
  };
95
- const onTabChange = newValue => {
96
+ const onTabChange = (e, newValue) => {
97
+ e?.stopPropagation();
96
98
  setTab(newValue);
97
99
  setSignedData({
98
100
  signedOn: new Date(),
@@ -171,7 +173,7 @@ const SignaturePopup = props => {
171
173
  variant: "scrollable",
172
174
  value: tab,
173
175
  onChange: (e, newValue) => {
174
- onTabChange(newValue);
176
+ onTabChange(e, newValue);
175
177
  },
176
178
  "aria-label": "Element Tabs",
177
179
  children: [/*#__PURE__*/_jsx(Tab, {
@@ -264,6 +266,9 @@ const SignaturePopup = props => {
264
266
  })
265
267
  }), /*#__PURE__*/_jsx(Grid, {
266
268
  item: true,
269
+ onClick: e => {
270
+ e?.stopPropagation();
271
+ },
267
272
  xs: 12,
268
273
  children: /*#__PURE__*/_jsx(DatePicker, {
269
274
  showIcon: true,
@@ -110,7 +110,8 @@ const AddTemplates = props => {
110
110
  if (!search) {
111
111
  return true;
112
112
  } else {
113
- return f.title.toLowerCase().includes(search);
113
+ const searchText = search?.toLowerCase();
114
+ return f?.title?.toLowerCase()?.includes(searchText);
114
115
  }
115
116
  };
116
117
  const renderTemplate = mapData => {
@@ -258,7 +258,7 @@ const usePopupStyle = theme => ({
258
258
  margin: "12px 0px",
259
259
  paddingRight: "8px",
260
260
  "&.fullscreen": {
261
- height: `${window.innerHeight - 300}px`
261
+ height: `${window.innerHeight - 197}px`
262
262
  }
263
263
  },
264
264
  templateCardTitle: {
@@ -169,12 +169,12 @@ const checkListEnterEvent = (editor, type) => {
169
169
  insertNewLine(editor);
170
170
  }
171
171
  };
172
- export const enterEvent = (e, editor) => {
172
+ export const enterEvent = (e, editor, isMobile) => {
173
173
  try {
174
174
  const ele = isListItem(editor);
175
175
 
176
176
  // on shift enter break line in same node
177
- if (e.shiftKey) {
177
+ if (e.shiftKey && !isMobile) {
178
178
  e.preventDefault();
179
179
  Transforms.insertText(editor, "\n");
180
180
  } else if (ele && ele[0]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "3.2.5",
3
+ "version": "3.2.6",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"