import { Node, Mark, type Extensions, type CommandProps } from "@tiptap/core" // Extend TipTap's command types declare module "@tiptap/core" { interface Commands { horizontalRule: { setHorizontalRule: () => ReturnType } } } // Minimal schema-only nodes and marks for MarkdownWc export function markdownWcNodes(): Extensions { return [ // doc Node.create({ name: "doc", topNode: true, content: "block+" }), // text Node.create({ name: "text", group: "inline" }), // paragraph Node.create({ name: "paragraph", group: "block", content: "inline*", addAttributes() { return { data: { default: null } } }, renderHTML() { return ["p", 0] }, }), // heading Node.create({ name: "heading", group: "block", content: "inline*", addAttributes() { return { level: { default: 1 }, data: { default: null } } }, renderHTML({ node }) { const level = (node as any).attrs?.level || 1 return ["h" + level, 0] }, }), // lists Node.create({ name: "bulletList", group: "block", content: "listItem+", addAttributes() { return { isTaskList: { default: false }, data: { default: null } } }, renderHTML() { // Match serializeToHtml default: plain