Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
MasanobuRyuman committed Jun 20, 2023
1 parent 53d4dcc commit 4067c8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export const helpers = {
textHelpers,
pathHelpers,
childHelpers,
...nodeHelpers,
nodeHelpers,
};
10 changes: 5 additions & 5 deletions packages/core/src/toolmenu/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback } from 'react';
import { Path, last } from 'slate';
import { Path } from 'slate';
import { useSlate } from 'slate-react';
import { CopyIcon } from '../components/icons/copy';
import { DustboxIcon } from '../components/icons/dustbox';
Expand Down Expand Up @@ -33,8 +33,8 @@ export const Toolmenu: React.FC<ToolmenuProps> = ({ path, onDone }) => {
if (!textNodeList.length) {
return;
}
const lastTextPath = textNodeList[textNodeList.length - 1][1];
const lastTextNode = textNodeList[textNodeList.length - 1][0];
const [lastTextNode, lastTextPath] =
textNodeList[textNodeList.length - 1];
if (!Text.isText(lastTextNode)) {
return;
}
Expand All @@ -53,7 +53,7 @@ export const Toolmenu: React.FC<ToolmenuProps> = ({ path, onDone }) => {
offset: lastOffset,
},
};
await helpers.copyNode(editor);
await helpers.nodeHelpers.copyNode(editor);
editor.selection = {
anchor: {
path: [...path, 0],
Expand All @@ -65,7 +65,7 @@ export const Toolmenu: React.FC<ToolmenuProps> = ({ path, onDone }) => {
},
};
} else {
helpers.copyNode(editor);
helpers.nodeHelpers.copyNode(editor);
}
onDone();
}, [editor, path, onDone]);
Expand Down

0 comments on commit 4067c8d

Please sign in to comment.