<commit_before>import React, { PropTypes, Component } from 'react'
import { Emoji, Picker } from 'emoji-mart'
import Util from '../../Metamaps/Util'

class NewMessage extends Component {
  constructor(props) {
    super(props)

    this.state = {
      showEmojiPicker: false
    }
  }

  toggleEmojiPicker = () => {
    this.setState({ showEmojiPicker: !this.state.showEmojiPicker })
  }

  textAreaValue = () => {
    return Util.addEmoji(this.props.messageText)
  }

  handleClick = (emoji, event) => {
    const { messageText } = this.props
    this.props.handleChange({ target: {
      value: messageText + emoji.colons
    }})

    this.setState({ showEmojiPicker: false })
    this.props.focusMessageInput()
  }

  render = () => {
    return (
      <div className="new-message-area">
        <Picker set="emojione"
          onClick={this.handleClick}
          style={{
            display: this.state.showEmojiPicker ? 'block' : 'none',
            maxWidth: '100%'
          }}
          emoji="upside_down_face"
          title="Emoji"
        />
        <div className="extra-message-options">
          <span className="emoji-picker-button" onClick={this.toggleEmojiPicker}><Emoji size={24} emoji="upside_down_face" /></span>
        </div>
        <textarea value={this.textAreaValue()}
          onChange={this.props.handleChange}
          {...this.props.textAreaProps}
        />
      </div>
    )
  }
}

NewMessage.propTypes = {
  messageText: PropTypes.string,
  handleChange: PropTypes.func,
  focusMessageInput: PropTypes.func,
  textAreaProps: PropTypes.shape({
    className: PropTypes.string,
    ref: PropTypes.func,
    placeholder: PropTypes.string,
    onKeyUp: PropTypes.func,
    onFocus: PropTypes.func,
    onBlur: PropTypes.func
  })
}

export default NewMessage
<commit_msg>stop replacing shortcodes/emoticon in the live NewMessage textarea (#1026)<commit_after>import React, { PropTypes, Component } from 'react'
import { Emoji, Picker } from 'emoji-mart'

class NewMessage extends Component {
  constructor(props) {
    super(props)

    this.state = {
      showEmojiPicker: false
    }
  }

  toggleEmojiPicker = () => {
    this.setState({ showEmojiPicker: !this.state.showEmojiPicker })
  }

  handleClick = (emoji, event) => {
    const { messageText } = this.props
    this.props.handleChange({ target: {
      value: messageText + emoji.colons
    }})

    this.setState({ showEmojiPicker: false })
    this.props.focusMessageInput()
  }

  render = () => {
    return (
      <div className="new-message-area">
        <Picker set="emojione"
          onClick={this.handleClick}
          style={{
            display: this.state.showEmojiPicker ? 'block' : 'none',
            maxWidth: '100%'
          }}
          emoji="upside_down_face"
          title="Emoji"
        />
        <div className="extra-message-options">
          <span className="emoji-picker-button" onClick={this.toggleEmojiPicker}><Emoji size={24} emoji="upside_down_face" /></span>
        </div>
        <textarea value={this.props.messageText}
          onChange={this.props.handleChange}
          {...this.props.textAreaProps}
        />
      </div>
    )
  }
}

NewMessage.propTypes = {
  messageText: PropTypes.string,
  handleChange: PropTypes.func,
  focusMessageInput: PropTypes.func,
  textAreaProps: PropTypes.shape({
    className: PropTypes.string,
    ref: PropTypes.func,
    placeholder: PropTypes.string,
    onKeyUp: PropTypes.func,
    onFocus: PropTypes.func,
    onBlur: PropTypes.func
  })
}

export default NewMessage

{'fraction_non_alphanumeric': 0.13123948401570387, 'fraction_numerical': 0.003925967470555244, 'mean_word_length': 2.6925465838509317, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5517348', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1136, 'n_words': 201}