mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-05-18 05:05:36 +02:00
editor: remove unneeded code
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -17,14 +17,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
AnyConfig,
|
||||
EditorOptions,
|
||||
Editor as TiptapEditor,
|
||||
createDocument,
|
||||
getExtensionField,
|
||||
resolveFocusPosition
|
||||
} from "@tiptap/core";
|
||||
import { EditorOptions, Editor as TiptapEditor } from "@tiptap/core";
|
||||
import { DependencyList, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { Editor } from "../types.js";
|
||||
import { useToolbarStore } from "../toolbar/stores/toolbar-store.js";
|
||||
@@ -36,9 +29,6 @@ function useForceUpdate() {
|
||||
return () => setValue((value) => value + 1);
|
||||
}
|
||||
|
||||
// TODO: remove
|
||||
const bindings: Record<any, any> = {};
|
||||
|
||||
export const useEditor = (
|
||||
options: Partial<EditorOptions> = {},
|
||||
deps: DependencyList = []
|
||||
@@ -47,21 +37,6 @@ export const useEditor = (
|
||||
const forceUpdate = useForceUpdate();
|
||||
const editorRef = useRef<TiptapEditor>(editor);
|
||||
|
||||
// TODO: remove
|
||||
const resolvedExtensions = editor.extensionManager.extensions;
|
||||
for (const extension of resolvedExtensions) {
|
||||
const addKeyboardShortcuts = getExtensionField<
|
||||
AnyConfig["addKeyboardShortcuts"]
|
||||
>(extension, "addKeyboardShortcuts", {
|
||||
name: extension.name,
|
||||
options: extension.options,
|
||||
storage: extension.storage,
|
||||
editor
|
||||
});
|
||||
bindings[extension.name] = addKeyboardShortcuts?.();
|
||||
}
|
||||
console.log("bindings", bindings);
|
||||
|
||||
useEffect(
|
||||
() => {
|
||||
if (editor.view.isDestroyed) return;
|
||||
|
||||
Reference in New Issue
Block a user