all files / ui/ TextBlockComponent.js

85.71% Statements 6/7
50% Branches 1/2
100% Functions 1/1
85.71% Lines 6/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27            1094× 1094×   1094×     1094×       1094×       1094×            
import NodeComponent from './NodeComponent'
import TextProperty from './TextPropertyComponent'
 
class TextBlockComponent extends NodeComponent {
 
  render($$) {
    let el = super.render($$)
    el.addClass('sc-text-block')
 
    let node = this.props.node
    // NOTE: we are not using the native text direction support as it changes the contenteditable behavior in a weird way
    // instead rtl text is supported on model level
    Iif (node.direction) {
      // el.attr('data-direction', node.direction)
      el.attr('dir', node.direction)
    }
    el.append($$(TextProperty, {
      path: node.getTextPath(),
      direction: node.direction
    }))
    return el
  }
 
}
 
export default TextBlockComponent