mirror of
https://github.com/outline/outline.git
synced 2026-11-21 13:34:02 +03:00
* chore: Update editor generics * fix: Address PR review on editor generics - Restore null-guard on Link click handler so anchors aren't inert when no onClickLink is provided - Mark onClickLink optional in LinkOptions and openLink command to match runtime - Remove dead `collapsed` option from HeadingOptions - Make ToggleBlock dictionary optional and restore optional-chained access for server-side schema instantiation Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
56 lines
1.2 KiB
TypeScript
56 lines
1.2 KiB
TypeScript
import type { InputRule } from "prosemirror-inputrules";
|
|
import type { ParseSpec } from "prosemirror-markdown";
|
|
import type {
|
|
NodeSpec,
|
|
Node as ProsemirrorNode,
|
|
NodeType,
|
|
Schema,
|
|
} from "prosemirror-model";
|
|
import type { Command } from "prosemirror-state";
|
|
import type { CommandFactory } from "../lib/Extension";
|
|
import Extension from "../lib/Extension";
|
|
import type { MarkdownSerializerState } from "../lib/markdown/serializer";
|
|
|
|
export default abstract class Node<
|
|
TOptions extends object = object,
|
|
> extends Extension<TOptions> {
|
|
get type() {
|
|
return "node";
|
|
}
|
|
|
|
get schema(): NodeSpec {
|
|
return {};
|
|
}
|
|
|
|
get attrs(): NodeSpec["attrs"] {
|
|
return {};
|
|
}
|
|
|
|
get markdownToken(): string {
|
|
return "";
|
|
}
|
|
|
|
inputRules(_options: { type: NodeType; schema: Schema }): InputRule[] {
|
|
return [];
|
|
}
|
|
|
|
keys(_options: { type: NodeType; schema: Schema }): Record<string, Command> {
|
|
return {};
|
|
}
|
|
|
|
commands(_options: {
|
|
type: NodeType;
|
|
schema: Schema;
|
|
}): Record<string, CommandFactory> | CommandFactory {
|
|
return {};
|
|
}
|
|
|
|
toMarkdown(_state: MarkdownSerializerState, _node: ProsemirrorNode) {
|
|
throw new Error("toMarkdown not implemented");
|
|
}
|
|
|
|
parseMarkdown(): ParseSpec | void {
|
|
return undefined;
|
|
}
|
|
}
|