@flozy/editor 3.6.6 → 3.6.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useMemo, useRef, useState, useEffect, useImperativeHandle, forwardRef } from "react";
2
- import { Editable, Slate } from 'slate-react';
2
+ import { Editable, Slate, ReactEditor } from 'slate-react';
3
3
  import { createEditor } from 'slate';
4
4
  import { useDebounce } from "use-debounce";
5
5
  import withCommon from "./hooks/withCommon";
@@ -44,7 +44,16 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
44
44
  const isReadOnly = readOnly === "readonly";
45
45
  useImperativeHandle(ref, () => ({
46
46
  emojiClick: emoji => {
47
- insertEmoji(editor, emoji?.native, editor.selection);
47
+ if (editor) {
48
+ insertEmoji(editor, emoji?.native, editor.selection);
49
+ ReactEditor.focus(editor);
50
+ }
51
+ },
52
+ // Focus enable
53
+ enableFocus: () => {
54
+ if (editor) {
55
+ ReactEditor.focus(editor);
56
+ }
48
57
  }
49
58
  }));
50
59
  useEffect(() => {
@@ -13,7 +13,8 @@ const MentionsListCard = props => {
13
13
  } = props;
14
14
  const {
15
15
  name,
16
- email
16
+ email,
17
+ avatar_filename = null
17
18
  } = data;
18
19
  return /*#__PURE__*/_jsxs(Card, {
19
20
  sx: {
@@ -37,7 +38,9 @@ const MentionsListCard = props => {
37
38
  alignItems: "center"
38
39
  },
39
40
  alt: name,
40
- children: /*#__PURE__*/_jsx(Avatar, {})
41
+ children: /*#__PURE__*/_jsx(Avatar, {
42
+ src: avatar_filename
43
+ })
41
44
  }), /*#__PURE__*/_jsx(Box, {
42
45
  sx: {
43
46
  display: "flex",
@@ -10,7 +10,7 @@ const usePopupStyles = theme => ({
10
10
  papper: {
11
11
  boxShadow: "none",
12
12
  width: "300px",
13
- height: "300px",
13
+ height: "auto",
14
14
  overflow: "auto",
15
15
  padding: "8px",
16
16
  margin: "0px",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "3.6.6",
3
+ "version": "3.6.8",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"