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.

25 lines (19 loc) 402 B
import { DocumentNode } from '../../model' class ImageNode extends DocumentNode { getImageFile() { if (this.imageFile) { return this.document.get(this.imageFile) } } getUrl() { let imageFile = this.getImageFile() if (imageFile) { return imageFile.getUrl() } } } ImageNode.schema = { type: 'image', imageFile: { type: 'file' } } export default ImageNode