<commit_before>import editor from "./editor.vue";
import moduleText from "./modules/text/index";
import moduleFont from "./modules/font/index";
import moduleColor from "./modules/color/index";
import moduleAlign from "./modules/align/index";
import moduleList from "./modules/list/index";
import moduleLink from "./modules/link/index";
import moduleUnlink from "./modules/unlink/index";
import moduleTable from "./modules/table/index";
import moduleImage from "./modules/image/index";
import moduleEraser from "./modules/eraser/index";
import moduleFullScreen from "./modules/full-screen/index";
import moduleInfo from "./modules/info/index";
import i18nZhCn from "./i18n/zh-cn";
import i18nEnUs from "./i18n/en-us";

/**
 * install
 * @param Vue   {Vue}
 * @param options {Object}
 */
exports.install = (Vue, options) => {

    options = options || {}

    //modules
    let modules = [
        moduleText,
        moduleColor,
        moduleFont,
        moduleAlign,
        moduleList,
        moduleLink,
        moduleUnlink,
        moduleTable,
        moduleImage,
        moduleEraser,
        moduleFullScreen,
        moduleInfo
    ]
    //extended modules
    if (Array.isArray(options.modules)) {
        let arr = []
        options.modules.forEach(function (module) {
            if (module.name) {
                arr.push(module)
            }
        })
        modules = modules.concat(arr)
    }

    let components = {}
    modules.forEach((module)=> {

        //specify the config for each module in options by name
        let config = options[module.name]
        module.config = Vue.util.extend(module.config || {}, config || {})

        if (module.dashboard) {
            //$options.module
            module.dashboard.module = module
            components[module.name] = module.dashboard
        }
        if (options.icons && options.icons[module.name]) {
            module.icon = options.icons[module.name]
        }

        module.hasDashboard = !!module.dashboard
        //prevent vue sync
        module.dashboard = null
    })

    //i18n
    let i18n = {"zh-cn": i18nZhCn, "en-us": i18nEnUs}
    i18n = Vue.util.extend(i18n, options.i18n || {})
    let language = options.language || "en-us"
    let locale = i18n[language] || i18n["en-us"]


    let component = Vue.extend(editor).extend({
        data () {
            return {modules, locale}
        },
        components
    })

    Vue.component(options.name || "html5-editor", component)
}<commit_msg>modify default component name<commit_after>import editor from "./editor.vue";
import moduleText from "./modules/text/index";
import moduleFont from "./modules/font/index";
import moduleColor from "./modules/color/index";
import moduleAlign from "./modules/align/index";
import moduleList from "./modules/list/index";
import moduleLink from "./modules/link/index";
import moduleUnlink from "./modules/unlink/index";
import moduleTable from "./modules/table/index";
import moduleImage from "./modules/image/index";
import moduleEraser from "./modules/eraser/index";
import moduleFullScreen from "./modules/full-screen/index";
import moduleInfo from "./modules/info/index";
import i18nZhCn from "./i18n/zh-cn";
import i18nEnUs from "./i18n/en-us";

/**
 * install
 * @param Vue   {Vue}
 * @param options {Object}
 */
exports.install = (Vue, options) => {

    options = options || {}

    //modules
    let modules = [
        moduleText,
        moduleColor,
        moduleFont,
        moduleAlign,
        moduleList,
        moduleLink,
        moduleUnlink,
        moduleTable,
        moduleImage,
        moduleEraser,
        moduleFullScreen,
        moduleInfo
    ]
    //extended modules
    if (Array.isArray(options.modules)) {
        let arr = []
        options.modules.forEach(function (module) {
            if (module.name) {
                arr.push(module)
            }
        })
        modules = modules.concat(arr)
    }

    let components = {}
    modules.forEach((module)=> {

        //specify the config for each module in options by name
        let config = options[module.name]
        module.config = Vue.util.extend(module.config || {}, config || {})

        if (module.dashboard) {
            //$options.module
            module.dashboard.module = module
            components[module.name] = module.dashboard
        }
        if (options.icons && options.icons[module.name]) {
            module.icon = options.icons[module.name]
        }

        module.hasDashboard = !!module.dashboard
        //prevent vue sync
        module.dashboard = null
    })

    //i18n
    let i18n = {"zh-cn": i18nZhCn, "en-us": i18nEnUs}
    i18n = Vue.util.extend(i18n, options.i18n || {})
    let language = options.language || "en-us"
    let locale = i18n[language] || i18n["en-us"]


    let component = Vue.extend(editor).extend({
        data () {
            return {modules, locale}
        },
        components
    })

    Vue.component(options.name || "vue-html5-editor", component)
}
{'fraction_non_alphanumeric': 0.13201911589008364, 'fraction_numerical': 0.010752688172043012, 'mean_word_length': 2.289456450556647, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 7, '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': '172246', 'n_tokens_mistral': 1491, 'n_tokens_neox': 1457, 'n_words': 337}