@flozy/editor 5.2.3 → 5.2.4

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.
@@ -91,6 +91,7 @@ const SearchButton = /*#__PURE__*/forwardRef((props, ref) => {
91
91
  const handleClose = () => {
92
92
  clearBrainText(editor);
93
93
  setAnchorEl(null);
94
+ setSearch("");
94
95
  };
95
96
  const handleClick = data => {
96
97
  insertBrain(editor, data, target || editor.selection);
@@ -352,7 +352,7 @@ export const clearBrainText = editor => {
352
352
  } = editor;
353
353
  if (selection) {
354
354
  const [currentNode, currentPath] = Editor.node(editor, selection);
355
- const cleanedText = Node.string(currentNode).replace(/\/b(?:rain|rai|ra|r)?/g, "").trim();
355
+ const cleanedText = Node.string(currentNode).replace(/\/(?:b(?:rain|rai|ra|r)?)?/g, "").trim();
356
356
  Transforms.insertText(editor, cleanedText, {
357
357
  at: currentPath
358
358
  });
@@ -18,7 +18,7 @@ export const insertBrain = (editor, data, position) => {
18
18
  };
19
19
  const [currentNode, currentPath] = Editor.node(editor, selection);
20
20
  console.log('W1', Node.string(currentNode));
21
- const cleanedText = Node.string(currentNode).replace(/\/b(?:rain|rai|ra|r)?/g, "").trim();
21
+ const cleanedText = Node.string(currentNode).replace(/\/(?:b(?:rain|rai|ra|r)?)?/g, "").trim();
22
22
  if (cleanedText) {
23
23
  Transforms.delete(editor, {
24
24
  at: Editor.range(editor, currentPath)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "5.2.3",
3
+ "version": "5.2.4",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"