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.

21 lines (16 loc) 526 B
import Component from './Component' class SelectionFragmentComponent extends Component { render($$) { // TODO: we should rename se-cursor to sc-cursor let el = $$('span').addClass('se-selection-fragment') if (this.props.collaborator) { let collaboratorIndex = this.props.collaborator.colorIndex el.addClass('sm-collaborator-'+collaboratorIndex) } else { el.addClass('sm-local-user') } el.append(this.props.children) return el } } export default SelectionFragmentComponent