<commit_before>import React from 'react';
import ReactDOM from 'react-dom';
import { connect } from 'react-redux'; 

import { uiActions } from 'core/ui';
import { pomodarioActions } from 'core/pomodario';

class TreeMenu extends React.Component {
  constructor(props){
    super(props)
    const {nodeUpdate, node, togglePomodario, setPomodarioMeta, onMouseBlur} = this.props
    this.nodeUpdate = nodeUpdate
    this.node = node
    this.styles = [
      {"background-color": "#b53f45", "color":"#fff", "border-radius":"4px"},
      {"background-color": "#acba9d", "color":"#fff", "border-radius":"4px"},
      {"background-color": "#eed19c", "color":"#fff", "border-radius":"4px"},
      {"background-color": "#efb28c", "color":"#fff", "border-radius":"4px"},
      {"background-color": "#749db9", "color":"#fff", "border-radius":"4px"},
      {"background-color": "#fff", "color":"#000", "border-radius":"4px"},
      {'text-decoration':'line-through', "color":"rgb(186, 186, 186)"},
    ]
    this.updateIcon = this.updateIcon.bind(this)
    this.togglePomodario = togglePomodario.bind(this, node)
    this.setPomodarioMeta = setPomodarioMeta.bind(this)
    this.startPomodario = this.startPomodario.bind(this)
    this.onMouseBlur = onMouseBlur.bind(this)
  }

  updateIcon(index){
    this.nodeUpdate(Object.assign({}, this.node, {style: this.styles[index]}))
  }

  startPomodario(){
    this.togglePomodario()
    this.setPomodarioMeta(this.node)
  }

  render(){
    const {node, show} = this.props
    if (show){
    return <div className="node-menu" onBlur={this.onMouseBlur}><commit_msg>fix bug, when change a style, some new created info may missing<commit_after>import React from 'react';
import ReactDOM from 'react-dom';
import { connect } from 'react-redux'; 

import { uiActions } from 'core/ui';
import { pomodarioActions } from 'core/pomodario';

class TreeMenu extends React.Component {
  constructor(props){
    super(props)
    const {nodeUpdate, node, togglePomodario, setPomodarioMeta, onMouseBlur} = this.props
    this.nodeUpdate = nodeUpdate
    this.node = node
    this.styles = [
      {"background-color": "#b53f45", "color":"#fff", "border-radius":"4px"},
      {"background-color": "#acba9d", "color":"#fff", "border-radius":"4px"},
      {"background-color": "#eed19c", "color":"#fff", "border-radius":"4px"},
      {"background-color": "#efb28c", "color":"#fff", "border-radius":"4px"},
      {"background-color": "#749db9", "color":"#fff", "border-radius":"4px"},
      {"background-color": "#fff", "color":"#000", "border-radius":"4px"},
      {'text-decoration':'line-through', "color":"rgb(186, 186, 186)"},
    ]
    this.updateIcon = this.updateIcon.bind(this)
    this.togglePomodario = togglePomodario.bind(this, node)
    this.setPomodarioMeta = setPomodarioMeta.bind(this)
    this.startPomodario = this.startPomodario.bind(this)
    this.onMouseBlur = onMouseBlur.bind(this)
  }

  updateIcon(index){
    const {node} = this.props
    this.nodeUpdate(Object.assign({}, node, {style: this.styles[index]}))
  }

  startPomodario(){
    this.togglePomodario()
    this.setPomodarioMeta(this.node)
  }

  render(){
    const {node, show} = this.props
    if (show){
    return <div className="node-menu" onBlur={this.onMouseBlur}>
{'fraction_non_alphanumeric': 0.1830125267338833, 'fraction_numerical': 0.018942865872288422, 'mean_word_length': 4.420529801324503, 'pattern_counts': {'":': 38, '<': 5, '<?xml version=': 0, '>': 5, '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': '7466432', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1087, 'n_words': 205}