Repository: dangvanthanh/vue-ckeditor2 Branch: main Commit: 52a29dd20cad Files: 20 Total size: 30.0 KB Directory structure: gitextract_ahf_in2_/ ├── .editorconfig ├── .github/ │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ └── feature_request.md │ └── main.workflow ├── .gitignore ├── .husky/ │ └── pre-commit ├── .prettierrc ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── bili.config.js ├── dist/ │ ├── vue-ckeditor2.cjs.js │ ├── vue-ckeditor2.es.js │ ├── vue-ckeditor2.esm.js │ └── vue-ckeditor2.umd.js ├── package.json └── src/ ├── VueCkeditor.vue └── index.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .editorconfig ================================================ root = true [*] indent_style = space indent_size = 2 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false ================================================ FILE: .github/FUNDING.yml ================================================ # These are supported funding model platforms patreon: dangvanthanh ================================================ FILE: .github/ISSUE_TEMPLATE/bug_report.md ================================================ --- name: Bug report about: Create a report to help us improve title: '' labels: '' assignees: '' --- **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - OS: [e.g. iOS] - Browser [e.g. chrome, safari] - Version [e.g. 22] **Smartphone (please complete the following information):** - Device: [e.g. iPhone6] - OS: [e.g. iOS8.1] - Browser [e.g. stock browser, safari] - Version [e.g. 22] **Additional context** Add any other context about the problem here. ================================================ FILE: .github/ISSUE_TEMPLATE/feature_request.md ================================================ --- name: Feature request about: Suggest an idea for this project title: '' labels: '' assignees: '' --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here. ================================================ FILE: .github/main.workflow ================================================ workflow "Build, Release and Publish" { on = "push" resolves = ["Publish"] } action "Install" { uses = "actions/npm@master" args = "install" } action "Build" { uses = "actions/npm@master" args = "install" } action "Test" { uses = "actions/npm@master" needs = ["Build"] args = "build" } action "Tag" { uses = "actions/bin/filter@master\"" needs = ["Test"] args = "tag" } action "Publish" { uses = "actions/npm@master" needs = ["Tag"] args = "publish --access public" secrets = ["NPM_AUTH_TOKEN"] runs = "actions/npm@master" } ================================================ FILE: .gitignore ================================================ .DS_Store node_modules/ npm-debug.log package-lock.json ================================================ FILE: .husky/pre-commit ================================================ #!/bin/sh . "$(dirname "$0")/_/husky.sh" npx lint-staged ================================================ FILE: .prettierrc ================================================ { "singleQuote": true } ================================================ FILE: CODE_OF_CONDUCT.md ================================================ # Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at dangvanthanh@dangthanh.org. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html [homepage]: https://www.contributor-covenant.org For answers to common questions about this code of conduct, see https://www.contributor-covenant.org/faq ================================================ FILE: CONTRIBUTING.md ================================================ Thanks to contributers: - [Eduárd Moldován](https://github.com/edimoldovan) - [Dominique FERET](https://github.com/DominiqueFERET) - [comfuture](https://github.com/comfuture) - [旺旺](https://github.com/chengpan168) - [Tony Yip](https://github.com/tonyhhyip) - [Nedyalko Dyakov](https://github.com/ndyakov) - [Bryan Miller](https://github.com/bryanjamesmiller) - [Jeff Omiecinski](https://github.com/omiecinski) - [rlfscin](https://github.com/rlfscin) - [Renato Souza](https://github.com/renatosistemasvc) - [Fernando Morgenstern](https://github.com/fernandomm) - [Christoph-Wagner](https://github.com/Christoph-Wagner) - [Patrick Davey](https://github.com/patrickdavey) - [Michali Sarris](https://github.com/msarris) ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) 2019 Dang Van Thanh 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-ckeditor > Ckeditor using for Vue.js 2 ![](https://raw.githubusercontent.com/dangvanthanh/vue-ckeditor2/master/screenshot.png) ## Requirements - [Ckeditor](http://ckeditor.com/) >= 4 - [Vue.js](http://vuejs.org/) >= 2 ## Install ### CDN ```html ``` ### NPM ``` $ npm install vue-ckeditor2 --save ``` ## Usage > 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) ### Component Then in your component: ```vue ``` ### Props | Name | Type | Description | | ----------------------- | ---------- | ---------------------------------------------------------------------------- | | `name` | `String` | Name of instance ckedior. **Default: editor- ** | | `id` | `String` | Id of instance ckedior. **Default: editor-1** | | `types` | `String` | Types of ckedior. **Default: classic** | | `config` | `Object` | All configuration of ckeditor. **Default: {}** | | `instanceReadyCallback` | `Function` | Optional function that will be attached to CKEditor instanceReady event. | | `readOnlyMode` | `Boolean` | Option setReadOnly editor initializes in the proper mode. **Default: false** | ### Events | Name | Description | | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `blur` | Fired when the editor instance loses the input focus. | | `focus` | Fired when the editor instance receives the input focus. | | `contentDom` | Event fired when the editor content (its DOM structure) is ready | | `dialogDefinition` | Event fired when a dialog definition is about to be used to create a dialog into an editor instance | | `fileUploadRequest` | Event fired when the [file loader](https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_fileTools_fileLoader.html) should send XHR | | `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 | ## Build Setup You 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) ## Created By - [Dang Van Thanh](https://github.com/dangvanthanh) Thanks to [contributers](./CONTRIBUTING.md) ## License MIT © [Dang Van Thanh](http://dangthanh.org) ================================================ FILE: bili.config.js ================================================ module.exports = { plugins: { vue: true }, output: { format: ['umd', 'cjs', 'es'], moduleName: 'VueCkeditor', minify: true, fileName: 'vue-ckeditor2.[format].js', sourceMap: false } }; ================================================ FILE: dist/vue-ckeditor2.cjs.js ================================================ "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; ================================================ FILE: dist/vue-ckeditor2.es.js ================================================ 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}; ================================================ FILE: dist/vue-ckeditor2.esm.js ================================================ 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)); ================================================ FILE: dist/vue-ckeditor2.umd.js ================================================ !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)})); ================================================ FILE: package.json ================================================ { "name": "vue-ckeditor2", "version": "2.1.5", "description": "Ckeditor 4 using with Vue.js", "author": "Dang Van Thanh ", "main": "dist/vue-ckeditor2.cjs.js", "module": "dist/vue-ckeditor2.esm.js", "unpkg": "dist/vue-ckeditor2.umd.js", "scripts": { "build": "bili src/index.js --bundle-node-modules", "prepare": "husky install" }, "lint-staged": { "*.{js,json,vue},!dist/*.js": [ "prettier --write", "git add" ] }, "peerDependencies": { "ckeditor": ">= 4", "vue": ">= 2" }, "repository": { "type": "git", "url": "git+https://github.com/dangvanthanh/vue-ckeditor2.git" }, "keywords": [ "vue", "ckeditor", "vue-ckeditor" ], "license": "MIT", "devDependencies": { "bili": "^5.0.5", "husky": "8.0.3", "lint-staged": "13.1.0", "prettier": "^2.3.2", "rollup-plugin-vue": "5.0.0", "vue-template-compiler": "^2.6.14" } } ================================================ FILE: src/VueCkeditor.vue ================================================ ================================================ FILE: src/index.js ================================================ import VueCkeditor from './VueCkeditor.vue'; export default VueCkeditor;