main 636533f1d277 cached
24 files
60.1 KB
20.1k tokens
27 symbols
1 requests
Download .txt
Repository: surmon-china/vue-quill-editor
Branch: main
Commit: 636533f1d277
Files: 24
Total size: 60.1 KB

Directory structure:
gitextract_gay3qb1z/

├── .babelrc
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .npmignore
├── .travis.yml
├── CHANGELOG.md
├── LICENSE
├── README.md
├── bower.json
├── config/
│   ├── base.conf.js
│   ├── build.conf.js
│   └── test.conf.js
├── dist/
│   └── vue-quill-editor.js
├── package.json
├── src/
│   ├── editor.vue
│   └── index.js
└── test/
    ├── e2e/
    │   ├── custom-assertions/
    │   │   └── elementCount.js
    │   ├── nightwatch.conf.js
    │   └── runner.js
    └── unit/
        ├── .eslintrc
        ├── index.js
        ├── karma.conf.js
        └── specs/
            └── VueQuillEditor.spec.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .babelrc
================================================
{
  "presets": ["es2015", "stage-2"],
  "plugins": [
    "transform-es2015-destructuring",
    "transform-object-rest-spread"
  ],
  "comments": false,
  "env": {
    "test": {
      "plugins": [ "istanbul" ]
    }
  }
}


================================================
FILE: .eslintignore
================================================
config/*.js


================================================
FILE: .eslintrc.js
================================================

module.exports = {
  root: true,
  parser: 'babel-eslint',
  globals: {
    env: false
  },
  env: {
    browser: true,
    node: true
  },
  parserOptions: {
    sourceType: 'module'
  },
  //  https:// github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
  extends: [
    'standard'
  ],
  //  required to lint *.vue files
  plugins: [
    'html'
  ],
  //  add your custom rules here
  rules: {

    /*Possible Errors*/

    // 数组和对象键值对最后一个逗号,

    // never参数:不能带末尾的逗号,

    // always参数:必须带末尾的逗号,

    // always-multiline:多行模式必须带逗号,单行模式不能带逗号
    "comma-dangle": [0, "never"],

    // 禁止在条件表达式中使用赋值语句
    "no-cond-assign": 2,

    // 禁止使用console
    "no-console": 0,

    // 禁止在条件中使用常量表达式 if(true) if(1)
    "no-constant-condition": 2,

    // 禁止在正则表达式中使用控制符
    "no-control-regex": 2,

    // 禁止使用debugger语句
    "no-debugger": process.env.NODE_ENV === 'production' ? 2 : 0,

    // 函数参数禁止重名
    "no-dupe-args": 2,

    // 在创建对象字面量时不允许键重复
    "no-dupe-keys": 2,

    // 在switch语句中禁止重复的case
    "no-duplicate-case": 2,

    // 代码块的内容不能为空,禁止空代码块
    "no-empty": 2,

    // 正则表达式的内容不能为空,禁止使用不匹配任何字符串的正则表达式
    "no-empty-character-class": 2,

    // 禁止对catch语句中的异常进行赋值
    "no-ex-assign": 2,

    // 禁止不必要的bool转换
    "no-extra-boolean-cast": 2,

    // 禁止使用多余的圆括号
    "no-extra-parens": 2,

    // 禁止多余的冒号
    "no-extra-semi": 2,

    // 禁止重复的函数声明
    "no-func-assign": 2,

    // 禁止在块语句中声明变量或函数
    "no-inner-declarations": 2,

    // 禁止使用无效的正则语句
    "no-invalid-regexp": 2,

    // 禁止使用不合法或者不规则的空白符
    "no-irregular-whitespace": 2,

    // 在in操作符左边的操作项不能用! 例如这样写不对的:if ( !a in b) { // dosomething }
    "no-negated-in-lhs": 2,

    // 禁止把全局对象当函数调用,比如下面写法错误的:Math(), JSON()
    "no-obj-calls": 2,

    // 禁止在正则表达式字面量中使用多个空格 /foo bar/
    "no-regex-spaces": 2,

    // 禁止稀疏数组,清除多余的逗号申明  比如[1,,2]
    "no-sparse-arrays": 2,

    // 为了保证两行不相关的代码不会意外的被当做一行代码来解析
    "no-unexpected-multiline": 0,

    // 禁止有执行不到的代码
    "no-unreachable": 2,

    // 禁止和NaN作比较,推荐使用isNaN方法
    "use-isnan": 2,

    // 用来检测JSDoc是否完整和合法
    "valid-jsdoc": 2,

    // typeof操作符返回的结果会是 "undefined",  "object",  "boolean", "number", "string", 和  "function"之一。

    // 保证typeof 操作符返回的结果必须和上面六个字符串作比较
    "valid-typeof": 2,

    /*Best Practices*/

    // 在声明对象时getter和setter需成对出现
    "accessor-pairs": 2,

    // 数值方法的回调函数中强制写return语句
    "array-callback-return": 2,

    // 当在代码块中用var声明变量,并在代码块外使用时报错
    "block-scoped-var": 0,

    // 用来控制函数的复杂度,分支超过5时报错
    "complexity": [0, 5],

    // 不同分支的return语句不能返回不同的类型,要么一致要么都没有
    "consistent-return": 0,

    //  if else while for do后面的代码块是否需要{ }包围,参数:

    //  multi         只有块中有多行语句时才需要{ }包围

    //  multi-line    只有块中有多行语句时才需要{ }包围, 但是块中的执行语句只有一行时,块中的语句只能跟和if语句在同一行。

    //                 if (foo) foo++; else doSomething();

    //  multi-or-nest 只有块中有多行语句时才需要{ }包围, 如果块中的执行语句只有一行,执行语句可以另起一行也可以跟在if语句后面

    //  [2, "multi", "consistent"] 保持前后语句的{ }一致

    //  default: [2, "all"] 全都需要{ }包围
    "curly": 2,

    // 所有的switch语句都必须要有一个default分支
    "default-case": 2,

    //  在书写对象的属性或方法时,新的一行代码可以以. 开头,也可以以. 结束。

    //  强制统一object.key中 . 的位置,参数:

    //       property,'.'号应与属性在同一行

    //       object, '.' 号应与对象名在同一行
    "dot-location": [2, "property"],

    //  强制使用.号取属性

    //  参数: allowKeywords:true  使用保留字做属性名时,只能使用.方式取属性

    //                        false 使用保留字做属性名时, 只能使用[]方式取属性

    //                        e.g [2, {"allowKeywords": false}]

    //         allowPattern:  当属性名匹配提供的正则表达式时,允许使用[]方式取值,否则只能用.号取值

    //                        e.g [2, {"allowPattern": "^[a-z]+(_[a-z]+)+$"}]
    "dot-notation": [2, { "allowKeywords": true }],

    // 在进行比较时,必须使用全等=== 和完全不等!==
    "eqeqeq": [0, "allow-null"],

    // 在for-in 循环中要使用if语句
    "guard-for-in": 2,

    // 代码中禁止使用alert, confirm, and prompt
    "no-alert": 0,

    // 禁止使用arguments.caller和arguments.callee
    "no-caller": 2,

    // 禁止在case/default语句中使用lexical declarations,例如let, const, function and class

    // 因为在case/default中的声明,在整个switch语句中都能够访问到,如果需要声明变量,可以加大括号。
    "no-case-declarations": 2,

    // 不能使用看起来像除法的正则表达式

    // 用来消除/ (除号)操作符对程序员的迷惑,比如在正则表达式/=foo/中,我们并不能够确定第一个/是除号还是正则表达式,因此我们需要在等号前面加一个转移符/\=foo/
    "no-div-regex": 2,

    // 在if else语句中,如果else语句中只含有一个return语句,那么完全可以不使用else语句,直接return。
    "no-else-return": 0,

    // 不允许空函数
    "no-empty-function": 0,

    // 在结构赋值时,模式不能为空。在ECMAScript2015的结构赋值中,模式为空是不会报错的,只是这样的结构赋值没有任何效果,该条规则就保证了模式不能为空,也就保证了结构赋值的有效性。
    "no-empty-pattern": 2,

    // 保证了在和null比较时使用===和!==,而不能够使用==和!=
    "no-eq-null": 0,

    // 禁止使用eval函数
    "no-eval": 2,

    // 禁止扩展native对象,不能向native的对象上面添加属性
    "no-extend-native": 2,

    // 保证了调用bind方法的函数体内有this对象。规避了不必要的使用bind方法的情况。

    // 箭头函数中没有this对象,也就不能够使用bind()方法。该规则保证了在所有的箭头函数中使用bind方法将被视为错误。
    "no-extra-bind": 2,

    // 如果 loop中没有内嵌的loops或switches, loop标签是不必要的.
    "no-extra-label": 2,

    // 在case语句中尽量加break,避免不必要的fallthrough错误,消除从一个case到另一个case的非故意的「fall through」。

    // 如果没有添加break等终止语句或者没有添加注释语句,将会抛出错误
    "no-fallthrough": 2,

    // 在使用浮点小数时,不能够省略小数点前面的数或者后面的数,必须写。比如.2 2. 应该写2.2 2.0
    "no-floating-decimal": 2,

    // 禁止隐式转换,为了消除简写的类型转换
    "no-implicit-coercion": 2,

    // 禁止在全局作用域里声明变量或函数
    "no-implicit-globals": 2,

    // 在setTimeout(), setInterval() or execScript()中消除隐式eval的使用
    "no-implied-eval": 2,

    // 禁止无效的this,只能用在构造器,类,对象字面量
    "no-invalid-this": 0,

    // 禁止使用__iterator__属性
    "no-iterator": 2,

    // 禁止使用label语句,以避免无限循环
    "no-labels": [2, { "allowLoop": false, "allowSwitch": false }],

    // 禁止使用不必要的嵌套代码块
    "no-lone-blocks": 2,

    // 禁止在循环体中定义函数并且函数引用了外部变量

    // 在循环中定义了函数,但是函数内部没有引用外部变量,或者使用let定义的代码块变量,视为合法
    "no-loop-func": 2,

    // 禁止使用魔法数字,建议使用常量来代替
    "no-magic-numbers": 0,

    // 保证了在逻辑表达式、条件表达式、申明语句、数组元素、对象属性、sequences、函数参数中不使用超过一个的空白符。
    "no-multi-spaces": 0,

    // 该规则保证了字符串不分行书写。
    "no-multi-str": 2,

    // 该规则保证了不重写原生对象。
    "no-native-reassign": 2,

    // 在使用new来调用构造函数后,必须把生成的实例赋值给一个变量
    "no-new": 2,

    // 禁止使用new Function(); 语句。
    "no-new-func": 2,

    // 禁止使用new创建String,Number, and Boolean实例
    "no-new-wrappers": 2,

    // 禁止使用八进制数字
    "no-octal": 2,

    // 禁止使用八进制转义序列,比如 var foo = "Copyright \251";
    "no-octal-escape": 2,

    // 禁止对函数的参数重新进行无意义的赋值
    "no-param-reassign": 0,

    // 禁止使用__proto__属性
    "no-proto": 2,

    // 避免重复声明一个变量
    "no-redeclare": [2, { "builtinGlobals": true }],

    // 不要在return语句中使用赋值语句
    "no-return-assign": [2, "always"],

    // 禁止代码中使用类似javascript:void(0)的javascript: urls.
    "no-script-url": 2,

    // 禁止给自身赋值
    "no-self-assign": 2,

    // 禁止和自身作比较
    "no-self-compare": 2,

    // 禁止可能导致结果不明确的逗号操作符
    "no-sequences": 0,

    // 通过throw语句抛出的对象必须是Error对象本身或者通过Error对象定义的对象。有些情况除外,见官网
    "no-throw-literal": 2,

    // 禁止使用不被修改的循环条件
    "no-unmodified-loop-condition": 2,

    // 禁止在代码中出现没有被使用到的表达式或值
    "no-unused-expressions": [2, { "allowShortCircuit": true, "allowTernary": true }],

    // 禁止在代码中出现没有被使用到的标签
    "no-unused-labels": 2,

    // 避免使用没有意义的call() 和 apply()
    "no-useless-call": 2,

    // 避免使用不必要的字符串拼接
    "no-useless-concat": 2,

    // 不要使用void操作符
    "no-void": 2,

    // 生产代码中不能出现warning-comments包含的注释
    "no-warning-comments": [2, { "terms": ["todo", "fixme", "any other term"], "location": "anywhere" }],

    // 不要使用with语句
    "no-with": 2,

    // 在使用parseInt()方法时,必须要传递第二个参数来帮助解析。
    "radix": 2,

    // 在通过var声明变量时,应该放在代码所在作用域的顶部
    "vars-on-top": 2,

    // 立即执行函数需要通过圆括号包围
    "wrap-iife": 2,

    // yoda条件语句就是对象字面量应该写在比较操作符的左边,而变量应该写在比较操作符的右边

    // 默认的规则要求,变量写在左边而字面量写在右边
    "yoda": 2,


    /*Strict Mode*/

    // 使用严格模式
    "strict": 2,

    /*Variables*/

    // 变量声明时必须赋初值
    "init-declarations": 0,

    // In IE 8 and earlier,禁止catch子句参数与外部作用域变量同名
    "no-catch-shadow": 2,

    // 禁止使用delete删除var声明的变量
    "no-delete-var": 0,

    // 防止label和声明的变量重名
    "no-label-var": 2,

    // 禁止使用某些全局变量
    "no-restricted-globals": [2, "event"],

    // 禁止声明外部作用域中已定义的变量
    "no-shadow": 0,

    // 声明变量时禁止覆盖JavaScript中的一些保留关键字,比如NaN、Infinity、undefined、eval、arguments等。
    "no-shadow-restricted-names": 2,

    // 禁止使用未被定义的变量,除非已在配置文件的global中进行了说明。
    "no-undef": 2,

    // 禁止初始化变量为undefined
    "no-undef-init": 2,

    // 禁止把undefined作为变量名
    "no-undefined": 0,

    // 不允许定义的变量在后面的代码中没有被使用到
    "no-unused-vars": 0,

    // 所有的变量都应该先定义后使用
    "no-use-before-define": 0,


    /*Node.js and CommonJS*/

    // 强制回调后return,避免多次调用回调
    "callback-return": 0,

    // 强制require()出现在模块作用域的顶部
    "global-require": 0,

    //  如果函数有err入参(err或者error),在函数体内必须进行处理
    "handle-callback-err": [0, "^(err|error)$"],

    // 声明时不能混用声明类型
    "no-mixed-requires": 0,

    // 禁止把require方法和new操作符一起使用。
    "no-new-require": 0,

    // 不能使用__dirname或__filename做路径拼接
    "no-path-concat": 0,

    // 禁止使用process.env
    "no-process-env": 0,

    // 禁止使用process.exit()
    "no-process-exit": 0,

    // 禁用使用指定模块,使用了就会报错
    "no-restricted-modules": [0, "fs"],

    // 禁止使用同步方法,建议使用异步方法
    "no-sync": 0,

    /*Stylistic Issues*/

    //  用数组字面量定义数组时数组元素前后是否加空格,

    //  never参数: 数组元素前后不能带空格,

    //  always参数:数组元素前后必须留空格
    "array-bracket-spacing": [0, "never"],

    // 在单行代码块中,代码块前后是否需要留空格

    //  always参数:默认,前后必须留空格

    //  never参数: 前后不能带空格
    "block-spacing": [2, "always"],

    // 大括号的样式,比如下面的大括号语法采用『1tbs』,允许单行样式
    "brace-style": [2, "1tbs", { "allowSingleLine": true }],

    // 强制使用驼峰命名
    "camelcase": 0,

    // 规定了逗号前后的空白,默认配置规定逗号前面没有空白,而逗号后面需要留空白
    "comma-spacing": [2, { "before": false, "after": true }],

    // 规定了逗号放的位置,默认配置逗号应该放在行末,如果设置为first,逗号就应放在行首
    "comma-style": [2, "last"],

    // 是否在对象的动态属性(computed properties: ES6引入)中添加空白,默认配置不添加空白
    "computed-property-spacing": [2, "never"],

    // 统一this的别名(this赋值的变量名)保证整个应用程序代码的统一。

    // 如果一个变量被指定为this对象的别名,那么这个变量就不能够用来赋其他值,只能够用来保存this对象。

    // 如果this对象明确被赋值给了一个变量,那么这个变量应该是配置中指定的那个变量名。
    "consistent-this": [0, "self"],

    // 该规则规定文件最后强制换行,仅需留一空行
    "eol-last": 2,

    // 要求给函数表达式命名,便于debug
    "func-names": 0,

    // 在JavaScript中有两种方式定义函数:函数声明和函数表达式。

    // 函数声明就是把function关键词写在最前面,后面跟一个函数名。我们可以在函数申明代码前调用函数

    // 函数表达式是通过var等声明变量的关键字开头,然后跟函数名,再后面是function本身。在使用函数表达式定义函数前调用函数会报错

    //  统一定义函数是所采用的方式,参数:

    //     declaration: 强制使用方法声明的方式,function f(){} e.g [2, "declaration"]

    //     expression:强制使用方法表达式的方式,默认方式,var f = function() {}  e.g [2, "expression"]

    //     allowArrowFunctions: declaration风格中允许箭头函数。 e.g [2, "declaration", {"allowArrowFunctions":true}]
    "func-style": [2, "expression"],

    // 规定了标识符命名的黑名单
    "id-blacklist": [0, "data", "err", "e", "cb", "callback"],

    // 规定标识符的长度,默认配置标识符最少两个字符
    "id-length": [2, { "min": 1 }],

    // 命名检测,标识符命名需和配置中的正则表达式匹配,但是该规则对函数调用无效。
    "id-match": [0, "^[a-z]+([A-Z][a-z]+)*$", { "properties": false }],

    //  统一代码缩进方式,默认值是4 spaces.
    "indent": 0,

    // 规定了在JSX中的属性值是使用单引号还是双引号,默认使用双引号
    "jsx-quotes": [2, "prefer-double"],

    // 该规则规定了在对象字面量语法中key和value之间的空白,冒号前不要留空格,冒号后面需留一个空格
    "key-spacing": [2, { "beforeColon": false, "afterColon": true }],

    //  规定了keyword前后是否需要留一个空格
    "keyword-spacing": [0, { "before": true, "after": true, "overrides": {} }],

    // 统一换行符,"\n" unix(for LF) and "\r\n" for windows(CRLF),默认unix
    "linebreak-style": 0,

    // 规定注释和代码块之间是否留空行
    "lines-around-comment": 0,

    // 规定代码最多可以嵌套多少层
    "max-depth": [2, 4],

    // 规定了代码单行的最大长度
    "max-len": [0, 80, 4],

    // 规定了回调的最大嵌套层数
    "max-nested-callbacks": [2, 10],

    // 规定了函数参数的最大个数
    "max-params": [0, 3],

    // 规定了函数中代码不能够超过多少行
    "max-statements": [0, 10],

    // 使用构造函数(new)时首字母需大写,首字母大写的函数需用new操作符
    "new-cap": 2,

    // 使用构造函数(new)时必须圆括号不能省略
    "new-parens": 0,

    // 规定了变量声明后是否需要空行
    "newline-after-var": 0,

    // 规定了return语句前是否是否需要空行
    "newline-before-return": 0,

    // 规定了方法链式调用时是否需换行
    "newline-per-chained-call": 0,

    // 禁止使用Array构造函数
    "no-array-constructor": 0,

    // 禁止使用位操作符
    "no-bitwise": 0,

    // 禁止使用continue
    "no-continue": 0,

    // 禁止使用行内注释
    "no-inline-comments": 0,

    // 禁止在if-else控制语句中,else代码块中仅包含一个if语句
    "no-lonely-if": 0,

    // 禁止混用tab和空格
    "no-mixed-spaces-and-tabs": 2,

    // 不要留超过规定数目的空白行
    "no-multiple-empty-lines": [2, { "max": 3 }],

    // 在if语句中使用了否定表达式,同时else语句又不为空,那么这样的if-else语句将被视为不合法,为什么不将其反过来这样代码更容易理解,该规则同样适用于三元操作符
    "no-negated-condition": 0,

    // 三元操作符禁止嵌套
    "no-nested-ternary": 0,

    // 禁止使用new Object()来构造对象
    "no-new-object": 0,

    // 禁止使用++,--
    "no-plusplus": 0,

    // 禁止使用某些特定的JavaScript语法,例如FunctionDeclaration 和 WithStatement
    "no-restricted-syntax": [0, "FunctionExpression", "WithStatement"],

    // 函数调用时,函数名和圆括号之间不能有空格
    "no-spaced-func": 2,

    // 禁止使用三元操作符
    "no-ternary": 0,

    // 禁止行末加空格
    "no-trailing-spaces": 0,

    // 禁止在标识符前后使用下划线
    "no-underscore-dangle": 0,

    // 禁止使用没有必要的三元操作符,因为用有些三元操作符可以使用其他语句替换
    "no-unneeded-ternary": [0, { "defaultAssignment": false }],

    // 禁止属性操作符.的前后和[之前有空格
    "no-whitespace-before-property": 2,

    // 规定对象字面量中大括号内是否允许加空格,也适用于ES6中的结构赋值和模块import和export
    "object-curly-spacing": [0, "always"],

    // 规定了在每个函数中声明变量是否只使用一次var,该规则同样适用于let和const
    "one-var": [2, { "initialized": "never" }],

    // 规定了使用赋值操作符的简写形式
    "operator-assignment": [2, "always"],

    // 在换行时操作符应该放在行首还是行尾。还可对某些操作符进行重写。
    "operator-linebreak": [2, "after", { "overrides": { "?": "before", ":": "before" } }],

    // 在代码块中,代码块的开始和结尾是否应该留一个空行
    "padded-blocks": 0,

    // 对象的属性名是否强制加双引号
    "quote-props": [0, "always"],

    // 在JavaScript中有三种方式定义字符串,双引号、单引号、反义符(ECMAScript2015)。规定了字符串定义的方式
    "quotes": [0, "single", "avoid-escape"],

    // 注释格式要求JSDoc格式
    "require-jsdoc": [0, {

        "require": {

            "FunctionDeclaration": true,

            "MethodDefinition": false,

            "ClassDeclaration": false

        }

    }],

    // JavaScript不要求在每行末尾加上分号,这是因为JavaScript引擎会决定是否需要在行末加上分号,然后自动帮我们在行末加上分号,这一特性被成为ASI(automatic semicolon insertion),也是JavaScript语言最富争议的特性之一

    // 尽管ASI允许我们使用更加自由的代码风格,但是它也可能使得你的代码并不是按你期许的方式运行

    // 两个可选参数,always 和never

    // 默认配置always,要求在行末加上分号。
    "semi": [0, "always"],

    // 该规则用来规定分号前后是否加空格,默认配置如下
    "semi-spacing": [2, { "before": false, "after": true }],

    // 要求对同一个模块里的import声明按字母排序
    "sort-imports": 0,

    // 规定在同一个变量声明代码块中,要对变量的声明按字母排序
    "sort-vars": 2,

    // 规定了在代码块前是否需要加空格
    "space-before-blocks": [2, "always"],

    // 函数定义时,function关键字后面的小括号前是否需要加空格
    "space-before-function-paren": [0, "always"],

    // 规定圆括号内部的空格。规定是否需要在(右边,或者)左边加空格。
    "space-in-parens": [2, "never"],

    // 中綴操作符左右是否添加空格
    "space-infix-ops": 2,

    // 规定在一元操作符前后是否需要加空格,单词类操作符需要加,而非单词类操作符不用加

    // words - applies to unary word operators such as: new, delete, typeof, void, yield

    // nonwords - applies to unary operators such as: -, +, --, ++, !, !!
    "space-unary-ops": [2, { "words": true, "nonwords": false }],

    // 规定是否需要在代码注释起始符//  or /*后面至少紧跟一个空格
    "spaced-comment": [2, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!", ","] }],

    // 要求在正则表达式的双斜杠外面加一个圆括号,来消除歧义
    "wrap-regex": 0,


    /*ECMAScript 6*/

    // 箭头函数中,如果函数体里只有一句代码时可以省略大括号

    // 规定是否可以省略大括号
    "arrow-body-style": 0,

    // 箭头函数中,只有一个参数时可以省略圆括号

    // 规定了参数是否需要圆括号包围
    "arrow-parens": [0, "always"],

    // 规定了箭头函数的箭头前后是否加空格
    "arrow-spacing": [2, { "before": true, "after": true }],

    // 保证constructor函数中super()应正确出现,比如在继承的classes中(派生类)必须使用super,否则(非派生类)不要使用super。
    "constructor-super": 2,

    // 规定generator函数中星号前后的空白
    "generator-star-spacing": [2, { "before": true, "after": true }],

    // 禁止覆盖class命名,也就是说变量名不要和class名重名
    "no-class-assign": 2,

    // 箭头函数的箭头和比较操作符 (>, <, <=, and >=)很相似,该规则要求在和比较操作符容易发生混淆时禁止使用箭头函数语法
    "no-confusing-arrow": 2,

    // 禁止修改const声明的变量
    "no-const-assign": 2,

    // class中的成员不允许有相同的名字
    "no-dupe-class-members": 2,

    // 禁止在Symbol对象前使用new操作符
    "no-new-symbol": 2,

    // 该规则可以定义不允许在应用中导入的模块
    "no-restricted-imports": [2,

        "assert", "buffer", "child_process", "cluster", "crypto", "dgram", "dns", "domain", "events", "freelist", "fs", "http", "https", "module", "net", "os", "path", "punycode", "querystring", "readline", "repl", "smalloc", "stream", "string_decoder", "sys", "timers", "tls", "tracing", "tty", "url", "util", "vm", "zlib"

    ],

    // 在构造函数中,禁止在super()调用前使用this/super对象
    "no-this-before-super": 2,

    // ES2015提供了默认的空构造函数,禁止使用不必要的空构造函数
    "no-useless-constructor": 2,

    // 禁用var,用let和const代替var
    "no-var": 2,

    // ES6中提供了定义对象字面量的方法和属性的简写形式。强制要求在对象字面量中使用方法和属性的简写形式
    "object-shorthand": 0,

    // 函数作为函数的参数传入时,传入的函数需要是箭头函数

    // 箭头函数中的this对象直接绑定到了其外面包围的函数的this对象。
    "prefer-arrow-callback": 0,

    // 如果一个变量声明后不再被修改,那么应使用const来声明该变量
    "prefer-const": 1,

    // 推荐使用Reflect上的方法替代以前老方法
    "prefer-reflect": 0,

    //  在ES2015(ES6)中推荐使用剩余参数(...rest)代替arguments变量
    "prefer-rest-params": 0,

    // 在ES2015(ES6)中推荐使用扩展符替代apply()方法
    "prefer-spread": 2,

    // 在ES2015(ES6)中推荐使用模板代替以前的字符串拼接
    "prefer-template ": 0,

    // 生成器函数中必须有yield关键字,如果没有会报错。
    "require-yield": 2,

    // 模板字符串中使用${ 和 } 包含的表达式前后是否需要留空格,默认规则禁止花括号内有空格
    "template-curly-spacing": [2, "never"],

    // yield*表达式中的*号前后是否留空格,默认after,比如yield* other()
    "yield-star-spacing": [2, "after"]

  }
}


================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log
selenium-debug.log
npm-debug.log*

# System
.DS_Store

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Project
.editorconfig

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Runtime data
pids
*.pid
*.seed

# Package
package-lock.json

# Test
test/unit/coverage
test/e2e/reports

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
node_modules/
jspm_packages


================================================
FILE: .npmignore
================================================
.github
.DS_Store
.babelrc
.editorconfig
.eslintrc.js
.eslintignore
.gitignore
.travis.yml

test/
test/unit/coverage
test/e2e/reports

gh-pages/
static/
build/
config/
node_modules
node_modules/
npm-debug.log
examples

index.html
config.js
bower.json
package-lock.json
selenium-debug.log


================================================
FILE: .travis.yml
================================================
language: node_js
node_js:
  - "7"
after_success:
  - codeclimate-test-reporter < ./test/unit/coverage/lcov.info

================================================
FILE: CHANGELOG.md
================================================

## CHANGELOG

### v3.0.6

PR194, Prevents auto-focus when using within components with dynamically set content.

### v3.0.5

update umd module name and rebuild

### v3.0.4

1. fix object assign in spa

### v3.0.3

1. fix import es module bug
2. add test script

### v3.0.2

1. assign options to ssr.js

### v3.0.1

1. add lib object-assign
2. update the options assign logic

### v3.0.0

#### use
1. require styles [#111](https://github.com/surmon-china/vue-quill-editor/issues/111)
2. add global default options [#110](https://github.com/surmon-china/vue-quill-editor/issues/110)
3. update `{ editor, text, html }` to `{ quill, text, html }`

#### project
- add brower support
- add test scripts
- update babel and webpack configs


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2020 Surmon

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
# vue-quill-editor

[![vue](https://img.shields.io/badge/MADE%20WITH-VUE-42a97a?style=for-the-badge&labelColor=35495d)](https://vuejs.org)
&nbsp;
[![GitHub stars](https://img.shields.io/github/stars/surmon-china/vue-quill-editor.svg?style=for-the-badge)](https://github.com/surmon-china/vue-quill-editor/stargazers)
&nbsp;
[![GitHub issues](https://img.shields.io/github/issues/surmon-china/vue-quill-editor.svg?style=for-the-badge)](https://github.com/surmon-china/vue-quill-editor/issues)
&nbsp;
[![npm](https://img.shields.io/npm/v/vue-quill-editor?color=c7343a&label=npm&style=for-the-badge)](https://www.npmjs.com/package/vue-quill-editor)
&nbsp;
[![license](https://img.shields.io/github/license/mashape/apistatus.svg?style=for-the-badge)](/LICENSE)

**[Quill](https://github.com/quilljs/quill) editor** component for **Vue(2).**

---

### DEPRECATED ‼️

Unfortunately, since the [Quill](https://github.com/quilljs/quill) project has effectively stopped being maintained, `vue-quill-editor` will be **DEPRECATED** and will no longer support Vue3; if you're looking for a rich text editor, I recommend migrating to [**tiptap**](https://tiptap.dev/installation/vue3), which is a much better alternative.

If Quill ever updates v2.0, this project will probably continue to be updated as well.
I encourage folks to fork this repository and, if a fork gets popular, I will link to it in this README.

The stalled Quill project can be found in these issues:

- [Is quill dead?](https://github.com/quilljs/quill/issues/3359)
- [Project still active?](https://github.com/quilljs/quill/issues/3112)
- [Switching editor lib as QuillJS is dead](https://github.com/EvitanRelta/markgh/issues/3)
- [What's the status of this project? It's been over 2 years since 1.3.7 release.](https://github.com/quilljs/quill/issues/3521)

---

### Example

- [Component examples](https://surmon-china.github.io/vue-quill-editor)
- [CDN examples](https://jsfiddle.net/surmon/fpojgkmy/)


### Documentation

- [Quill Guides](https://quilljs.com/guides)
- [Quill APIs](https://quilljs.com/docs/api/)
- [Quill Documentation](https://quilljs.com/docs)

### Install

**NPM**

``` bash
npm install vue-quill-editor --save
```
```bash
yarn add vue-quill-editor
```

**CDN**

``` html
<link rel="stylesheet" href="path/to/quill.core.css"/>
<link rel="stylesheet" href="path/to/quill.snow.css"/>
<link rel="stylesheet" href="path/to/quill.bubble.css"/>
<script type="text/javascript" src="path/to/quill.js"></script>
<script type="text/javascript" src="path/to/vue.min.js"></script>
<script type="text/javascript" src="path/to/dist/vue-quill-editor.js"></script>
<script type="text/javascript">
  Vue.use(window.VueQuillEditor)
</script>
```

### Usage

**Global component**

``` javascript
import Vue from 'vue'
import VueQuillEditor from 'vue-quill-editor'

import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme
import 'quill/dist/quill.bubble.css' // for bubble theme

Vue.use(VueQuillEditor, /* { default global options } */)
```

#### Local component

```javascript
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

import { quillEditor } from 'vue-quill-editor'

export default {
  components: {
    quillEditor
  }
}
```

**SSR component**

See [Nuxt.js example code](https://github.com/surmon-china/surmon-china.github.io/tree/source/legacies/vue-quill-editor/nuxt).

### Register Quill module

```javascript
import Quill from 'quill'
import yourQuillModule from '../yourModulePath/yourQuillModule.js'
Quill.register('modules/yourQuillModule', yourQuillModule)

// Vue app...
```

### Component

``` vue
<template>
  <!-- Two-way Data-Binding -->
  <quill-editor
    ref="myQuillEditor"
    v-model="content"
    :options="editorOption"
    @blur="onEditorBlur($event)"
    @focus="onEditorFocus($event)"
    @ready="onEditorReady($event)"
  />

  <!-- Or manually control the data synchronization -->
  <quill-editor
    :content="content"
    :options="editorOption"
    @change="onEditorChange($event)"
  />
</template>

<script>
  // You can also register Quill modules in the component
  import Quill from 'quill'
  import someModule from '../yourModulePath/someQuillModule.js'
  Quill.register('modules/someModule', someModule)
  
  export default {
    data () {
      return {
        content: '<h2>I am Example</h2>',
        editorOption: {
          // Some Quill options...
        }
      }
    },
    methods: {
      onEditorBlur(quill) {
        console.log('editor blur!', quill)
      },
      onEditorFocus(quill) {
        console.log('editor focus!', quill)
      },
      onEditorReady(quill) {
        console.log('editor ready!', quill)
      },
      onEditorChange({ quill, html, text }) {
        console.log('editor change!', quill, html, text)
        this.content = html
      }
    },
    computed: {
      editor() {
        return this.$refs.myQuillEditor.quill
      }
    },
    mounted() {
      console.log('this is current quill instance object', this.editor)
    }
  }
</script>
```

### Issues
- [Add attributes from toolbar options](https://github.com/quilljs/quill/issues/1084)
- [Option to insert an image from a URL](https://github.com/quilljs/quill/issues/893)
- [How vue-quill-editor combine with the syntax highlighter module of highlight.js](https://github.com/surmon-china/vue-quill-editor/issues/39)
- [配合 element-ui 实现上传图片/视频到七牛 demo](https://github.com/surmon-china/vue-quill-editor/issues/102)
- [How to fix “Can’t find variable: Quill”, “Quill is undefined”, “window.Quill is undefined” errors when trying to use Quill modules that use Webpack in Nuxt/SSR](https://github.com/surmon-china/vue-quill-editor/issues/171#issuecomment-370253411)


### Quill Modules
- [quill-image-extend-module](https://github.com/NextBoy/quill-image-extend-module)
- [quill-image-resize-module](https://github.com/kensnyder/quill-image-resize-module)
- [quill-image-drop-module](https://github.com/kensnyder/quill-image-drop-module)
- [quilljs-table](https://github.com/dost/quilljs-table)
- [more modules...](https://github.com/search?o=desc&q=quill+module&s=stars&type=Repositories&utf8=%E2%9C%93)


### Changelog

Detailed changes for each release are documented in the [release notes](/CHANGELOG.md).

### License

Licensed under the [MIT](/LICENSE) License.


================================================
FILE: bower.json
================================================
{
  "name": "vue-quill-editor",
  "description": "Quill editor component for Vue",
  "main": "./dist/vue-quill-editor.js",
  "author": {
    "name": "Surmon",
    "email": "surmon@foxmail.com",
    "url": "http://surmon.me"
  },
  "license": "MIT",
  "keywords": [
    "vue-quill-editor",
    "vue quill",
    "vue text editor",
    "vue rich text editor",
    "vue web editor",
    "vue editor"
  ],
  "homepage": "https://surmon-china.github.io/vue-quill-editor",
  "moduleType": [],
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "test",
    "tests"
  ]
}


================================================
FILE: config/base.conf.js
================================================
const path = require('path')
const webpack = require('webpack')
const resolve = dir => path.join(__dirname, '..', dir)

const env = process.env.NODE_ENV === 'testing'
  ? { NODE_ENV: '"testing"' }
  : { NODE_ENV: '"production"' }

module.exports = {
  module: {
    rules: [
      {
        test: /\.(js|vue)$/,
        loader: 'eslint-loader',
        enforce: 'pre',
        include: [resolve('src'), resolve('test')],
        options: {
          formatter: require('eslint-friendly-formatter')
        }
      },
      {
        test: /\.vue$/,
        loader: 'vue-loader',
        options: {}
      },
      {
        test: /\.js$/,
        loader: 'babel-loader',
        include: [resolve('src'), resolve('test')]
      }
    ]
  },
  plugins: [
    new webpack.DefinePlugin({
      'process.env': env
    }),
    new webpack.optimize.UglifyJsPlugin({
      compress: { warnings: false }
    })
  ]
}


================================================
FILE: config/build.conf.js
================================================
const path = require('path')
const merge = require('webpack-merge')
const baseConfig = require('./base.conf')
const resolve = dir => path.join(__dirname, '..', dir)

module.exports = merge(baseConfig, {
  entry: {
    'vue-quill-editor': './src/index.js'
  },
  externals: {
    quill: {
        root: 'Quill',
        commonjs: 'quill',
        commonjs2: 'quill',
        amd: 'quill'
    },
    'object-assign': 'object-assign'
  },
  output: {
    path: path.resolve(__dirname, '../dist'),
    publicPath: '/',
    filename: '[name].js',
    library: 'VueQuillEditor',
    libraryTarget: 'umd'
  },
  devtool: '#source-map',
  resolve: {
    extensions: ['.js', '.vue', '.json'],
    modules: [
      resolve('src'),
      resolve('node_modules')
    ],
    alias: {
      'quill': 'quill/dist/quill.js',
    }
  }
})


================================================
FILE: config/test.conf.js
================================================
// This is the webpack config used for unit tests.
const merge = require('webpack-merge')
const baseConfig = require('./base.conf')

module.exports = merge(baseConfig, {
  // use inline sourcemap for karma-sourcemap-loader
  devtool: '#inline-source-map'
})



================================================
FILE: dist/vue-quill-editor.js
================================================
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("quill")):"function"==typeof define&&define.amd?define(["quill"],e):"object"==typeof exports?exports.VueQuillEditor=e(require("quill")):t.VueQuillEditor=e(t.Quill)}(this,function(t){return function(t){function e(i){if(n[i])return n[i].exports;var l=n[i]={i:i,l:!1,exports:{}};return t[i].call(l.exports,l,l.exports,e),l.l=!0,l.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=2)}([function(e,n){e.exports=t},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(4),l=n.n(i),o=n(6),r=n(5),u=r(l.a,o.a,!1,null,null,null);e.default=u.exports},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.install=e.quillEditor=e.Quill=void 0;var l=n(0),o=i(l),r=n(1),u=i(r),s=window.Quill||o.default,a=function(t,e){e&&(u.default.props.globalOptions.default=function(){return e}),t.component(u.default.name,u.default)},c={Quill:s,quillEditor:u.default,install:a};e.default=c,e.Quill=s,e.quillEditor=u.default,e.install=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={theme:"snow",boundary:document.body,modules:{toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"],["link","image","video"]]},placeholder:"Insert text here ...",readOnly:!1}},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var l=n(0),o=i(l),r=n(3),u=i(r),s=window.Quill||o.default;"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),i=1;i<arguments.length;i++){var l=arguments[i];if(null!=l)for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(n[o]=l[o])}return n},writable:!0,configurable:!0}),e.default={name:"quill-editor",data:function(){return{_options:{},_content:"",defaultOptions:u.default}},props:{content:String,value:String,disabled:{type:Boolean,default:!1},options:{type:Object,required:!1,default:function(){return{}}},globalOptions:{type:Object,required:!1,default:function(){return{}}}},mounted:function(){this.initialize()},beforeDestroy:function(){this.quill=null,delete this.quill},methods:{initialize:function(){var t=this;this.$el&&(this._options=Object.assign({},this.defaultOptions,this.globalOptions,this.options),this.quill=new s(this.$refs.editor,this._options),this.quill.enable(!1),(this.value||this.content)&&this.quill.pasteHTML(this.value||this.content),this.disabled||this.quill.enable(!0),this.quill.on("selection-change",function(e){e?t.$emit("focus",t.quill):t.$emit("blur",t.quill)}),this.quill.on("text-change",function(e,n,i){var l=t.$refs.editor.children[0].innerHTML,o=t.quill,r=t.quill.getText();"<p><br></p>"===l&&(l=""),t._content=l,t.$emit("input",t._content),t.$emit("change",{html:l,text:r,quill:o})}),this.$emit("ready",this.quill))}},watch:{content:function(t,e){this.quill&&(t&&t!==this._content?(this._content=t,this.quill.pasteHTML(t)):t||this.quill.setText(""))},value:function(t,e){this.quill&&(t&&t!==this._content?(this._content=t,this.quill.pasteHTML(t)):t||this.quill.setText(""))},disabled:function(t,e){this.quill&&this.quill.enable(!t)}}}},function(t,e){t.exports=function(t,e,n,i,l,o){var r,u=t=t||{},s=typeof t.default;"object"!==s&&"function"!==s||(r=t,u=t.default);var a="function"==typeof u?u.options:u;e&&(a.render=e.render,a.staticRenderFns=e.staticRenderFns,a._compiled=!0),n&&(a.functional=!0),l&&(a._scopeId=l);var c;if(o?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},a._ssrRegister=c):i&&(c=i),c){var d=a.functional,f=d?a.render:a.beforeCreate;d?(a._injectStyles=c,a.render=function(t,e){return c.call(e),f(t,e)}):a.beforeCreate=f?[].concat(f,c):[c]}return{esModule:r,exports:u,options:a}}},function(t,e,n){"use strict";var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"quill-editor"},[t._t("toolbar"),t._v(" "),n("div",{ref:"editor"})],2)},l=[],o={render:i,staticRenderFns:l};e.a=o}])});

================================================
FILE: package.json
================================================
{
  "name": "vue-quill-editor",
  "description": "Quill editor component for Vue",
  "version": "3.0.6",
  "license": "MIT",
  "author": "Surmon",
  "keywords": [
    "vue-quill-editor",
    "vue quill",
    "vue text editor",
    "vue rich text editor",
    "vue web editor",
    "vue editor"
  ],
  "homepage": "https://github.surmon.me/vue-quill-editor",
  "repository": {
    "type": "git",
    "url": "https://github.com/surmon-china/vue-quill-editor.git"
  },
  "files": [
    "CHANGELOG.md",
    "dist"
  ],
  "main": "dist/vue-quill-editor.js",
  "unpkg": "dist/vue-quill-editor.js",
  "jsnext:main": "dist/vue-quill-editor.js",
  "jspm": {
    "main": "dist/vue-quill-editor.js",
    "registry": "npm",
    "format": "esm"
  },
  "scripts": {
    "build": "cross-env NODE_ENV=production webpack --config config/build.conf.js",
    "unit": "cross-env BABEL_ENV=test NODE_ENV=testing karma start test/unit/karma.conf.js --watch",
    "test": "cross-env BABEL_ENV=test NODE_ENV=testing karma start test/unit/karma.conf.js --single-run",
    "lint": "eslint --ext .js,.vue src test/unit/specs",
    "finish": "npm run lint && npm test && npm run build",
    "publish": "git push && git push --tags && npm publish"
  },
  "dependencies": {
    "object-assign": "^4.1.1",
    "quill": "^1.3.7"
  },
  "devDependencies": {
    "autoprefixer": "^6.7.2",
    "babel-cli": "^6.23.0",
    "babel-core": "^6.24.1",
    "babel-eslint": "^7.1.1",
    "babel-helper-vue-jsx-merge-props": "^2.0.2",
    "babel-loader": "^6.2.10",
    "babel-plugin-istanbul": "^3.1.2",
    "babel-plugin-syntax-jsx": "^6.13.0",
    "babel-plugin-transform-es2015-destructuring": "^6.23.0",
    "babel-plugin-transform-export-extensions": "^6.8.0",
    "babel-plugin-transform-object-rest-spread": "^6.23.0",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-stage-2": "^6.22.0",
    "babel-register": "^6.0.0",
    "chai": "^3.5.0",
    "chalk": "^1.1.3",
    "connect-history-api-fallback": "^1.1.0",
    "copy-webpack-plugin": "^4.0.0",
    "cross-env": "^5.0.0",
    "cross-spawn": "^5.1.0",
    "css-loader": "^0.25.0",
    "eslint": "^3.14.1",
    "eslint-config-standard": "^6.1.0",
    "eslint-friendly-formatter": "^2.0.5",
    "eslint-loader": "^1.6.1",
    "eslint-plugin-html": "^2.0.0",
    "eslint-plugin-promise": "^3.4.0",
    "eslint-plugin-standard": "^2.0.1",
    "eventsource-polyfill": "^0.9.6",
    "express": "^4.13.3",
    "extract-text-webpack-plugin": "^2.0.0-rc.3",
    "file-loader": "^0.10.0",
    "friendly-errors-webpack-plugin": "^1.1.3",
    "function-bind": "^1.1.0",
    "html-loader": "^0.4.4",
    "html-webpack-plugin": "^2.28.0",
    "http-proxy-middleware": "^0.17.3",
    "inject-loader": "^2.0.1",
    "json-loader": "^0.5.4",
    "jstransformer-markdown-it": "^2.0.0",
    "karma": "^1.4.1",
    "karma-coverage": "^1.1.1",
    "karma-mocha": "^1.3.0",
    "karma-phantomjs-launcher": "^1.0.2",
    "karma-sinon-chai": "^1.2.4",
    "karma-sourcemap-loader": "^0.3.7",
    "karma-spec-reporter": "0.0.26",
    "karma-webpack": "^2.0.2",
    "lolex": "^1.5.2",
    "mocha": "^3.2.0",
    "opn": "^4.0.2",
    "optimize-css-assets-webpack-plugin": "^1.3.0",
    "ora": "^0.3.0",
    "phantomjs-prebuilt": "^2.1.3",
    "raw-loader": "^0.5.1",
    "semver": "^5.3.0",
    "shelljs": "^0.7.4",
    "sinon": "^2.1.0",
    "sinon-chai": "^2.8.0",
    "uglify-js": "^3.0.15",
    "url-loader": "^0.5.7",
    "vue": "^2.5.0",
    "vue-hot-reload-api": "^1.2.0",
    "vue-html-loader": "^1.0.0",
    "vue-loader": "^13.3.0",
    "vue-template-compiler": "^2.5.2",
    "vue-template-es2015-compiler": "^1.6.0",
    "webpack": "^2.2.1",
    "webpack-bundle-analyzer": "^2.2.1",
    "webpack-dev-middleware": "^1.10.0",
    "webpack-hot-middleware": "^2.16.1",
    "webpack-merge": "^2.6.1",
    "node-sass": "^4.7.2",
    "sass-loader": "^6.0.6",
    "highlight.js": "^9.12.0"
  }
}


================================================
FILE: src/editor.vue
================================================
<template>
  <div class="quill-editor">
    <slot name="toolbar"></slot>
    <div ref="editor"></div>
  </div>
</template>

<script>
  // require sources
  import _Quill from 'quill'

  const Quill = window.Quill || _Quill
  const defaultOptions = {
    theme: 'snow',
    boundary: document.body,
    modules: {
      toolbar: [
        ['bold', 'italic', 'underline', 'strike'],
        ['blockquote', 'code-block'],
        [{ 'header': 1 }, { 'header': 2 }],
        [{ 'list': 'ordered' }, { 'list': 'bullet' }],
        [{ 'script': 'sub' }, { 'script': 'super' }],
        [{ 'indent': '-1' }, { 'indent': '+1' }],
        [{ 'direction': 'rtl' }],
        [{ 'size': ['small', false, 'large', 'huge'] }],
        [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
        [{ 'color': [] }, { 'background': [] }],
        [{ 'font': [] }],
        [{ 'align': [] }],
        ['clean'],
        ['link', 'image', 'video']
      ]
    },
    placeholder: 'Insert text here ...',
    readOnly: false
  }

  // pollfill
  if (typeof Object.assign != 'function') {
    Object.defineProperty(Object, 'assign', {
      value(target, varArgs) {
        if (target == null) {
          throw new TypeError('Cannot convert undefined or null to object')
        }
        const to = Object(target)
        for (let index = 1; index < arguments.length; index++) {
          const nextSource = arguments[index]
          if (nextSource != null) {
            for (const nextKey in nextSource) {
              if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
                to[nextKey] = nextSource[nextKey]
              }
            }
          }
        }
        return to
      },
      writable: true,
      configurable: true
    })
  }

  // export
  export default {
    name: 'quill-editor',
    data() {
      return {
        _options: {},
        _content: '',
        defaultOptions
      }
    },
    props: {
      content: String,
      value: String,
      disabled: {
        type: Boolean,
        default: false
      },
      options: {
        type: Object,
        required: false,
        default: () => ({})
      },
      globalOptions: {
        type: Object,
        required: false,
        default: () => ({})
      }
    },
    mounted() {
      this.initialize()
    },
    beforeDestroy() {
      this.quill = null
      delete this.quill
    },
    methods: {
      // Init Quill instance
      initialize() {
        if (this.$el) {

          // Options
          this._options = Object.assign({}, this.defaultOptions, this.globalOptions, this.options)

          // Instance
          this.quill = new Quill(this.$refs.editor, this._options)
          
          this.quill.enable(false)

          // Set editor content
          if (this.value || this.content) {
            this.quill.pasteHTML(this.value || this.content)
          }

          // Disabled editor
          if (!this.disabled) {
            this.quill.enable(true)
          }

          // Mark model as touched if editor lost focus
          this.quill.on('selection-change', range => {
            if (!range) {
              this.$emit('blur', this.quill)
            } else {
              this.$emit('focus', this.quill)
            }
          })

          // Update model if text changes
          this.quill.on('text-change', (delta, oldDelta, source) => {
            let html = this.$refs.editor.children[0].innerHTML
            const quill = this.quill
            const text = this.quill.getText()
            if (html === '<p><br></p>') html = ''
            this._content = html
            this.$emit('input', this._content)
            this.$emit('change', { html, text, quill })
          })

          // Emit ready event
          this.$emit('ready', this.quill)
        }
      }
    },
    watch: {
      // Watch content change
      content(newVal, oldVal) {
        if (this.quill) {
          if (newVal && newVal !== this._content) {
            this._content = newVal
            this.quill.pasteHTML(newVal)
          } else if(!newVal) {
            this.quill.setText('')
          }
        }
      },
      // Watch content change
      value(newVal, oldVal) {
        if (this.quill) {
          if (newVal && newVal !== this._content) {
            this._content = newVal
            this.quill.pasteHTML(newVal)
          } else if(!newVal) {
            this.quill.setText('')
          }
        }
      },
      // Watch disabled change
      disabled(newVal, oldVal) {
        if (this.quill) {
          this.quill.enable(!newVal)
        }
      }
    }
  }
</script>


================================================
FILE: src/index.js
================================================

/*
* Vue-Quill-Editor index.js
* Author: surmon@foxmail.com
* Github: https://github.com/surmon-china/vue-quill-editor
*/

import _Quill from 'quill'
import quillEditor from './editor.vue'

const Quill = window.Quill || _Quill
const install = (Vue, globalOptions) => {
  if (globalOptions) {
    quillEditor.props.globalOptions.default = () => globalOptions
  }
  Vue.component(quillEditor.name, quillEditor)
}

const VueQuillEditor = { Quill, quillEditor, install }

export default VueQuillEditor
export { Quill, quillEditor, install }


================================================
FILE: test/e2e/custom-assertions/elementCount.js
================================================
// A custom Nightwatch assertion.
// the name of the method is the filename.
// can be used in tests like this:
//
//   browser.assert.elementCount(selector, count)
//
// for how to write custom assertions see
// http://nightwatchjs.org/guide#writing-custom-assertions
exports.assertion = function (selector, count) {
  this.message = 'Testing if element <' + selector + '> has count: ' + count
  this.expected = count
  this.pass = function (val) {
    return val === this.expected
  }
  this.value = function (res) {
    return res.value
  }
  this.command = function (cb) {
    var self = this
    return this.api.execute(function (selector) {
      return document.querySelectorAll(selector).length
    }, [selector], function (res) {
      cb.call(self, res)
    })
  }
}


================================================
FILE: test/e2e/nightwatch.conf.js
================================================
// http://nightwatchjs.org/guide#settings-file
module.exports = {
  "src_folders": ["test/e2e/specs"],
  "output_folder": "test/e2e/reports",
  "custom_assertions_path": ["test/e2e/custom-assertions"],

  "selenium": {
    "start_process": true,
    "server_path": "node_modules/selenium-server/lib/runner/selenium-server-standalone-2.53.0.jar",
    "host": "127.0.0.1",
    "port": 4444,
    "cli_args": {
      "webdriver.chrome.driver": require('chromedriver').path
    }
  },

  "test_settings": {
    "default": {
      "selenium_port": 4444,
      "selenium_host": "localhost",
      "silent": true
    },

    "chrome": {
      "desiredCapabilities": {
        "browserName": "chrome",
        "javascriptEnabled": true,
        "acceptSslCerts": true
      }
    },

    "firefox": {
      "desiredCapabilities": {
        "browserName": "firefox",
        "javascriptEnabled": true,
        "acceptSslCerts": true
      }
    }
  }
}


================================================
FILE: test/e2e/runner.js
================================================
// 1. start the dev server using production config
process.env.NODE_ENV = 'testing'
var server = require('../../build/dev-server.js')

// 2. run the nightwatch test suite against it
// to run in additional browsers:
//    1. add an entry in test/e2e/nightwatch.conf.json under "test_settings"
//    2. add it to the --env flag below
// For more information on Nightwatch's config file, see
// http://nightwatchjs.org/guide#settings-file
var spawn = require('cross-spawn')
var runner = spawn(
  './node_modules/.bin/nightwatch',
  [
    '--config', 'test/e2e/nightwatch.conf.js',
    '--env', 'chrome,firefox'
  ],
  {
    stdio: 'inherit'
  }
)

runner.on('exit', function (code) {
  server.close()
  process.exit(code)
})

runner.on('error', function (err) {
  server.close()
  throw err
})


================================================
FILE: test/unit/.eslintrc
================================================
{
  "env": {
    "mocha": true
  },
  "globals": {
    "expect": true,
    "sinon": true
  }
}


================================================
FILE: test/unit/index.js
================================================
// Polyfill fn.bind() for PhantomJS
/* eslint-disable no-extend-native */
Function.prototype.bind = require('function-bind')

// require all test files (files that ends with .spec.js)
const testsContext = require.context('./specs', true, /\.spec$/)
testsContext.keys().forEach(testsContext)

// require all src files except main.js for coverage.
// you can also change this to match only the subset of files that
// you want coverage for.
const srcContext = require.context('../../src/', true, /^\.\/(?!main(\.js)?$)/)
srcContext.keys().forEach(srcContext)


================================================
FILE: test/unit/karma.conf.js
================================================
// This is a karma config file. For more details see
//   http://karma-runner.github.io/0.13/config/configuration-file.html
// we are also using it with karma-webpack
//   https://github.com/webpack/karma-webpack

var webpackConfig = require('../../config/test.conf')

module.exports = function (config) {
  config.set({
    // to run in additional browsers:
    // 1. install corresponding karma launcher
    //    http://karma-runner.github.io/0.13/config/browsers.html
    // 2. add it to the `browsers` array below.
    // 浏览器环境
    browsers: ['PhantomJS'],
    // 测试框架
    frameworks: ['mocha', 'sinon-chai'],
    // 输出报告
    reporters: ['spec', 'coverage'],
    // 在browsers里面运行,把需要测试的文件都 require 进来,在 browsers 里跑,使用 frameworks 测试js,通过 reporters 输出报告
    files: ['./index.js'],
    // 为入口文件制定预处理器,测试 index.js 之前用 webpack 和 sourcemap 处理一下
    preprocessors: {
      './index.js': ['webpack', 'sourcemap']
    },
    // 给webpack指定相关的配置文件
    webpack: webpackConfig,
    webpackMiddleware: {
      noInfo: true
    },
    // 覆盖报告,coverage 是代码测试覆盖率的一个 reporter,也就是说告诉你项目的代码有多少测试了
    // 下面是 vue-cli 对这个的一个配置
    coverageReporter: {
      dir: './coverage',
      reporters: [
        { type: 'lcov', subdir: '.' },
        { type: 'text-summary' }
      ]
    }
  })
}


================================================
FILE: test/unit/specs/VueQuillEditor.spec.js
================================================

import Quill from 'quill'
import Vue from 'vue/dist/vue.js'
import VueQuillEditor, { quillEditor, install } from '../../../src/index.js'
import VueQuillEditorSsr from '../../../src/ssr.js'

window.Vue = Vue

// console.log('--------VueQuillEditor', VueQuillEditor)
// console.log('--------VueQuillEditorSsr', VueQuillEditorSsr)

describe('vue-quill-editor', () => {

  Vue.use(VueQuillEditor, {
    placeholder: 'global placeholder'
  })
  Vue.use(VueQuillEditorSsr, {
    placeholder: 'global ssr placeholder'
  })

  // 测试解构是否成功
  it('can get the object in es module', () => {
    expect(typeof install).to.deep.equal('function')
    expect(typeof quillEditor.methods.initialize).to.deep.equal('function')
  })

  // 全局安装
  describe('Global install spa:component', () => {
    it(' - should can get the quill element', done => {
      const vm = new Vue({
        template: `<div><quill-editor v-model="content"></quill-editor></div>`,
        data: {
          content: '<p>test content</p>',
        }
      }).$mount()
      expect(vm.$children[0].value).to.deep.equal('<p>test content</p>')
      Vue.nextTick(() => {
        expect(vm.$children[0].quill instanceof Quill).to.equal(true)
        expect(vm.$children[0].quill.getText()).to.deep.equal('test content\n')
        done()
      })
    })
  })

  // 全局配置测试
  describe('Get instance by attr ref and set global options', () => {
    it(' - should get the quill instance and global options', done => {
      const vm = new Vue({
        template: `<div><quill-editor ref="myTextEditor" v-model="content"></quill-editor></div>`,
        data: {
          content: '<p>test content</p>'
        },
        computed: {
          editor() {
            return this.$refs.myTextEditor
          },
          quill() {
            return this.editor.quill
          }
        }
      }).$mount()
      Vue.nextTick(() => {
        expect(vm.quill instanceof Quill).to.equal(true)
        expect(vm.quill.getText()).to.deep.equal('test content\n')
        expect(Object.keys(vm.editor._options).length >= 5).to.equal(true)
        done()
      })
    })
  })

  // 全局配置覆盖
  describe('Set component options', () => {
    it(' - should quill.placeholder === component.options.placeholder', done => {
      const vm = new Vue({
        template: `<div><quill-editor ref="myTextEditor" :options="editorOption" v-model="content"></quill-editor></div>`,
        data: {
          content: '<p>test content</p>',
          editorOption: {
            placeholder: 'component placeholder'
          }
        },
        computed: {
          editor() {
            return this.$refs.myTextEditor
          },
          quill() {
            return this.editor.quill
          }
        }
      }).$mount()
      Vue.nextTick(() => {
        // 配置是否等同局部配置
        const placeholder = vm.editor._options.placeholder
        const isInclude = placeholder === 'component placeholder' || placeholder === undefined
        expect(isInclude).to.equal(true)
        done()
      })
    })
  })

  // 数据绑定
  describe('Component data binding', () => {
    it(' - should change the quill content after change the component content data', done => {
      const vm = new Vue({
        template: `<div><quill-editor v-model="content" ref="myTextEditor"></quill-editor></div>`,
        data: {
          content: '<p>test content</p>'
        },
        computed: {
          quill() {
            return this.$refs.myTextEditor.quill
          }
        },
        mounted() {
          this.content = '<span>test change</span>'
        }
      }).$mount()
      Vue.nextTick(() => {
        expect(vm.quill.getText()).to.deep.equal('test change\n')
        expect(vm.quill.editor.delta.ops).to.deep.equal([{ insert: "test change\n" }])
        done()
      })
    })
  })

  // 广播事件
  describe('Component emit event and data binding by evennt', () => {
    it(' - should capture event after the quill emit event', done => {
      const eventLogs = []
      const vm = new Vue({
        template: `<div>
                      <quill-editor ref="myTextEditor"
                                    :value="content"
                                    @blur="onEditorBlur"
                                    @focus="onEditorFocus"
                                    @ready="onEditorReady"
                                    @change="onEditorChange"
                                    @input="onEditorInput">
                      </quill-editor>
                  </div>
                  `,
        data: {
          content: '<p>test content</p>'
        },
        computed: {
          editor() {
            return this.$refs.myTextEditor
          },
          quill() {
            return this.editor.quill
          }
        },
        methods: {
          onEditorBlur(quill) {
            console.log('onEditorBlur', quill)
            eventLogs.push('onEditorBlur')
          },
          onEditorFocus(quill) {
            console.log('onEditorFocus', quill)
            eventLogs.push('onEditorFocus')
          },
          onEditorReady(quill) {
            eventLogs.push('onEditorReady')
            // mockEvennt(this.editor.$el.children[1])
            // triggerEvent(this.editor.$el.children[0].children[0].children[0], 'MouseEvent')
          },
          onEditorChange({ quill, text, html }) {
            eventLogs.push('onEditorChange' + text)
            // expect(quill instanceof Quill).to.deep.equal(true)
            // expect(!!text).to.deep.equal(true)
            // expect(!!html).to.deep.equal(true)
          },
          onEditorInput(html) {
            eventLogs.push('onEditorInput' + html)
            // expect(html).to.deep.equal('<p>test change</p>')
          }
        },
        mounted() {
          eventLogs.push('mounted')
          this.content = '<span>test change</span>'
        }
      }).$mount()

      // console.log('----------', eventLogs)
      expect(eventLogs[0]).to.deep.equal('onEditorReady')
      expect(eventLogs[1]).to.deep.equal('mounted')
      done()
      // console.log('onEditorReady', this.editor.$el.children[1].children[0].dispatchEvent(event), event)
      // expect(quill instanceof Quill).to.deep.equal(true)
        // setTimeout(() => {
          // this.content = '<p>test change</p>'
        // }, 1000)
    })
  })

  // 局部安装
  describe('Local install component', () => {
    it(' - should work', done => {
      const eventLogs = []
      const vm = new Vue({
        template: `<div>
                      <vue-quill-editor ref="myTextEditor"
                                        v-model="content"
                                        :options="editorOption"
                                        @ready="onEditorReady">
                      </vue-quill-editor>
                  </div>
                  `,
        components: {
          'VueQuillEditor': quillEditor
        },
        data: {
          content: '<p>test content</p>',
          editorOption: {
            placeholder: 'component placeholder'
          }
        },
        computed: {
          quill() {
            return this.$refs.myTextEditor.quill
          }
        },
        methods: {
          onEditorReady(quill) {
            eventLogs.push('onEditorReady')
          }
        },
        mounted() {
          this.content = '<span>test change</span>'
        }
      }).$mount()
      Vue.nextTick(() => {
        expect(eventLogs[0]).to.deep.equal('onEditorReady')
        expect(vm.quill instanceof Quill).to.deep.equal(true)
        expect(vm.quill.getText()).to.deep.equal('test change\n')
        expect(vm.quill.editor.delta.ops).to.deep.equal([{ insert: "test change\n" }])
        done()
      })
    })
  })

  // 多个循环实例
  describe('Multi edirot component instance', () => {
    it(' - should update value after any change text', done => {
      const eventLogs = []
      const vm = new Vue({
        template: `<div>
                      <quill-editor :key="key"
                                    :value="content"
                                    :ref="'editor' + key"
                                    v-for="(content, key) in contents"
                                    :options="buildOptions(key)"
                                    @ready="onEditorReady(key)">
                      </quill-editor>
                  </div>
                  `,
        data: {
          contents: {
            a: '<p>a-test content</p>',
            b: '<p>b-test content</p>',
            c: '<p>c-test content</p>'
          }
        },
        methods: {
          buildOptions(key) {
            return {
              placeholder: `${key}component placeholder`
            }
          },
          onEditorReady(key) {
            eventLogs.push(`${key}-onEditorReady`)
          }
        }
      }).$mount()
      expect(eventLogs[0]).to.deep.equal('a-onEditorReady')
      expect(eventLogs[1]).to.deep.equal('b-onEditorReady')
      expect(eventLogs[2]).to.deep.equal('c-onEditorReady')
      expect(vm.$refs.editora[0].quill.getText()).to.deep.equal('a-test content\n')
      expect(vm.$refs.editorb[0].quill.getText()).to.deep.equal('b-test content\n')
      expect(vm.$refs.editorc[0].quill.getText()).to.deep.equal('c-test content\n')
      vm.contents.b = '<p>b-test change</p>'
      Vue.nextTick(() => {
        expect(vm.$refs.editorb[0].quill.getText()).to.deep.equal('b-test change\n')
        expect(vm.$refs.editorb[0].quill instanceof Quill).to.deep.equal(true)
        done()
      })
    })
  })

  // SSR 全局安装测试
  describe('Global install ssr:directive', () => {
    it(' - should get quill instance and capture event', done => {
      const eventLogs = []
      const vm = new Vue({
        template: `<div>
                    <div class="quill-editor" 
                         ref="editor"
                         @ready="onEditorReady"
                         :value="content"
                         v-quill:myQuillEditor="editorOption">
                    </div>
                  </div>
                  `,
        data: {
          content: '<p>test ssr content</p>',
          editorOption: {}
        },
        methods: {
          onEditorReady(quill) {
            eventLogs.push('ssr/onEditorReady')
            eventLogs.push(quill instanceof Quill)
          }
        },
        mounted() {
          eventLogs.push('ssr/mounted')
        }
      }).$mount()
      expect(eventLogs[0]).to.deep.equal('ssr/onEditorReady')
      expect(eventLogs[1]).to.deep.equal(true)
      expect(eventLogs[2]).to.deep.equal('ssr/mounted')
      vm.content = '<p>test ssr change</p>'
      Vue.nextTick(() => {
        expect(vm.myQuillEditor.getText()).to.deep.equal('test ssr content\n')
        done()
      })
    })
  })

  // 多个 SSR 平铺测试 placeholder: 'ssr placeholder'
  describe('Multi edirot directive instance', () => {
    it(' - should update value after any change text', done => {
      const eventLogs = []
      const vm = new Vue({
        template: `<div>
                    <div class="quill-editor" 
                         v-quill="buildOptions(key)"
                         v-for="(content, key) in contents"
                         @ready="onEditorReady(key)"
                         :instance-name="'editor-' + key"
                         :content="content"
                         :key="key">
                    </div>
                  </div>
                  `,
        data: {
          contents: {
            a: '<p>a-test ssr content</p>',
            b: '<p>b-test ssr content</p>',
            c: '<p>c-test ssr content</p>'
          }
        },
        methods: {
          buildOptions(key) {
            if (key === 'a') {
              return {}
            }
            if (key === 'b') {
              return {
                placeholder: `${key}-ssr placeholder`
              }
            }
            if (key === 'c') {
              return {}
            }
          },
          onEditorReady(key) {
            eventLogs.push(`${key}-onEditorReady`)
          }
        },
        mounted() {
          eventLogs.push('ssr/mounted')
        }
      }).$mount()
      expect(eventLogs[0]).to.deep.equal('a-onEditorReady')
      expect(eventLogs[1]).to.deep.equal('b-onEditorReady')
      expect(eventLogs[2]).to.deep.equal('c-onEditorReady')
      expect(eventLogs[3]).to.deep.equal('ssr/mounted')
      expect(vm['editor-a'] instanceof Quill).to.deep.equal(true)
      expect(vm['editor-b'] instanceof Quill).to.deep.equal(true)
      expect(vm['editor-c'] instanceof Quill).to.deep.equal(true)
      expect(vm['editor-a'].getText()).to.deep.equal('a-test ssr content\n')
      vm.contents.b = '<span>b-test ssr change</span>'
      Vue.nextTick(() => {
        Vue.nextTick(() => {
          expect(vm['editor-b'].getText()).to.deep.equal('b-test ssr change\n')
          expect(vm['editor-b'].editor.delta.ops).to.deep.equal([{ insert: 'b-test ssr change\n' }])
          expect(vm['editor-b'].options.placeholder).to.deep.equal('b-ssr placeholder')
          expect(vm['editor-c'].options.placeholder).to.deep.equal('global ssr placeholder')
          done()
        })
      })
    })
  })
})
Download .txt
gitextract_gay3qb1z/

├── .babelrc
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .npmignore
├── .travis.yml
├── CHANGELOG.md
├── LICENSE
├── README.md
├── bower.json
├── config/
│   ├── base.conf.js
│   ├── build.conf.js
│   └── test.conf.js
├── dist/
│   └── vue-quill-editor.js
├── package.json
├── src/
│   ├── editor.vue
│   └── index.js
└── test/
    ├── e2e/
    │   ├── custom-assertions/
    │   │   └── elementCount.js
    │   ├── nightwatch.conf.js
    │   └── runner.js
    └── unit/
        ├── .eslintrc
        ├── index.js
        ├── karma.conf.js
        └── specs/
            └── VueQuillEditor.spec.js
Download .txt
SYMBOL INDEX (27 symbols across 2 files)

FILE: dist/vue-quill-editor.js
  function e (line 1) | function e(i){if(n[i])return n[i].exports;var l=n[i]={i:i,l:!1,exports:{...
  function i (line 1) | function i(t){return t&&t.__esModule?t:{default:t}}
  function i (line 1) | function i(t){return t&&t.__esModule?t:{default:t}}

FILE: test/unit/specs/VueQuillEditor.spec.js
  method editor (line 54) | editor() {
  method quill (line 57) | quill() {
  method editor (line 83) | editor() {
  method quill (line 86) | quill() {
  method quill (line 110) | quill() {
  method mounted (line 114) | mounted() {
  method editor (line 146) | editor() {
  method quill (line 149) | quill() {
  method onEditorBlur (line 154) | onEditorBlur(quill) {
  method onEditorFocus (line 158) | onEditorFocus(quill) {
  method onEditorReady (line 162) | onEditorReady(quill) {
  method onEditorChange (line 167) | onEditorChange({ quill, text, html }) {
  method onEditorInput (line 173) | onEditorInput(html) {
  method mounted (line 178) | mounted() {
  method quill (line 219) | quill() {
  method onEditorReady (line 224) | onEditorReady(quill) {
  method mounted (line 228) | mounted() {
  method buildOptions (line 265) | buildOptions(key) {
  method onEditorReady (line 270) | onEditorReady(key) {
  method onEditorReady (line 309) | onEditorReady(quill) {
  method mounted (line 314) | mounted() {
  method buildOptions (line 353) | buildOptions(key) {
  method onEditorReady (line 366) | onEditorReady(key) {
  method mounted (line 370) | mounted() {
Condensed preview — 24 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (67K chars).
[
  {
    "path": ".babelrc",
    "chars": 221,
    "preview": "{\n  \"presets\": [\"es2015\", \"stage-2\"],\n  \"plugins\": [\n    \"transform-es2015-destructuring\",\n    \"transform-object-rest-sp"
  },
  {
    "path": ".eslintignore",
    "chars": 12,
    "preview": "config/*.js\n"
  },
  {
    "path": ".eslintrc.js",
    "chars": 17196,
    "preview": "\nmodule.exports = {\n  root: true,\n  parser: 'babel-eslint',\n  globals: {\n    env: false\n  },\n  env: {\n    browser: true,"
  },
  {
    "path": ".gitignore",
    "chars": 796,
    "preview": "# Logs\r\nlogs\r\n*.log\r\nnpm-debug.log\r\nselenium-debug.log\r\nnpm-debug.log*\r\n\r\n# System\r\n.DS_Store\r\n\r\n# Optional npm cache di"
  },
  {
    "path": ".npmignore",
    "chars": 315,
    "preview": ".github\r\n.DS_Store\r\n.babelrc\r\n.editorconfig\r\n.eslintrc.js\r\n.eslintignore\r\n.gitignore\r\n.travis.yml\r\n\r\ntest/\r\ntest/unit/co"
  },
  {
    "path": ".travis.yml",
    "chars": 112,
    "preview": "language: node_js\nnode_js:\n  - \"7\"\nafter_success:\n  - codeclimate-test-reporter < ./test/unit/coverage/lcov.info"
  },
  {
    "path": "CHANGELOG.md",
    "chars": 733,
    "preview": "\n## CHANGELOG\n\n### v3.0.6\n\nPR194, Prevents auto-focus when using within components with dynamically set content.\n\n### v3"
  },
  {
    "path": "LICENSE",
    "chars": 1084,
    "preview": "MIT License\r\n\r\nCopyright (c) 2020 Surmon\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy"
  },
  {
    "path": "README.md",
    "chars": 6584,
    "preview": "# vue-quill-editor\r\n\r\n[![vue](https://img.shields.io/badge/MADE%20WITH-VUE-42a97a?style=for-the-badge&labelColor=35495d)"
  },
  {
    "path": "bower.json",
    "chars": 587,
    "preview": "{\n  \"name\": \"vue-quill-editor\",\n  \"description\": \"Quill editor component for Vue\",\n  \"main\": \"./dist/vue-quill-editor.js"
  },
  {
    "path": "config/base.conf.js",
    "chars": 909,
    "preview": "const path = require('path')\nconst webpack = require('webpack')\nconst resolve = dir => path.join(__dirname, '..', dir)\n\n"
  },
  {
    "path": "config/build.conf.js",
    "chars": 822,
    "preview": "const path = require('path')\nconst merge = require('webpack-merge')\nconst baseConfig = require('./base.conf')\nconst reso"
  },
  {
    "path": "config/test.conf.js",
    "chars": 259,
    "preview": "// This is the webpack config used for unit tests.\nconst merge = require('webpack-merge')\nconst baseConfig = require('./"
  },
  {
    "path": "dist/vue-quill-editor.js",
    "chars": 4941,
    "preview": "!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e(require(\"quill\")):\"function\"==typeof d"
  },
  {
    "path": "package.json",
    "chars": 3945,
    "preview": "{\n  \"name\": \"vue-quill-editor\",\n  \"description\": \"Quill editor component for Vue\",\n  \"version\": \"3.0.6\",\n  \"license\": \"M"
  },
  {
    "path": "src/editor.vue",
    "chars": 4801,
    "preview": "<template>\r\n  <div class=\"quill-editor\">\r\n    <slot name=\"toolbar\"></slot>\r\n    <div ref=\"editor\"></div>\r\n  </div>\r\n</te"
  },
  {
    "path": "src/index.js",
    "chars": 538,
    "preview": "\n/*\n* Vue-Quill-Editor index.js\n* Author: surmon@foxmail.com\n* Github: https://github.com/surmon-china/vue-quill-editor\n"
  },
  {
    "path": "test/e2e/custom-assertions/elementCount.js",
    "chars": 777,
    "preview": "// A custom Nightwatch assertion.\n// the name of the method is the filename.\n// can be used in tests like this:\n//\n//   "
  },
  {
    "path": "test/e2e/nightwatch.conf.js",
    "chars": 943,
    "preview": "// http://nightwatchjs.org/guide#settings-file\nmodule.exports = {\n  \"src_folders\": [\"test/e2e/specs\"],\n  \"output_folder\""
  },
  {
    "path": "test/e2e/runner.js",
    "chars": 792,
    "preview": "// 1. start the dev server using production config\nprocess.env.NODE_ENV = 'testing'\nvar server = require('../../build/de"
  },
  {
    "path": "test/unit/.eslintrc",
    "chars": 95,
    "preview": "{\n  \"env\": {\n    \"mocha\": true\n  },\n  \"globals\": {\n    \"expect\": true,\n    \"sinon\": true\n  }\n}\n"
  },
  {
    "path": "test/unit/index.js",
    "chars": 557,
    "preview": "// Polyfill fn.bind() for PhantomJS\n/* eslint-disable no-extend-native */\nFunction.prototype.bind = require('function-bi"
  },
  {
    "path": "test/unit/karma.conf.js",
    "chars": 1271,
    "preview": "// This is a karma config file. For more details see\n//   http://karma-runner.github.io/0.13/config/configuration-file.h"
  },
  {
    "path": "test/unit/specs/VueQuillEditor.spec.js",
    "chars": 13224,
    "preview": "\nimport Quill from 'quill'\nimport Vue from 'vue/dist/vue.js'\nimport VueQuillEditor, { quillEditor, install } from '../.."
  }
]

About this extraction

This page contains the full source code of the surmon-china/vue-quill-editor GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 24 files (60.1 KB), approximately 20.1k tokens, and a symbol index with 27 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!