<commit_before>import React from 'react';
import PureRenderMixin from 'react-addons-pure-render-mixin';
import Immutable from 'immutable';

import Inputs from './inputs';
import { TogglableDisplay } from './display-area';

import Editor from './editor';
import LatexRenderer from '../latex';

import Pager from './pager';

class CodeCell extends React.Component {
  static propTypes = {
    cell: React.PropTypes.instanceOf(Immutable.Map).isRequired,
    displayOrder: React.PropTypes.instanceOf(Immutable.List).isRequired,
    id: React.PropTypes.string,
    language: React.PropTypes.string,
    theme: React.PropTypes.string,
    transforms: React.PropTypes.instanceOf(Immutable.Map),
    focused: React.PropTypes.bool,
    pagers: React.PropTypes.instanceOf(Immutable.List),
    running: React.PropTypes.bool,
    focusAbove: React.PropTypes.func,
    focusBelow: React.PropTypes.func,
  };

  static defaultProps = {
    pagers: new Immutable.List(),
    running: false,
    tabSize: 4,
  };

  constructor(props) {
    super(props);
    this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
  }

  isOutputHidden() {
    return this.props.cell.get('outputHidden');
  }

  isInputHidden() {
    return this.props.cell.get('inputHidden');
  }

  render() {
    return (<div>
      {
        !this.isInputHidden() ?
          <div className="input-container">
            <Inputs
              executionCount={this.props.cell.get('execution_count')}
              running={this.props.running}
            />
            <Editor
              completion
              id={this.props.id}
              tabSize={this.props.tabSize}
              input={this.props.cell.get('source')}
              language={this.props.language}
              focused={this.props.focused}
              theme={this.props.theme}
              focusAbove={this.props.focusAbove}
              focusBelow={this.props.focusBelow}
            />
          </div> : null
      }
      {
        this.props.pagers && !this.props.pagers.isEmpty() ?
          <div className="pagers">
            {
            this.props.pagers.map((pager, key) =>
              <Pager
                className="pager"
                displayOrder={this.props.displayOrder}
                transforms={this.props.transforms}
                bundle={pager.get('data')}
                theme={this.props.theme}
                key={key}
              />
            )
          }
          </div> : null
      }
      <LatexRenderer>
        <div className="outputs">
          <TogglableDisplay
            className="outputs-display"
            outputs={this.props.cell.get('outputs')}
            isHidden={this.isOutputHidden()}
            displayOrder={this.props.displayOrder}
            transforms={this.props.transforms}
            theme={this.props.theme}
          />
        </div>
      </LatexRenderer>
    </div>);
  }
}

export default CodeCell;
<commit_msg>fix(codeMirror): Add tabSize in typings of code-cell.<commit_after>import React from 'react';
import PureRenderMixin from 'react-addons-pure-render-mixin';
import Immutable from 'immutable';

import Inputs from './inputs';
import { TogglableDisplay } from './display-area';

import Editor from './editor';
import LatexRenderer from '../latex';

import Pager from './pager';

class CodeCell extends React.Component {
  static propTypes = {
    cell: React.PropTypes.instanceOf(Immutable.Map).isRequired,
    displayOrder: React.PropTypes.instanceOf(Immutable.List).isRequired,
    id: React.PropTypes.string,
    language: React.PropTypes.string,
    theme: React.PropTypes.string,
    transforms: React.PropTypes.instanceOf(Immutable.Map),
    focused: React.PropTypes.bool,
    pagers: React.PropTypes.instanceOf(Immutable.List),
    running: React.PropTypes.bool,
    focusAbove: React.PropTypes.func,
    focusBelow: React.PropTypes.func,
    tabSize: React.PropTypes.number,
  };

  static defaultProps = {
    pagers: new Immutable.List(),
    running: false,
    tabSize: 4,
  };

  constructor(props) {
    super(props);
    this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
  }

  isOutputHidden() {
    return this.props.cell.get('outputHidden');
  }

  isInputHidden() {
    return this.props.cell.get('inputHidden');
  }

  render() {
    return (<div>
      {
        !this.isInputHidden() ?
          <div className="input-container">
            <Inputs
              executionCount={this.props.cell.get('execution_count')}
              running={this.props.running}
            />
            <Editor
              completion
              id={this.props.id}
              tabSize={this.props.tabSize}
              input={this.props.cell.get('source')}
              language={this.props.language}
              focused={this.props.focused}
              theme={this.props.theme}
              focusAbove={this.props.focusAbove}
              focusBelow={this.props.focusBelow}
            />
          </div> : null
      }
      {
        this.props.pagers && !this.props.pagers.isEmpty() ?
          <div className="pagers">
            {
            this.props.pagers.map((pager, key) =>
              <Pager
                className="pager"
                displayOrder={this.props.displayOrder}
                transforms={this.props.transforms}
                bundle={pager.get('data')}
                theme={this.props.theme}
                key={key}
              />
            )
          }
          </div> : null
      }
      <LatexRenderer>
        <div className="outputs">
          <TogglableDisplay
            className="outputs-display"
            outputs={this.props.cell.get('outputs')}
            isHidden={this.isOutputHidden()}
            displayOrder={this.props.displayOrder}
            transforms={this.props.transforms}
            theme={this.props.theme}
          />
        </div>
      </LatexRenderer>
    </div>);
  }
}

export default CodeCell;

{'fraction_non_alphanumeric': 0.1262718932443703, 'fraction_numerical': 0.0003336113427856547, 'mean_word_length': 2.073295745771399, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 33, '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': '5616987', 'n_tokens_mistral': 1740, 'n_tokens_neox': 1692, 'n_words': 270}