<commit_before>var React = require('react');
var WindowListenable = require('./mixins/window-listenable');
var CssEvent = require('./utils/css-event');
var KeyCode = require('./utils/key-code');
var StylePropable = require('./mixins/style-propable');
var Transitions = require('./styles/mixins/transitions');
var CustomVariables = require('./styles/variables/custom-variables');
var FlatButton = require('./flat-button');
var Overlay = require('./overlay');
var Paper = require('./paper');

var DialogWindow = React.createClass({

  mixins: [WindowListenable, StylePropable],

  propTypes: {
    actions: React.PropTypes.array,
    contentClassName: React.PropTypes.string,
    openImmediately: React.PropTypes.bool,
    onClickAway: React.PropTypes.func,
    onDismiss: React.PropTypes.func,
    onShow: React.PropTypes.func,
    repositionOnUpdate: React.PropTypes.bool
  },

  windowListeners: {
    'keyup': '_handleWindowKeyUp'
  },

  getDefaultProps: function() {
    return {
      actions: [],
      repositionOnUpdate: true
    };
  },

  getInitialState: function() {
    return {
      open: this.props.openImmediately || false
    };
  },

  componentDidMount: function() {
    this._positionDialog();
  },

  componentDidUpdate: function(prevProps, prevState) {
    this._positionDialog();
  },

  /** Styles */
  _main: function() {
    var style = {
      position: 'fixed',
      zIndex: 10,
      top: 0,
      left: -10000,
      width: '100%',
      height: '100%',
      transition: Transitions.easeOut('0ms', 'left', '450ms'),
    };

    if (this.state.open) {
      style = this.mergeAndPrefix(style, {
        left: 0,
        transition: Transitions.easeOut('0ms', 'left', '0ms'),
      });
    }

    return this.mergeAndPrefix(style);
  },

  _contents: function() {
    var style = {    
      transition: Transitions.easeOut(),
      position: 'relative',
      width: '75%',
      maxWidth: (CustomVariables.spacing.desktopKeylineIncrement * 12),
      margin: '0 auto',
      zIndex: 10,
      background: CustomVariables.canvasColor,
      opacity: 0,
    };

    if (this.state.open) {
      style = this.mergeAndPrefix(style, {
        opacity: 1,
        top: 0,
        transform: 'translate3d(0, ' + CustomVariables.spacing.desktopKeylineIncrement + 'px, 0)',
      });
    }

    return this.mergeAndPrefix(style);
  },

  render: function() {
    var actions = this._getActionsContainer(this.props.actions);

    if (this.props.contentClassName) {
      contentClasses += ' ' + this.props.contentClassName;
    }

    return (
      <div ref="container" style={this._main()}>
        <Paper ref="dialogWindow" style={this._contents()} zDepth={4}>
          {this.props.children}
          {actions}
        </Paper><commit_msg>Fixed minor compile error with dialog-window<commit_after>var React = require('react');
var WindowListenable = require('./mixins/window-listenable');
var CssEvent = require('./utils/css-event');
var KeyCode = require('./utils/key-code');
var StylePropable = require('./mixins/style-propable');
var Transitions = require('./styles/mixins/transitions');
var CustomVariables = require('./styles/variables/custom-variables');
var FlatButton = require('./flat-button');
var Overlay = require('./overlay');
var Paper = require('./paper');

var DialogWindow = React.createClass({

  mixins: [WindowListenable, StylePropable],

  propTypes: {
    actions: React.PropTypes.array,
    contentClassName: React.PropTypes.string,
    openImmediately: React.PropTypes.bool,
    onClickAway: React.PropTypes.func,
    onDismiss: React.PropTypes.func,
    onShow: React.PropTypes.func,
    repositionOnUpdate: React.PropTypes.bool
  },

  windowListeners: {
    'keyup': '_handleWindowKeyUp'
  },

  getDefaultProps: function() {
    return {
      actions: [],
      repositionOnUpdate: true
    };
  },

  getInitialState: function() {
    return {
      open: this.props.openImmediately || false
    };
  },

  componentDidMount: function() {
    this._positionDialog();
  },

  componentDidUpdate: function(prevProps, prevState) {
    this._positionDialog();
  },

  /** Styles */
  _main: function() {
    var style = {
      position: 'fixed',
      zIndex: 10,
      top: 0,
      left: -10000,
      width: '100%',
      height: '100%',
      transition: Transitions.easeOut('0ms', 'left', '450ms'),
    };

    if (this.state.open) {
      style = this.mergeAndPrefix(style, {
        left: 0,
        transition: Transitions.easeOut('0ms', 'left', '0ms'),
      });
    }

    return this.mergeAndPrefix(style);
  },

  _contents: function() {
    var style = {    
      transition: Transitions.easeOut(),
      position: 'relative',
      width: '75%',
      maxWidth: (CustomVariables.spacing.desktopKeylineIncrement * 12),
      margin: '0 auto',
      zIndex: 10,
      background: CustomVariables.canvasColor,
      opacity: 0,
    };

    if (this.state.open) {
      style = this.mergeAndPrefix(style, {
        opacity: 1,
        top: 0,
        transform: 'translate3d(0, ' + CustomVariables.spacing.desktopKeylineIncrement + 'px, 0)',
      });
    }

    return this.mergeAndPrefix(style);
  },

  render: function() {
    var actions = this._getActionsContainer(this.props.actions);

    return (
      <div ref="container" style={this._main()}>
        <Paper ref="dialogWindow" style={this._contents()} className={this.props.contentClassName} zDepth={4}>
          {this.props.children}
          {actions}
        </Paper>
{'fraction_non_alphanumeric': 0.14872727272727274, 'fraction_numerical': 0.012727272727272728, 'mean_word_length': 2.989122552574329, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6167461', 'n_tokens_mistral': 1743, 'n_tokens_neox': 1653, 'n_words': 327}