@flozy/editor 5.8.4 → 5.8.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.
@@ -29,7 +29,8 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
29
29
  onSave,
30
30
  onsubmit,
31
31
  onBlur = () => {},
32
- isMobile = false
32
+ isMobile = false,
33
+ debounceTimeOut = 10
33
34
  } = props;
34
35
  const classes = usePopupStyle(theme);
35
36
  const convertedContent = draftToSlate({
@@ -40,7 +41,6 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
40
41
  }]
41
42
  }]
42
43
  });
43
- const [isInteracted, setIsInteracted] = useState(false);
44
44
  const [value, setValue] = useState(convertedContent);
45
45
  const debouncedValue = useRef(value);
46
46
  const debounced = useDebouncedCallback(
@@ -53,7 +53,7 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
53
53
  onSave(strVal, restVal);
54
54
  },
55
55
  // delay in ms
56
- 500);
56
+ debounceTimeOut);
57
57
  const editor = useMemo(() => {
58
58
  return withCommon(createEditor(), {
59
59
  needLayout,
@@ -180,9 +180,6 @@ const ChatEditor = /*#__PURE__*/forwardRef((props, ref) => {
180
180
  const handleEditorChange = newValue => {
181
181
  debounced(newValue);
182
182
  debouncedValue.current = newValue;
183
- if (!isInteracted) {
184
- setIsInteracted(true);
185
- }
186
183
  };
187
184
  const Element = props => {
188
185
  return getBlock(props);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "5.8.4",
3
+ "version": "5.8.5",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"