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 system. It is developed to power our online editing platform [Substance](http://substance.io).
20 lines (16 loc) • 409 B
JavaScript
import { Component, $$ } from '../dom'
export default class AnnotationComponent extends Component {
render () {
const el = $$(this.getTagName())
.attr('data-id', this.props.node.id)
.addClass(this.getClassNames())
el.append(this.props.children)
return el
}
getClassNames () {
return `sc-annotation sm-${this.props.node.type}`
}
getTagName () {
return 'span'
}
}