feat: add permission handling

This commit is contained in:
thecodrr
2022-07-04 13:00:13 +05:00
parent b3a5444c91
commit 9f2e57b61a
54 changed files with 352 additions and 81 deletions

View File

@@ -16,9 +16,10 @@ import {
ForwardRef,
} from "./types";
import { ReactNodeView } from "./react-node-view";
import { Editor, NodeViewRendererProps } from "@tiptap/core";
import { NodeViewRendererProps } from "@tiptap/core";
import { Theme } from "@notesnook/theme";
import { ThemeProvider } from "emotion-theming";
import { Editor } from "../../types";
/**
* A ReactNodeView that handles React components sensitive
@@ -251,7 +252,7 @@ export function createSelectionBasedNodeView<
) {
return ({ node, getPos, editor }: NodeViewRendererProps) => {
const _getPos = () => (typeof getPos === "boolean" ? -1 : getPos());
return new SelectionBasedNodeView(node, editor, _getPos, {
return new SelectionBasedNodeView(node, editor as Editor, _getPos, {
...options,
component,
}).init();