[
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newline = true\n\n[*.md]\ntrim_trailing_whitespace = false\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\n\npatreon: dangvanthanh\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n1. Go to '...'\n2. Click on '....'\n3. Scroll down to '....'\n4. See error\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n**Desktop (please complete the following information):**\n - OS: [e.g. iOS]\n - Browser [e.g. chrome, safari]\n - Version [e.g. 22]\n\n**Smartphone (please complete the following information):**\n - Device: [e.g. iPhone6]\n - OS: [e.g. iOS8.1]\n - Browser [e.g. stock browser, safari]\n - Version [e.g. 22]\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**Is your feature request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm always frustrated when [...]\n\n**Describe the solution you'd like**\nA clear and concise description of what you want to happen.\n\n**Describe alternatives you've considered**\nA clear and concise description of any alternative solutions or features you've considered.\n\n**Additional context**\nAdd any other context or screenshots about the feature request here.\n"
  },
  {
    "path": ".github/main.workflow",
    "content": "workflow \"Build, Release and Publish\" {\n  on = \"push\"\n  resolves = [\"Publish\"]\n}\n\naction \"Install\" {\n  uses = \"actions/npm@master\"\n  args = \"install\"\n}\n\naction \"Build\" {\n  uses = \"actions/npm@master\"\n  args = \"install\"\n}\n\naction \"Test\" {\n  uses = \"actions/npm@master\"\n  needs = [\"Build\"]\n  args = \"build\"\n}\n\naction \"Tag\" {\n  uses = \"actions/bin/filter@master\\\"\"\n  needs = [\"Test\"]\n  args = \"tag\"\n}\n\naction \"Publish\" {\n  uses = \"actions/npm@master\"\n  needs = [\"Tag\"]\n  args = \"publish --access public\"\n  secrets = [\"NPM_AUTH_TOKEN\"]\n  runs = \"actions/npm@master\"\n}\n"
  },
  {
    "path": ".gitignore",
    "content": ".DS_Store\nnode_modules/\nnpm-debug.log\npackage-lock.json\n"
  },
  {
    "path": ".husky/pre-commit",
    "content": "#!/bin/sh\n. \"$(dirname \"$0\")/_/husky.sh\"\n\nnpx lint-staged\n"
  },
  {
    "path": ".prettierrc",
    "content": "{\n  \"singleQuote\": true\n}\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as\ncontributors and maintainers pledge to making participation in our project and\nour community a harassment-free experience for everyone, regardless of age, body\nsize, disability, ethnicity, sex characteristics, gender identity and expression,\nlevel of experience, education, socio-economic status, nationality, personal\nappearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment\ninclude:\n\n* Using welcoming and inclusive language\n* Being respectful of differing viewpoints and experiences\n* Gracefully accepting constructive criticism\n* Focusing on what is best for the community\n* Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n* The use of sexualized language or imagery and unwelcome sexual attention or\n advances\n* Trolling, insulting/derogatory comments, and personal or political attacks\n* Public or private harassment\n* Publishing others' private information, such as a physical or electronic\n address, without explicit permission\n* Other conduct which could reasonably be considered inappropriate in a\n professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable\nbehavior and are expected to take appropriate and fair corrective action in\nresponse to any instances of unacceptable behavior.\n\nProject maintainers have the right and responsibility to remove, edit, or\nreject comments, commits, code, wiki edits, issues, and other contributions\nthat are not aligned to this Code of Conduct, or to ban temporarily or\npermanently any contributor for other behaviors that they deem inappropriate,\nthreatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces\nwhen an individual is representing the project or its community. Examples of\nrepresenting a project or community include using an official project e-mail\naddress, posting via an official social media account, or acting as an appointed\nrepresentative at an online or offline event. Representation of a project may be\nfurther defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be\nreported by contacting the project team at dangvanthanh@dangthanh.org. All\ncomplaints will be reviewed and investigated and will result in a response that\nis deemed necessary and appropriate to the circumstances. The project team is\nobligated to maintain confidentiality with regard to the reporter of an incident.\nFurther details of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good\nfaith may face temporary or permanent repercussions as determined by other\nmembers of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,\navailable at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html\n\n[homepage]: https://www.contributor-covenant.org\n\nFor answers to common questions about this code of conduct, see\nhttps://www.contributor-covenant.org/faq\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "Thanks to contributers:\n\n- [Eduárd Moldován](https://github.com/edimoldovan)\n- [Dominique FERET](https://github.com/DominiqueFERET)\n- [comfuture](https://github.com/comfuture)\n- [旺旺](https://github.com/chengpan168)\n- [Tony Yip](https://github.com/tonyhhyip)\n- [Nedyalko Dyakov](https://github.com/ndyakov)\n- [Bryan Miller](https://github.com/bryanjamesmiller)\n- [Jeff Omiecinski](https://github.com/omiecinski)\n- [rlfscin](https://github.com/rlfscin)\n- [Renato Souza](https://github.com/renatosistemasvc)\n- [Fernando Morgenstern](https://github.com/fernandomm)\n- [Christoph-Wagner](https://github.com/Christoph-Wagner)\n- [Patrick Davey](https://github.com/patrickdavey)\n- [Michali Sarris](https://github.com/msarris)\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2019 Dang Van Thanh\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# vue-ckeditor\n\n> Ckeditor using for Vue.js 2\n\n![](https://raw.githubusercontent.com/dangvanthanh/vue-ckeditor2/master/screenshot.png)\n\n## Requirements\n\n- [Ckeditor](http://ckeditor.com/) >= 4\n- [Vue.js](http://vuejs.org/) >= 2\n\n## Install\n\n### CDN\n\n```html\n<script src=\"https://unpkg.com/vue-ckeditor2\"></script>\n```\n\n### NPM\n\n```\n$ npm install vue-ckeditor2 --save\n```\n\n## Usage\n\n> This document applies to v2.0+. If you are looking for older versions, docs are [here](https://github.com/dangvanthanh/vue-ckeditor2/wiki/Getting-Started)\n\n### Component\n\nThen in your component:\n\n```vue\n<template>\n  <div>\n    <vue-ckeditor \n      v-model=\"content\" \n      :config=\"config\" \n      @blur=\"onBlur($event)\" \n      @focus=\"onFocus($event)\"\n      @contentDom=\"onContentDom($event)\"\n      @dialogDefinition=\"onDialogDefinition($event)\"\n      @fileUploadRequest=\"onFileUploadRequest($event)\"\n      @fileUploadResponse=\"onFileUploadResponse($event)\" />\n  </div>\n</template>\n\n<script>\nimport VueCkeditor from 'vue-ckeditor2';\n\nexport default {\n  components: { VueCkeditor },\n  data() {\n    return {\n      content: '',\n      config: {\n        toolbar: [\n          ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript']\n        ],\n        height: 300\n      }\n    };\n  },\n  methods: {\n    onBlur(evt) {\n      console.log(evt);\n    },\n    onFocus(evt) {\n      console.log(evt);\n    },\n    onContentDom(evt) {\n      console.log(evt);\n    },\n    onDialogDefinition(evt) {\n      console.log(evt);\n    },\n    onFileUploadRequest(evt) {\n      console.log(evt);\n    },\n    onFileUploadResponse(evt) {\n      console.log(evt);\n    }\n  }\n};\n</script>\n```\n\n### Props\n\n| Name                    | Type       | Description                                                                  |\n| ----------------------- | ---------- | ---------------------------------------------------------------------------- |\n| `name`                  | `String`   | Name of instance ckedior. **Default: editor- **                              |\n| `id`                    | `String`   | Id of instance ckedior. **Default: editor-1**                                |\n| `types`                 | `String`   | Types of ckedior. **Default: classic**                                       |\n| `config`                | `Object`   | All configuration of ckeditor. **Default: {}**                               |\n| `instanceReadyCallback` | `Function` | Optional function that will be attached to CKEditor instanceReady event.     |\n| `readOnlyMode`          | `Boolean`  | Option setReadOnly editor initializes in the proper mode. **Default: false** |\n\n### Events\n\n| Name                 | Description                                                                                                                                                       |\n| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `blur`               | Fired when the editor instance loses the input focus.                                                                                                             |\n| `focus`              | Fired when the editor instance receives the input focus.                                                                                                          |\n| `contentDom`         | Event fired when the editor content (its DOM structure) is ready                                                                                                  |\n| `dialogDefinition`   | Event fired when a dialog definition is about to be used to create a dialog into an editor instance                                                               |\n| `fileUploadRequest`  | Event fired when the [file loader](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_fileTools_fileLoader.html) should send XHR                             |\n| `fileUploadResponse` | Event fired when the [file loader](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_fileTools_fileLoader.html) response is received and needs to be parsed |\n\n## Build Setup\n\nYou can use [vue-cli](https://github.com/vuejs/vue-cli) with [vue-rollup-boilerplate templates](https://github.com/dangvanthanh/vue-rollup-boilerplate) or [other vue templates](https://github.com/vuejs-templates)\n\n## Created By\n\n- [Dang Van Thanh](https://github.com/dangvanthanh)\n\nThanks to [contributers](./CONTRIBUTING.md)\n\n## License\n\nMIT © [Dang Van Thanh](http://dangthanh.org)\n"
  },
  {
    "path": "bili.config.js",
    "content": "module.exports = {\n  plugins: {\n    vue: true\n  },\n  output: {\n    format: ['umd', 'cjs', 'es'],\n    moduleName: 'VueCkeditor',\n    minify: true,\n    fileName: 'vue-ckeditor2.[format].js',\n    sourceMap: false\n  }\n};\n"
  },
  {
    "path": "dist/vue-ckeditor2.cjs.js",
    "content": "\"use strict\";var t=(new Date).getTime();var n=function(t,n,e,i,s,o,a,c,r,d){\"boolean\"!=typeof a&&(r=c,c=a,a=!1);var u,h=\"function\"==typeof e?e.options:e;if(t&&t.render&&(h.render=t.render,h.staticRenderFns=t.staticRenderFns,h._compiled=!0,s&&(h.functional=!0)),i&&(h._scopeId=i),o?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||\"undefined\"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,r(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},h._ssrRegister=u):n&&(u=a?function(){n.call(this,d(this.$root.$options.shadowRoot))}:function(t){n.call(this,c(t))}),u)if(h.functional){var f=h.render;h.render=function(t,n){return u.call(n),f(t,n)}}else{var l=h.beforeCreate;h.beforeCreate=l?[].concat(l,u):[u]}return e}({render:function(){var t=this.$createElement,n=this._self._c||t;return n(\"div\",{staticClass:\"ckeditor\"},[n(\"textarea\",{attrs:{name:this.name,id:this.id,types:this.types,config:this.config,disabled:this.readOnlyMode},domProps:{value:this.value}})])},staticRenderFns:[]},void 0,{name:\"VueCkeditor\",props:{name:{type:String,default:function(){return\"editor-\".concat(++t)}},value:{type:String},id:{type:String,default:function(){return\"editor-\".concat(t)}},types:{type:String,default:function(){return\"classic\"}},config:{type:Object,default:function(){}},instanceReadyCallback:{type:Function},readOnlyMode:{type:Boolean,default:function(){return!1}}},data:function(){return{instanceValue:\"\"}},computed:{instance:function(){return CKEDITOR.instances[this.id]}},watch:{value:function(t){try{this.instance&&this.update(t)}catch(t){}},readOnlyMode:function(t){this.instance.setReadOnly(t)}},mounted:function(){this.create()},methods:{create:function(){var t=this;\"undefined\"==typeof CKEDITOR?console.log(\"CKEDITOR is missing (http://ckeditor.com/)\"):(\"inline\"===this.types?CKEDITOR.inline(this.id,this.config):CKEDITOR.replace(this.id,this.config),this.instance.setData(this.value),this.instance.on(\"instanceReady\",(function(){t.instance.setData(t.value)})),this.instance.on(\"change\",this.onChange),this.instance.on(\"mode\",this.onMode),this.instance.on(\"blur\",(function(n){t.$emit(\"blur\",n)})),this.instance.on(\"focus\",(function(n){t.$emit(\"focus\",n)})),this.instance.on(\"contentDom\",(function(n){t.$emit(\"contentDom\",n)})),CKEDITOR.on(\"dialogDefinition\",(function(n){t.$emit(\"dialogDefinition\",n)})),this.instance.on(\"fileUploadRequest\",(function(n){t.$emit(\"fileUploadRequest\",n)})),this.instance.on(\"fileUploadResponse\",(function(n){setTimeout((function(){t.onChange()}),0),t.$emit(\"fileUploadResponse\",n)})),void 0!==this.instanceReadyCallback&&this.instance.on(\"instanceReady\",this.instanceReadyCallback),this.$once(\"hook:beforeDestroy\",(function(){t.destroy()})))},update:function(t){this.instanceValue!==t&&(this.instance.setData(t,{internal:!1}),this.instanceValue=t)},destroy:function(){try{var t=window.CKEDITOR;t.instances&&t.instances[this.id]&&t.instances[this.id].destroy()}catch(t){}},onMode:function(){var t=this;if(\"source\"===this.instance.mode){var n=this.instance.editable();n.attachListener(n,\"input\",(function(){t.onChange()}))}},onChange:function(){var t=this.instance.getData();t!==this.value&&(this.$emit(\"input\",t),this.instanceValue=t)}}},void 0,!1,void 0,!1,void 0,void 0,void 0);module.exports=n;\n"
  },
  {
    "path": "dist/vue-ckeditor2.es.js",
    "content": "var t=(new Date).getTime();var n=function(t,n,e,i,s,o,a,c,r,d){\"boolean\"!=typeof a&&(r=c,c=a,a=!1);var u,h=\"function\"==typeof e?e.options:e;if(t&&t.render&&(h.render=t.render,h.staticRenderFns=t.staticRenderFns,h._compiled=!0,s&&(h.functional=!0)),i&&(h._scopeId=i),o?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||\"undefined\"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,r(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},h._ssrRegister=u):n&&(u=a?function(){n.call(this,d(this.$root.$options.shadowRoot))}:function(t){n.call(this,c(t))}),u)if(h.functional){var f=h.render;h.render=function(t,n){return u.call(n),f(t,n)}}else{var l=h.beforeCreate;h.beforeCreate=l?[].concat(l,u):[u]}return e}({render:function(){var t=this.$createElement,n=this._self._c||t;return n(\"div\",{staticClass:\"ckeditor\"},[n(\"textarea\",{attrs:{name:this.name,id:this.id,types:this.types,config:this.config,disabled:this.readOnlyMode},domProps:{value:this.value}})])},staticRenderFns:[]},void 0,{name:\"VueCkeditor\",props:{name:{type:String,default:function(){return\"editor-\".concat(++t)}},value:{type:String},id:{type:String,default:function(){return\"editor-\".concat(t)}},types:{type:String,default:function(){return\"classic\"}},config:{type:Object,default:function(){}},instanceReadyCallback:{type:Function},readOnlyMode:{type:Boolean,default:function(){return!1}}},data:function(){return{instanceValue:\"\"}},computed:{instance:function(){return CKEDITOR.instances[this.id]}},watch:{value:function(t){try{this.instance&&this.update(t)}catch(t){}},readOnlyMode:function(t){this.instance.setReadOnly(t)}},mounted:function(){this.create()},methods:{create:function(){var t=this;\"undefined\"==typeof CKEDITOR?console.log(\"CKEDITOR is missing (http://ckeditor.com/)\"):(\"inline\"===this.types?CKEDITOR.inline(this.id,this.config):CKEDITOR.replace(this.id,this.config),this.instance.setData(this.value),this.instance.on(\"instanceReady\",(function(){t.instance.setData(t.value)})),this.instance.on(\"change\",this.onChange),this.instance.on(\"mode\",this.onMode),this.instance.on(\"blur\",(function(n){t.$emit(\"blur\",n)})),this.instance.on(\"focus\",(function(n){t.$emit(\"focus\",n)})),this.instance.on(\"contentDom\",(function(n){t.$emit(\"contentDom\",n)})),CKEDITOR.on(\"dialogDefinition\",(function(n){t.$emit(\"dialogDefinition\",n)})),this.instance.on(\"fileUploadRequest\",(function(n){t.$emit(\"fileUploadRequest\",n)})),this.instance.on(\"fileUploadResponse\",(function(n){setTimeout((function(){t.onChange()}),0),t.$emit(\"fileUploadResponse\",n)})),void 0!==this.instanceReadyCallback&&this.instance.on(\"instanceReady\",this.instanceReadyCallback),this.$once(\"hook:beforeDestroy\",(function(){t.destroy()})))},update:function(t){this.instanceValue!==t&&(this.instance.setData(t,{internal:!1}),this.instanceValue=t)},destroy:function(){try{var t=window.CKEDITOR;t.instances&&t.instances[this.id]&&t.instances[this.id].destroy()}catch(t){}},onMode:function(){var t=this;if(\"source\"===this.instance.mode){var n=this.instance.editable();n.attachListener(n,\"input\",(function(){t.onChange()}))}},onChange:function(){var t=this.instance.getData();t!==this.value&&(this.$emit(\"input\",t),this.instanceValue=t)}}},void 0,!1,void 0,!1,void 0,void 0,void 0);export{n as default};\n"
  },
  {
    "path": "dist/vue-ckeditor2.esm.js",
    "content": "var t=(new Date).getTime();export default(function(t,n,e,i,s,o,a,c,r,d){\"boolean\"!=typeof a&&(r=c,c=a,a=!1);var u,h=\"function\"==typeof e?e.options:e;if(t&&t.render&&(h.render=t.render,h.staticRenderFns=t.staticRenderFns,h._compiled=!0,s&&(h.functional=!0)),i&&(h._scopeId=i),o?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||\"undefined\"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,r(t)),t&&t._registeredComponents&&t._registeredComponents.add(o)},h._ssrRegister=u):n&&(u=a?function(){n.call(this,d(this.$root.$options.shadowRoot))}:function(t){n.call(this,c(t))}),u)if(h.functional){var f=h.render;h.render=function(t,n){return u.call(n),f(t,n)}}else{var l=h.beforeCreate;h.beforeCreate=l?[].concat(l,u):[u]}return e}({render:function(){var t=this.$createElement,n=this._self._c||t;return n(\"div\",{staticClass:\"ckeditor\"},[n(\"textarea\",{attrs:{name:this.name,id:this.id,types:this.types,config:this.config,disabled:this.readOnlyMode},domProps:{value:this.value}})])},staticRenderFns:[]},void 0,{name:\"VueCkeditor\",props:{name:{type:String,default:function(){return\"editor-\".concat(++t)}},value:{type:String},id:{type:String,default:function(){return\"editor-\".concat(t)}},types:{type:String,default:function(){return\"classic\"}},config:{type:Object,default:function(){}},instanceReadyCallback:{type:Function},readOnlyMode:{type:Boolean,default:function(){return!1}}},data:function(){return{instanceValue:\"\"}},computed:{instance:function(){return CKEDITOR.instances[this.id]}},watch:{value:function(t){try{this.instance&&this.update(t)}catch(t){}},readOnlyMode:function(t){this.instance.setReadOnly(t)}},mounted:function(){this.create()},methods:{create:function(){var t=this;\"undefined\"==typeof CKEDITOR?console.log(\"CKEDITOR is missing (http://ckeditor.com/)\"):(\"inline\"===this.types?CKEDITOR.inline(this.id,this.config):CKEDITOR.replace(this.id,this.config),this.instance.setData(this.value),this.instance.on(\"instanceReady\",function(){t.instance.setData(t.value)}),this.instance.on(\"change\",this.onChange),this.instance.on(\"mode\",this.onMode),this.instance.on(\"blur\",function(n){t.$emit(\"blur\",n)}),this.instance.on(\"focus\",function(n){t.$emit(\"focus\",n)}),this.instance.on(\"contentDom\",function(n){t.$emit(\"contentDom\",n)}),CKEDITOR.on(\"dialogDefinition\",function(n){t.$emit(\"dialogDefinition\",n)}),this.instance.on(\"fileUploadRequest\",function(n){t.$emit(\"fileUploadRequest\",n)}),this.instance.on(\"fileUploadResponse\",function(n){setTimeout(function(){t.onChange()},0),t.$emit(\"fileUploadResponse\",n)}),void 0!==this.instanceReadyCallback&&this.instance.on(\"instanceReady\",this.instanceReadyCallback),this.$once(\"hook:beforeDestroy\",function(){t.destroy()}))},update:function(t){this.instanceValue!==t&&(this.instance.setData(t,{internal:!1}),this.instanceValue=t)},destroy:function(){try{var t=window.CKEDITOR;t.instances&&t.instances[this.id]&&t.instances[this.id].destroy()}catch(t){}},onMode:function(){var t=this;if(\"source\"===this.instance.mode){var n=this.instance.editable();n.attachListener(n,\"input\",function(){t.onChange()})}},onChange:function(){var t=this.instance.getData();t!==this.value&&(this.$emit(\"input\",t),this.instanceValue=t)}}},void 0,!1,void 0,void 0,void 0));\n"
  },
  {
    "path": "dist/vue-ckeditor2.umd.js",
    "content": "!function(t,n){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=n():\"function\"==typeof define&&define.amd?define(n):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).VueCkeditor=n()}(this,(function(){\"use strict\";var t=(new Date).getTime();return function(t,n,e,i,o,s,a,c,d,r){\"boolean\"!=typeof a&&(d=c,c=a,a=!1);var u,f=\"function\"==typeof e?e.options:e;if(t&&t.render&&(f.render=t.render,f.staticRenderFns=t.staticRenderFns,f._compiled=!0,o&&(f.functional=!0)),i&&(f._scopeId=i),s?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||\"undefined\"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,d(t)),t&&t._registeredComponents&&t._registeredComponents.add(s)},f._ssrRegister=u):n&&(u=a?function(){n.call(this,r(this.$root.$options.shadowRoot))}:function(t){n.call(this,c(t))}),u)if(f.functional){var h=f.render;f.render=function(t,n){return u.call(n),h(t,n)}}else{var l=f.beforeCreate;f.beforeCreate=l?[].concat(l,u):[u]}return e}({render:function(){var t=this.$createElement,n=this._self._c||t;return n(\"div\",{staticClass:\"ckeditor\"},[n(\"textarea\",{attrs:{name:this.name,id:this.id,types:this.types,config:this.config,disabled:this.readOnlyMode},domProps:{value:this.value}})])},staticRenderFns:[]},void 0,{name:\"VueCkeditor\",props:{name:{type:String,default:function(){return\"editor-\".concat(++t)}},value:{type:String},id:{type:String,default:function(){return\"editor-\".concat(t)}},types:{type:String,default:function(){return\"classic\"}},config:{type:Object,default:function(){}},instanceReadyCallback:{type:Function},readOnlyMode:{type:Boolean,default:function(){return!1}}},data:function(){return{instanceValue:\"\"}},computed:{instance:function(){return CKEDITOR.instances[this.id]}},watch:{value:function(t){try{this.instance&&this.update(t)}catch(t){}},readOnlyMode:function(t){this.instance.setReadOnly(t)}},mounted:function(){this.create()},methods:{create:function(){var t=this;\"undefined\"==typeof CKEDITOR?console.log(\"CKEDITOR is missing (http://ckeditor.com/)\"):(\"inline\"===this.types?CKEDITOR.inline(this.id,this.config):CKEDITOR.replace(this.id,this.config),this.instance.setData(this.value),this.instance.on(\"instanceReady\",(function(){t.instance.setData(t.value)})),this.instance.on(\"change\",this.onChange),this.instance.on(\"mode\",this.onMode),this.instance.on(\"blur\",(function(n){t.$emit(\"blur\",n)})),this.instance.on(\"focus\",(function(n){t.$emit(\"focus\",n)})),this.instance.on(\"contentDom\",(function(n){t.$emit(\"contentDom\",n)})),CKEDITOR.on(\"dialogDefinition\",(function(n){t.$emit(\"dialogDefinition\",n)})),this.instance.on(\"fileUploadRequest\",(function(n){t.$emit(\"fileUploadRequest\",n)})),this.instance.on(\"fileUploadResponse\",(function(n){setTimeout((function(){t.onChange()}),0),t.$emit(\"fileUploadResponse\",n)})),void 0!==this.instanceReadyCallback&&this.instance.on(\"instanceReady\",this.instanceReadyCallback),this.$once(\"hook:beforeDestroy\",(function(){t.destroy()})))},update:function(t){this.instanceValue!==t&&(this.instance.setData(t,{internal:!1}),this.instanceValue=t)},destroy:function(){try{var t=window.CKEDITOR;t.instances&&t.instances[this.id]&&t.instances[this.id].destroy()}catch(t){}},onMode:function(){var t=this;if(\"source\"===this.instance.mode){var n=this.instance.editable();n.attachListener(n,\"input\",(function(){t.onChange()}))}},onChange:function(){var t=this.instance.getData();t!==this.value&&(this.$emit(\"input\",t),this.instanceValue=t)}}},void 0,!1,void 0,!1,void 0,void 0,void 0)}));\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"vue-ckeditor2\",\n  \"version\": \"2.1.5\",\n  \"description\": \"Ckeditor 4 using with Vue.js\",\n  \"author\": \"Dang Van Thanh <dangvanthanh@dangthanh.org>\",\n  \"main\": \"dist/vue-ckeditor2.cjs.js\",\n  \"module\": \"dist/vue-ckeditor2.esm.js\",\n  \"unpkg\": \"dist/vue-ckeditor2.umd.js\",\n  \"scripts\": {\n    \"build\": \"bili src/index.js --bundle-node-modules\",\n    \"prepare\": \"husky install\"\n  },\n  \"lint-staged\": {\n    \"*.{js,json,vue},!dist/*.js\": [\n      \"prettier --write\",\n      \"git add\"\n    ]\n  },\n  \"peerDependencies\": {\n    \"ckeditor\": \">= 4\",\n    \"vue\": \">= 2\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/dangvanthanh/vue-ckeditor2.git\"\n  },\n  \"keywords\": [\n    \"vue\",\n    \"ckeditor\",\n    \"vue-ckeditor\"\n  ],\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"bili\": \"^5.0.5\",\n    \"husky\": \"8.0.3\",\n    \"lint-staged\": \"13.1.0\",\n    \"prettier\": \"^2.3.2\",\n    \"rollup-plugin-vue\": \"5.0.0\",\n    \"vue-template-compiler\": \"^2.6.14\"\n  }\n}\n"
  },
  {
    "path": "src/VueCkeditor.vue",
    "content": "<template>\n  <div class=\"ckeditor\">\n    <textarea\n      :name=\"name\"\n      :id=\"id\"\n      :value=\"value\"\n      :types=\"types\"\n      :config=\"config\"\n      :disabled=\"readOnlyMode\"\n    >\n    </textarea>\n  </div>\n</template>\n\n<script>\nlet inc = new Date().getTime();\n\nexport default {\n  name: 'VueCkeditor',\n  props: {\n    name: {\n      type: String,\n      default: () => `editor-${++inc}`\n    },\n    value: {\n      type: String\n    },\n    id: {\n      type: String,\n      default: () => `editor-${inc}`\n    },\n    types: {\n      type: String,\n      default: () => `classic`\n    },\n    config: {\n      type: Object,\n      default: () => {}\n    },\n    instanceReadyCallback: {\n      type: Function\n    },\n    readOnlyMode: {\n      type: Boolean,\n      default: () => false\n    }\n  },\n  data() {\n    return {\n      instanceValue: ''\n    };\n  },\n  computed: {\n    instance() {\n      return CKEDITOR.instances[this.id];\n    }\n  },\n  watch: {\n    value(val) {\n      try {\n        if (this.instance) {\n          this.update(val);\n        }\n      } catch (e) {}\n    },\n    readOnlyMode(val) {\n      this.instance.setReadOnly(val);\n    }\n  },\n  mounted() {\n    this.create();\n  },\n  methods: {\n    create() {\n      if (typeof CKEDITOR === 'undefined') {\n        console.log('CKEDITOR is missing (http://ckeditor.com/)');\n      } else {\n        if (this.types === 'inline') {\n          CKEDITOR.inline(this.id, this.config);\n        } else {\n          CKEDITOR.replace(this.id, this.config);\n        }\n\n        this.instance.setData(this.value);\n\n        this.instance.on('instanceReady', () => {\n          this.instance.setData(this.value);\n        });\n\n        // Ckeditor change event\n        this.instance.on('change', this.onChange);\n\n        // Ckeditor mode html or source\n        this.instance.on('mode', this.onMode);\n\n        // Ckeditor blur event\n        this.instance.on('blur', evt => {\n          this.$emit('blur', evt);\n        });\n\n        // Ckeditor focus event\n        this.instance.on('focus', evt => {\n          this.$emit('focus', evt);\n        });\n\n        // Ckeditor contentDom event\n        this.instance.on('contentDom', evt => {\n          this.$emit('contentDom', evt);\n        });\n\n        // Ckeditor dialog definition event\n        CKEDITOR.on('dialogDefinition', evt => {\n          this.$emit('dialogDefinition', evt);\n        });\n\n        // Ckeditor file upload request event\n        this.instance.on('fileUploadRequest', evt => {\n          this.$emit('fileUploadRequest', evt);\n        });\n\n        // Ckditor file upload response event\n        this.instance.on('fileUploadResponse', evt => {\n          setTimeout(() => {\n            this.onChange();\n          }, 0);\n          this.$emit('fileUploadResponse', evt);\n        });\n\n        // Listen for instanceReady event\n        if (typeof this.instanceReadyCallback !== 'undefined') {\n          this.instance.on('instanceReady', this.instanceReadyCallback);\n        }\n\n        // Registering the beforeDestroyed hook right after creating the instance\n        this.$once('hook:beforeDestroy', () => {\n          this.destroy();\n        });\n      }\n    },\n    update(val) {\n      if (this.instanceValue !== val) {\n        this.instance.setData(val, { internal: false });\n        this.instanceValue = val;\n      }\n    },\n    destroy() {\n      try {\n        let editor = window['CKEDITOR'];\n        if (editor.instances && editor.instances[this.id]) {\n          editor.instances[this.id].destroy();\n        }\n      } catch (e) {}\n    },\n    onMode() {\n      if (this.instance.mode === 'source') {\n        let editable = this.instance.editable();\n        editable.attachListener(editable, 'input', () => {\n          this.onChange();\n        });\n      }\n    },\n    onChange() {\n      let html = this.instance.getData();\n      if (html !== this.value) {\n        this.$emit('input', html);\n        this.instanceValue = html;\n      }\n    }\n  }\n};\n</script>\n"
  },
  {
    "path": "src/index.js",
    "content": "import VueCkeditor from './VueCkeditor.vue';\n\nexport default VueCkeditor;\n"
  }
]