<commit_before>import PropTypes from 'prop-types';
import React, { PureComponent } from 'react';
import ReactDOM from 'react-dom';

const mapSandboxFromObjectToString = (sandbox) => {
    sandbox = { ...sandbox };

    return Object.keys(sandbox)
        .filter(key => sandbox[key])
        .map(s => s.replace(/[A-Z]/g, '-$&').toLowerCase())
        .join(' ');
};

class Iframe extends PureComponent {
    static propTypes = {
        src: PropTypes.string.isRequired,
        width: PropTypes.string,
        height: PropTypes.string,
        sandbox: PropTypes.shape({
            // Re-enables form submission
            allowForms: PropTypes.bool,

            // Sandboxed frames will block modal dialogs by default
            allowModals: PropTypes.bool,

            // Re-enables APIs
            allowPointerLock: PropTypes.bool,

            // Re-enables popups
            allowPopups: PropTypes.bool,

            // Allows the iframe content to be treated as being from the same origin
            allowSameOrigin: PropTypes.bool,

            // Re-enables scripts
            allowScripts: PropTypes.bool,

            // Allows the iframe content to navigate its top-level browsing context
            allowTopNavigation: PropTypes.bool
        })
    };
    static defaultProps = {
        width: '100%',
        height: '100%',
        sandbox: {
            allowForms: true,
            allowModals: true,
            allowPointerLock: false,
            allowPopups: true,
            allowSameOrigin: true,
            allowScripts: true,
            allowTopNavigation: false
        }
    };

    reload() {
        const el = ReactDOM.findDOMNode(this);
        el.src = '';
        setTimeout(() => {
            el.src = this.props.src;
        }, 0);
    }
    render() {
        const { style, ...props } = this.props;
        const sandbox = mapSandboxFromObjectToString(props.sandbox);
        delete props.sandbox;

        return (
            <iframe
                frameBorder="0"
                sandbox={sandbox}
                style={{
                    overflow: 'hidden',
                    position: 'absolute',
                    top: 0,
                    left: 0,
                    right: 0,
                    bottom: 0,
                    ...style
                }}
                {...props}
            />
        );
    }
}

export default Iframe;
<commit_msg>Do not apply default styles to the Iframe component<commit_after>import PropTypes from 'prop-types';
import React, { PureComponent } from 'react';
import ReactDOM from 'react-dom';

const mapSandboxFromObjectToString = (sandbox) => {
    sandbox = { ...sandbox };

    return Object.keys(sandbox)
        .filter(key => sandbox[key])
        .map(s => s.replace(/[A-Z]/g, '-$&').toLowerCase())
        .join(' ');
};

class Iframe extends PureComponent {
    static propTypes = {
        src: PropTypes.string.isRequired,
        width: PropTypes.string,
        height: PropTypes.string,
        sandbox: PropTypes.shape({
            // Re-enables form submission
            allowForms: PropTypes.bool,

            // Sandboxed frames will block modal dialogs by default
            allowModals: PropTypes.bool,

            // Re-enables APIs
            allowPointerLock: PropTypes.bool,

            // Re-enables popups
            allowPopups: PropTypes.bool,

            // Allows the iframe content to be treated as being from the same origin
            allowSameOrigin: PropTypes.bool,

            // Re-enables scripts
            allowScripts: PropTypes.bool,

            // Allows the iframe content to navigate its top-level browsing context
            allowTopNavigation: PropTypes.bool
        })
    };
    static defaultProps = {
        width: '100%',
        height: '100%',
        sandbox: {
            allowForms: true,
            allowModals: true,
            allowPointerLock: false,
            allowPopups: true,
            allowSameOrigin: true,
            allowScripts: true,
            allowTopNavigation: false
        }
    };

    reload() {
        const el = ReactDOM.findDOMNode(this);
        el.src = '';
        setTimeout(() => {
            el.src = this.props.src;
        }, 0);
    }
    render() {
        const props = { ...this.props };
        const sandbox = mapSandboxFromObjectToString(props.sandbox);
        delete props.sandbox;

        return (
            <iframe
                frameBorder="0"
                sandbox={sandbox}
                {...props}
            />
        );
    }
}

export default Iframe;

{'fraction_non_alphanumeric': 0.10385949696444059, 'fraction_numerical': 0.004336513443191674, 'mean_word_length': 1.5458057395143487, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '2746528', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1210, 'n_words': 305}