Skip to content

Commit

Permalink
log
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfeng33 committed Oct 24, 2024
1 parent 5ae4f99 commit da05a92
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions packages/ai/src/lib/BaseAIPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,23 @@ export type BaseAIPluginConfig = PluginConfig<

export const BaseAIPlugin = createTSlatePlugin({
key: 'ai',
extendEditor: ({ editor }) => {
const { apply } = editor;

editor.apply = (op) => {
console.log(op);

console.log(editor.history);

apply(op);
};

return editor;
},
node: { isLeaf: true },
})
.extendTransforms(({ editor }) => ({
insertNodes: bindFirst(insertAINodes, editor),
removeMarks: bindFirst(removeAIMarks, editor),
removeNodes: bindFirst(removeAINodes, editor),
undo: bindFirst(undoAI, editor),
}))
}).extendTransforms(({ editor }) => ({
insertNodes: bindFirst(insertAINodes, editor),
removeMarks: bindFirst(removeAIMarks, editor),
removeNodes: bindFirst(removeAINodes, editor),
undo: bindFirst(undoAI, editor),
}));

0 comments on commit da05a92

Please sign in to comment.