UNPKG

substance

Version:

Substance is a JavaScript library for web-based content editing. It provides building blocks for realizing custom text editors and web-based publishing systems.

29 lines (22 loc) 537 B
import DocumentNode from './DocumentNode' import TextNodeMixin from './TextNodeMixin' /** A base class for all text-ish nodes, such as Paragraphs, Headings, Prerendered, etc. */ class TextNode extends TextNodeMixin(DocumentNode) { getPath() { return [this.id, 'content'] } getText() { return this.content } } TextNode.isText = true TextNode.schema = { type: "text", content: "text", direction: { type: "string", optional: true }, textAlign: { type: "string", default: 'left' } } export default TextNode