@ckeditor/ckeditor5-easy-image
Version:
Easy Image feature for CKEditor 5.
4 lines • 2.1 kB
JavaScript
/*!
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/(()=>{var e={237:e=>{"use strict";e.exports=CKEditor5.dll},260:(e,t,r)=>{e.exports=r(237)("./src/upload.js")},584:(e,t,r)=>{e.exports=r(237)("./src/utils.js")},782:(e,t,r)=>{e.exports=r(237)("./src/core.js")}},t={};function r(a){var i=t[a];if(void 0!==i)return i.exports;var o=t[a]={exports:{}};return e[a](o,o.exports,r),o.exports}r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};(()=>{"use strict";r.r(a),r.d(a,{CloudServicesUploadAdapter:()=>o,EasyImage:()=>l});var e=r(782),t=r(584),i=r(260);class o extends e.Plugin{_uploadGateway;static get pluginName(){return"CloudServicesUploadAdapter"}static get isOfficialPlugin(){return!0}static get requires(){return["CloudServices",i.FileRepository]}init(){const e=this.editor,t=e.plugins.get("CloudServices"),r=t.token,a=t.uploadUrl;if(!r)return;const o=e.plugins.get("CloudServicesCore");this._uploadGateway=o.createUploadGateway(r,a),e.plugins.get(i.FileRepository).createUploadAdapter=e=>new s(this._uploadGateway,e)}}class s{uploadGateway;loader;fileUploader;constructor(e,t){this.uploadGateway=e,this.loader=t}upload(){return this.loader.file.then((e=>(this.fileUploader=this.uploadGateway.upload(e),this.fileUploader.on("progress",((e,t)=>{this.loader.uploadTotal=t.total,this.loader.uploaded=t.uploaded})),this.fileUploader.send())))}abort(){this.fileUploader.abort()}}class l extends e.Plugin{static get pluginName(){return"EasyImage"}static get isOfficialPlugin(){return!0}static get requires(){return[o,"ImageUpload"]}init(){const e=this.editor;e.plugins.has("ImageBlockEditing")||e.plugins.has("ImageInlineEditing")||(0,t.logWarning)("easy-image-image-feature-missing",e)}}})(),(window.CKEditor5=window.CKEditor5||{}).easyImage=a})();