<commit_before>'use strict';

var React = require('react');

function visualiseRender (component) {
    component.prototype.UPDATE_RENDER_LOG_POSITION_TIMEOUT_MS = 500;
    component.prototype.MAX_LOG_LENGTH = 20;
    component.prototype.STATE_CHANGES = {
        MOUNT: 'mount',
        UPDATE: 'update'
    };
    component.prototype.styling = {
        renderLog: {
            color: 'rgb(85, 85, 85)',
            fontFamily: '\'Helvetica Neue\', Arial, Helvetica, sans-serif',
            fontSize: '14px',
            lineHeight: '18px',
            background: 'linear-gradient(#fff, #ccc)',
            boxShadow: '0 2px 12px rgba(0,0,0,0.5)',
            textShadow: '0 1px 0 #fff',
            borderRadius: '7px',
            position: 'absolute',
            maxWidth: '70%',
            padding: '5px 10px',
            zIndex: '10000'
        },
        renderLogDetailNotes: {
            color: 'red',
            textAlign: 'center'
        },
        elementHighlightMonitor: {
            outline: '1px solid rgba(47, 150, 180, 1)'
        },
        elementHighlightMount: {
            outline: '3px solid rgba(197, 16, 12, 1)'
        },
        elementHighlightUpdate: {
            outline: '3px solid rgba(197, 203, 1, 1)'
        }
    };

    component.prototype.componentDidMount = function(){
        // Reset the logs
        this._resetRenderLog();

        // Record initial mount
        this.addToRenderLog(this.state, 'Initial Render');

        // Build the monitor node
        this._buildRenderLogNode();

        // Highlight the initial mount
        this._highlightChange(this.STATE_CHANGES.MOUNT);

        // Set the watch to update log position<commit_msg>Fixed stateless component bug (unresolved in source project - https://github.com/redsunsoft/react-render-visualizer/pull/3)<commit_after>'use strict';

var React = require('react');

function visualiseRender (component) {
    component.prototype.UPDATE_RENDER_LOG_POSITION_TIMEOUT_MS = 500;
    component.prototype.MAX_LOG_LENGTH = 20;
    component.prototype.STATE_CHANGES = {
        MOUNT: 'mount',
        UPDATE: 'update'
    };
    component.prototype.styling = {
        renderLog: {
            color: 'rgb(85, 85, 85)',
            fontFamily: '\'Helvetica Neue\', Arial, Helvetica, sans-serif',
            fontSize: '14px',
            lineHeight: '18px',
            background: 'linear-gradient(#fff, #ccc)',
            boxShadow: '0 2px 12px rgba(0,0,0,0.5)',
            textShadow: '0 1px 0 #fff',
            borderRadius: '7px',
            position: 'absolute',
            maxWidth: '70%',
            padding: '5px 10px',
            zIndex: '10000'
        },
        renderLogDetailNotes: {
            color: 'red',
            textAlign: 'center'
        },
        elementHighlightMonitor: {
            outline: '1px solid rgba(47, 150, 180, 1)'
        },
        elementHighlightMount: {
            outline: '3px solid rgba(197, 16, 12, 1)'
        },
        elementHighlightUpdate: {
            outline: '3px solid rgba(197, 203, 1, 1)'
        }
    };

    component.prototype.componentDidMount = function(){
        // Create empty state object if not defined
        if (!this.state) {
            this.state = {};
        }

        // Reset the logs
        this._resetRenderLog();

        // Record initial mount
        this.addToRenderLog(this.state, 'Initial Render');

        // Build the monitor node
        this._buildRenderLogNode();

        // Highlight the initial mount
        this._highlightChange(this.STATE_CHANGES.MOUNT);

        // Set the watch to update log position
{'fraction_non_alphanumeric': 0.11897548884604792, 'fraction_numerical': 0.03662902781602864, 'mean_word_length': 1.9432739059967585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '578406', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1032, 'n_words': 247}