<commit_before>// LICENSE : MIT
"use strict";
let React = require("react");
let ReactCodeMirror = require('react-codemirror');
require("codemirror/addon/mode/overlay.js");
require("codemirror/mode/xml/xml.js");
require("codemirror/mode/markdown/markdown.js");
require("codemirror/mode/gfm/gfm.js");
require("codemirror/mode/javascript/javascript.js");
require("codemirror/mode/css/css.js");
require("codemirror/mode/htmlmixed/htmlmixed.js");
require("codemirror/mode/clike/clike.js");
require("codemirror/mode/meta.js");
require("codemirror/addon/edit/continuelist.js");
require("codemirror/addon/lint/lint.js");
const createValidator = require("codemirror-textlint");
const preset = require("textlint-rule-preset-japanese");
const validator = createValidator(preset);
import Mousetrap from "mousetrap";
export default class Editor extends React.Component {
    componentDidMount() {
        [1, 2, 3, 4, 5, 6, 7, 8, 9].forEach((key, index) => {
            Mousetrap.bind(`command+${key}`, () => {
                this.props.toggleServiceAtIndex(index)
            });
        });
    }

    render() {
        var extraKeys = {
            "Cmd-Enter": () => {
                this.props.onSubmit();
            }
        };
        [1, 2, 3, 4, 5, 6, 7, 8, 9].forEach((key, index) => {
            extraKeys[`Cmd-${key}`] = () => {
                this.props.toggleServiceAtIndex(index);
            };
        });
        var options = {
            lineWrapping: true,
            mode: "gfm",
            gutters: ["CodeMirror-lint-markers"],
            lint: {
                "getAnnotations": validator,
                "async": true
            },
            extraKeys: extraKeys
        };
        return <div className="Editor">
            <h2 className="l-header">Body</h2>
            <ReactCodeMirror value={this.props.value} onChange={this.props.onChange} options={options}/>
        </div>
    }<commit_msg>feat(keyboard): enable global key bind<commit_after>// LICENSE : MIT
"use strict";
let React = require("react");
let ReactCodeMirror = require('react-codemirror');
require("codemirror/addon/mode/overlay.js");
require("codemirror/mode/xml/xml.js");
require("codemirror/mode/markdown/markdown.js");
require("codemirror/mode/gfm/gfm.js");
require("codemirror/mode/javascript/javascript.js");
require("codemirror/mode/css/css.js");
require("codemirror/mode/htmlmixed/htmlmixed.js");
require("codemirror/mode/clike/clike.js");
require("codemirror/mode/meta.js");
require("codemirror/addon/edit/continuelist.js");
require("codemirror/addon/lint/lint.js");
const createValidator = require("codemirror-textlint");
const preset = require("textlint-rule-preset-japanese");
const validator = createValidator(preset);
import Mousetrap from "mousetrap";
import "mousetrap/plugins/global-bind/mousetrap-global-bind";
export default class Editor extends React.Component {
    componentDidMount() {
        [1, 2, 3, 4, 5, 6, 7, 8, 9].forEach((key, index) => {
            Mousetrap.bindGlobal(`command+${key}`, () => {
                this.props.toggleServiceAtIndex(index)
            });
        });
    }

    render() {
        var extraKeys = {
            "Cmd-Enter": () => {
                this.props.onSubmit();
            }
        };
        [1, 2, 3, 4, 5, 6, 7, 8, 9].forEach((key, index) => {
            extraKeys[`Cmd-${key}`] = () => {
                this.props.toggleServiceAtIndex(index);
            };
        });
        var options = {
            lineWrapping: true,
            mode: "gfm",
            gutters: ["CodeMirror-lint-markers"],
            lint: {
                "getAnnotations": validator,
                "async": true
            },
            extraKeys: extraKeys
        };
        return <div className="Editor">
            <h2 className="l-header">Body</h2>
            <ReactCodeMirror value={this.props.value} onChange={this.props.onChange} options={options}/>
        </div>
    }
{'fraction_non_alphanumeric': 0.16468203699011907, 'fraction_numerical': 0.010134279199391943, 'mean_word_length': 2.547169811320755, 'pattern_counts': {'":': 6, '<': 13, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '645192', 'n_tokens_mistral': 1295, 'n_tokens_neox': 1237, 'n_words': 198}