kosei-n 1 год назад
Родитель
Сommit
c982b5c523

+ 1 - 6
packages/editor/src/components/CodeMirrorEditor/CodeMirrorEditor.module.scss

@@ -38,9 +38,6 @@
     .cm-header-6 {
       font-size: 1.2em;
     }
-    // .cm-cursor.cm-cursor-primary {
-    //   border-color: aqua;
-    // }
 
   }
 
@@ -154,9 +151,7 @@
       background-size: 1em;
     }
   }
-  // .cm-cursor.cm-cursor-primary {
-  //   background-image: url(../../../svg/table.svg);
-  // }
+
   .markdown-table-activated .cm-cursor.cm-cursor-primary {
     &:after {
       background-image: url(../../../svg/table.svg);

+ 1 - 38
packages/editor/src/components/CodeMirrorEditor/CodeMirrorEditor.tsx

@@ -164,46 +164,10 @@ export const CodeMirrorEditor = (props: Props): JSX.Element => {
 
   }, [onScroll, codeMirrorEditor]);
 
-  // useEffect(() => {
-
-  //   const markdownTableActivatedClass = 'markdown-table-activated';
-
-  //   const editor = codeMirrorEditor?.view;
-
-  //   const handleFocusChanged = () => {
-
-  //     if (editor == null) {
-  //       return;
-  //     }
-
-  //     if (isInTable(editor)) {
-  //       // set class
-  //       setEditorClass(markdownTableActivatedClass);
-  //     }
-  //     else {
-  //       setEditorClass('');
-  //     }
-
-  //   };
-
-  //   const extension = EditorView.domEventHandlers({
-  //     cursorActivity: handleFocusChanged,
-  //   });
-
-  //   EditorView.updateListener.of((v: ViewUpdate) => {
-  //     if (v.transactions.some(tr => tr.selection)) {
-  //       handleFocusChanged();
-  //     }
-  //   });
-
-  //   const cleanupFunction = codeMirrorEditor?.appendExtensions(extension);
-
-  //   return cleanupFunction;
-
-  // }, [codeMirrorEditor]);
 
   const markdownTableActivatedClass = 'markdown-table-activated';
   const editor = codeMirrorEditor?.view;
+
   const handleFocusChanged = () => {
     if (editor == null) {
       return;
@@ -226,7 +190,6 @@ export const CodeMirrorEditor = (props: Props): JSX.Element => {
     effects: StateEffect.appendConfig.of(cursorPositionListener),
   });
 
-  // EditorView.;
 
   const {
     getRootProps,