fix: Add ability to convert between checklist and other types of list

This commit is contained in:
Tom Moor
2022-03-23 00:27:22 -07:00
parent 7f15eb287d
commit 8aa25fd7d6
21 changed files with 147 additions and 100 deletions

View File

@@ -1,11 +1,11 @@
import Token from "markdown-it/lib/token";
import { NodeSpec, NodeType, Node as ProsemirrorNode } from "prosemirror-model";
import { EditorState, Transaction } from "prosemirror-state";
import { EditorState } from "prosemirror-state";
import * as React from "react";
import DisabledEmbed from "../components/DisabledEmbed";
import { MarkdownSerializerState } from "../lib/markdown/serializer";
import embedsRule from "../rules/embeds";
import { ComponentProps } from "../types";
import { ComponentProps, Dispatch } from "../types";
import Node from "./Node";
const cache = {};
@@ -117,7 +117,7 @@ export default class Embed extends Node {
commands({ type }: { type: NodeType }) {
return (attrs: Record<string, any>) => (
state: EditorState,
dispatch: (tr: Transaction) => void
dispatch: Dispatch
) => {
dispatch(
state.tr.replaceSelectionWith(type.create(attrs)).scrollIntoView()