message: clean up katex plugin and simplify logic
diff: @@ -68,26 +68,17 @@ export const removeKatex = (editor: Editor) => {
  }
  export interface KatexPluginOptions {
  - EditorComponent?: React.ComponentType<
  - NodeEditorProps & { name: string; cache: EditCommitCache }
  - >
  + EditorComponent?: React.ComponentType<NodeEditorProps & { name: string }>
  RenderComponent?: React.ComponentType<NodeRendererProps>
  ControlsComponent?: React.ComponentType<NodeControlsProps>
  }
  -export interface EditCommitCache {
  - key?: string
  - value?: string
  -}
  -
  export const createKatexPlugin = ({
  EditorComponent = DefaultEditorComponent,
  RenderComponent = DefaultRendererComponent
  }: KatexPluginOptions = {}) => (
  pluginClosure: SlatePluginClosure
  ): TextPlugin => {
  - // this state is needed to hold uncommited edits of math editor
  - const editCommitCache = { key: undefined, value: undefined }
  return {
  deserialize(el, next) {
  switch (el.tagName.toLowerCase()) {
  @@ -146,14 +137,7 @@ export const createKatexPlugin = ({
  (block.object === 'block' && block.type === katexBlockNode) ||
  (inline.object === 'inline' && inline.type === katexInlineNode)
  ) {
  - return (
  - <EditorComponent
  - {...props}
  - cache={editCommitCache}
  - editor={editor}
  - name={name}
  - />
  - )
  + return <EditorComponent {...props} editor={editor} name={name} />
  }
  return next()
  