@ckeditor/ckeditor5-easy-image 41.4.2 → 42.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,6 +19,12 @@ See the [Easy Image integration](https://ckeditor.com/docs/ckeditor5/latest/feat
19
19
 
20
20
  Check out the comprehensive [image upload](https://ckeditor.com/docs/ckeditor5/latest/features/images/image-upload/image-upload.html) guide to learn about other ways to upload images into CKEditor 5.
21
21
 
22
+ ## Installation
23
+
24
+ ```bash
25
+ npm install ckeditor5
26
+ ```
27
+
22
28
  ## License
23
29
 
24
30
  Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html). For full details about the license, please check the `LICENSE.md` file or [https://ckeditor.com/legal/ckeditor-oss-license](https://ckeditor.com/legal/ckeditor-oss-license).
package/dist/index.js CHANGED
@@ -6,23 +6,31 @@ import { Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';
6
6
  import { logWarning } from '@ckeditor/ckeditor5-utils/dist/index.js';
7
7
  import { FileRepository } from '@ckeditor/ckeditor5-upload/dist/index.js';
8
8
 
9
- class CloudServicesUploadAdapter extends Plugin {
9
+ /**
10
+ * A plugin that enables upload to [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/).
11
+ *
12
+ * It is mainly used by the {@link module:easy-image/easyimage~EasyImage} feature.
13
+ *
14
+ * After enabling this adapter you need to configure the CKEditor Cloud Services integration through
15
+ * {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig `config.cloudServices`}.
16
+ */ class CloudServicesUploadAdapter extends Plugin {
17
+ _uploadGateway;
10
18
  /**
11
- * @inheritDoc
12
- */ static get pluginName() {
19
+ * @inheritDoc
20
+ */ static get pluginName() {
13
21
  return 'CloudServicesUploadAdapter';
14
22
  }
15
23
  /**
16
- * @inheritDoc
17
- */ static get requires() {
24
+ * @inheritDoc
25
+ */ static get requires() {
18
26
  return [
19
27
  'CloudServices',
20
28
  FileRepository
21
29
  ];
22
30
  }
23
31
  /**
24
- * @inheritDoc
25
- */ init() {
32
+ * @inheritDoc
33
+ */ init() {
26
34
  const editor = this.editor;
27
35
  const cloudServices = editor.plugins.get('CloudServices');
28
36
  const token = cloudServices.token;
@@ -38,6 +46,13 @@ class CloudServicesUploadAdapter extends Plugin {
38
46
  }
39
47
  }
40
48
  class Adapter {
49
+ uploadGateway;
50
+ loader;
51
+ fileUploader;
52
+ constructor(uploadGateway, loader){
53
+ this.uploadGateway = uploadGateway;
54
+ this.loader = loader;
55
+ }
41
56
  upload() {
42
57
  return this.loader.file.then((file)=>{
43
58
  this.fileUploader = this.uploadGateway.upload(file);
@@ -51,43 +66,62 @@ class Adapter {
51
66
  abort() {
52
67
  this.fileUploader.abort();
53
68
  }
54
- constructor(uploadGateway, loader){
55
- this.uploadGateway = uploadGateway;
56
- this.loader = loader;
57
- }
58
69
  }
59
70
 
60
- class EasyImage extends Plugin {
71
+ /**
72
+ * The Easy Image feature, which makes the image upload in CKEditor 5 possible with virtually zero
73
+ * server setup. A part of the [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)
74
+ * family.
75
+ *
76
+ * This is a "glue" plugin which enables:
77
+ *
78
+ * * {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter}.
79
+ *
80
+ * This plugin requires plugin to be present in the editor configuration:
81
+ *
82
+ * * {@link module:image/image~Image},
83
+ * * {@link module:image/imageupload~ImageUpload},
84
+ *
85
+ * See the {@glink features/images/image-upload/easy-image "Easy Image integration" guide} to learn how to configure
86
+ * and use this feature.
87
+ *
88
+ * Check out the {@glink features/images/image-upload/image-upload comprehensive "Image upload" guide} to learn about
89
+ * other ways to upload images into CKEditor 5.
90
+ *
91
+ * **Note**: After enabling the Easy Image plugin you need to configure the
92
+ * [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)
93
+ * integration through {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig `config.cloudServices`}.
94
+ */ class EasyImage extends Plugin {
61
95
  /**
62
- * @inheritDoc
63
- */ static get pluginName() {
96
+ * @inheritDoc
97
+ */ static get pluginName() {
64
98
  return 'EasyImage';
65
99
  }
66
100
  /**
67
- * @inheritDoc
68
- */ static get requires() {
101
+ * @inheritDoc
102
+ */ static get requires() {
69
103
  return [
70
104
  CloudServicesUploadAdapter,
71
105
  'ImageUpload'
72
106
  ];
73
107
  }
74
108
  /**
75
- * @inheritDoc
76
- */ init() {
109
+ * @inheritDoc
110
+ */ init() {
77
111
  const editor = this.editor;
78
112
  if (!editor.plugins.has('ImageBlockEditing') && !editor.plugins.has('ImageInlineEditing')) {
79
113
  /**
80
- * The Easy Image feature requires one of the following plugins to be loaded to work correctly:
81
- *
82
- * * {@link module:image/imageblock~ImageBlock},
83
- * * {@link module:image/imageinline~ImageInline},
84
- * * {@link module:image/image~Image} (loads both `ImageBlock` and `ImageInline`)
85
- *
86
- * Please make sure your editor configuration is correct.
87
- *
88
- * @error easy-image-image-feature-missing
89
- * @param {module:core/editor/editor~Editor} editor
90
- */ logWarning('easy-image-image-feature-missing', editor);
114
+ * The Easy Image feature requires one of the following plugins to be loaded to work correctly:
115
+ *
116
+ * * {@link module:image/imageblock~ImageBlock},
117
+ * * {@link module:image/imageinline~ImageInline},
118
+ * * {@link module:image/image~Image} (loads both `ImageBlock` and `ImageInline`)
119
+ *
120
+ * Please make sure your editor configuration is correct.
121
+ *
122
+ * @error easy-image-image-feature-missing
123
+ * @param {module:core/editor/editor~Editor} editor
124
+ */ logWarning('easy-image-image-feature-missing', editor);
91
125
  }
92
126
  }
93
127
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js","../src/cloudservicesuploadadapter.ts","../src/easyimage.ts"],"names":["CloudServicesUploadAdapter","Plugin","pluginName","requires","FileRepository","init","editor","cloudServices","plugins","get","token","uploadUrl","cloudServicesCore","_uploadGateway","createUploadGateway","createUploadAdapter","loader","Adapter","upload","file","then","fileUploader","uploadG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AC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM;AEbzD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACHC,UAAAA,CAAY,CAAA,IAAA,CAAA,KAAA,CAAA,KAAA,CAAA,OAAA,CAAA,OAAA,CAAoC5B,CAAAA,CAAAA,MAAAA,CAAAA,CAAAA;AAChD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACF,CAAA,CAAA,CAAA,CAAA,CAAA;AACA,CAAA;AFcD;AACA,MAAM,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AACjD,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG","file":"index.js.map","sourcesContent":["import { Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';\nimport { logWarning } from '@ckeditor/ckeditor5-utils/dist/index.js';\nimport { FileRepository } from '@ckeditor/ckeditor5-upload/dist/index.js';\n\nclass CloudServicesUploadAdapter extends Plugin {\n /**\n * @inheritDoc\n */ static get pluginName() {\n return 'CloudServicesUploadAdapter';\n }\n /**\n * @inheritDoc\n */ static get requires() {\n return [\n 'CloudServices',\n FileRepository\n ];\n }\n /**\n * @inheritDoc\n */ init() {\n const editor = this.editor;\n const cloudServices = editor.plugins.get('CloudServices');\n const token = cloudServices.token;\n const uploadUrl = cloudServices.uploadUrl;\n if (!token) {\n return;\n }\n const cloudServicesCore = editor.plugins.get('CloudServicesCore');\n this._uploadGateway = cloudServicesCore.createUploadGateway(token, uploadUrl);\n editor.plugins.get(FileRepository).createUploadAdapter = (loader)=>{\n return new Adapter(this._uploadGateway, loader);\n };\n }\n}\nclass Adapter {\n upload() {\n return this.loader.file.then((file)=>{\n this.fileUploader = this.uploadGateway.upload(file);\n this.fileUploader.on('progress', (evt, data)=>{\n this.loader.uploadTotal = data.total;\n this.loader.uploaded = data.uploaded;\n });\n return this.fileUploader.send();\n });\n }\n abort() {\n this.fileUploader.abort();\n }\n constructor(uploadGateway, loader){\n this.uploadGateway = uploadGateway;\n this.loader = loader;\n }\n}\n\nclass EasyImage extends Plugin {\n /**\n * @inheritDoc\n */ static get pluginName() {\n return 'EasyImage';\n }\n /**\n * @inheritDoc\n */ static get requires() {\n return [\n CloudServicesUploadAdapter,\n 'ImageUpload'\n ];\n }\n /**\n * @inheritDoc\n */ init() {\n const editor = this.editor;\n if (!editor.plugins.has('ImageBlockEditing') && !editor.plugins.has('ImageInlineEditing')) {\n /**\n * The Easy Image feature requires one of the following plugins to be loaded to work correctly:\n *\n * * {@link module:image/imageblock~ImageBlock},\n * * {@link module:image/imageinline~ImageInline},\n * * {@link module:image/image~Image} (loads both `ImageBlock` and `ImageInline`)\n *\n * Please make sure your editor configuration is correct.\n *\n * @error easy-image-image-feature-missing\n * @param {module:core/editor/editor~Editor} editor\n */ logWarning('easy-image-image-feature-missing', editor);\n }\n }\n}\n\nexport { CloudServicesUploadAdapter, EasyImage };\n//# sourceMappingURL=index.js.map\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n* @module easy-image/cloudservicesuploadadapter\n*/\n\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { FileRepository, type FileLoader, type UploadAdapter } from 'ckeditor5/src/upload.js';\nimport type { CloudServicesCore, CloudServices, UploadGateway, FileUploader } from '@ckeditor/ckeditor5-cloud-services';\n\n/**\n * A plugin that enables upload to [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/).\n *\n * It is mainly used by the {@link module:easy-image/easyimage~EasyImage} feature.\n *\n * After enabling this adapter you need to configure the CKEditor Cloud Services integration through\n * {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig `config.cloudServices`}.\n */\nexport default class CloudServicesUploadAdapter extends Plugin {\n\tprivate _uploadGateway?: UploadGateway;\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'CloudServicesUploadAdapter' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get requires() {\n\t\treturn [ 'CloudServices', FileRepository ] as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\n\t\tconst editor = this.editor;\n\n\t\tconst cloudServices: CloudServices = editor.plugins.get( 'CloudServices' );\n\n\t\tconst token = cloudServices.token;\n\t\tconst uploadUrl = cloudServices.uploadUrl;\n\n\t\tif ( !token ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cloudServicesCore: CloudServicesCore = editor.plugins.get( 'CloudServicesCore' );\n\t\tthis._uploadGateway = cloudServicesCore.createUploadGateway( token, uploadUrl! );\n\n\t\teditor.plugins.get( FileRepository ).createUploadAdapter = loader => {\n\t\t\treturn new Adapter( this._uploadGateway!, loader );\n\t\t};\n\t}\n}\n\nclass Adapter implements UploadAdapter {\n\tprivate uploadGateway: UploadGateway;\n\tprivate loader: FileLoader;\n\tprivate fileUploader?: FileUploader;\n\n\tconstructor( uploadGateway: UploadGateway, loader: FileLoader ) {\n\t\tthis.uploadGateway = uploadGateway;\n\n\t\tthis.loader = loader;\n\t}\n\n\tpublic upload() {\n\t\treturn this.loader.file.then( file => {\n\t\t\tthis.fileUploader = this.uploadGateway.upload( file! );\n\n\t\t\tthis.fileUploader.on( 'progress', ( evt, data ) => {\n\t\t\t\tthis.loader.uploadTotal = data.total;\n\t\t\t\tthis.loader.uploaded = data.uploaded;\n\t\t\t} );\n\n\t\t\treturn this.fileUploader.send();\n\t\t} );\n\t}\n\n\tpublic abort() {\n\t\tthis.fileUploader!.abort();\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module easy-image/easyimage\n */\n\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { logWarning } from 'ckeditor5/src/utils.js';\n\nimport CloudServicesUploadAdapter from './cloudservicesuploadadapter.js';\n\n/**\n * The Easy Image feature, which makes the image upload in CKEditor 5 possible with virtually zero\n * server setup. A part of the [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)\n * family.\n *\n * This is a \"glue\" plugin which enables:\n *\n * * {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter}.\n *\n * This plugin requires plugin to be present in the editor configuration:\n *\n * * {@link module:image/image~Image},\n * * {@link module:image/imageupload~ImageUpload},\n *\n * See the {@glink features/images/image-upload/easy-image \"Easy Image integration\" guide} to learn how to configure\n * and use this feature.\n *\n * Check out the {@glink features/images/image-upload/image-upload comprehensive \"Image upload\" guide} to learn about\n * other ways to upload images into CKEditor 5.\n *\n * **Note**: After enabling the Easy Image plugin you need to configure the\n * [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)\n * integration through {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig `config.cloudServices`}.\n */\nexport default class EasyImage extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'EasyImage' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get requires() {\n\t\treturn [ CloudServicesUploadAdapter, 'ImageUpload' ] as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\n\t\tconst editor = this.editor;\n\n\t\tif ( !editor.plugins.has( 'ImageBlockEditing' ) && !editor.plugins.has( 'ImageInlineEditing' ) ) {\n\t\t\t/**\n\t\t\t * The Easy Image feature requires one of the following plugins to be loaded to work correctly:\n\t\t\t *\n\t\t\t * * {@link module:image/imageblock~ImageBlock},\n\t\t\t * * {@link module:image/imageinline~ImageInline},\n\t\t\t * * {@link module:image/image~Image} (loads both `ImageBlock` and `ImageInline`)\n\t\t\t *\n\t\t\t * Please make sure your editor configuration is correct.\n\t\t\t *\n\t\t\t * @error easy-image-image-feature-missing\n\t\t\t * @param {module:core/editor/editor~Editor} editor\n\t\t\t */\n\t\t\tlogWarning( 'easy-image-image-feature-missing', editor );\n\t\t}\n\t}\n}\n"]}
1
+ {"version":3,"sources":["index.js","../src/cloudservicesuploadadapter.ts","../src/easyimage.ts"],"names":["CloudServicesUploadAdapter","Plugin","_uploadGateway","pluginName","requires","FileRepository","editor","cloudServices","plugins","get","token","uploadUrl","cloudServicesCore","createUploadGateway","createUploadAdapter","loader","Adapter","uploadGateway","fileUploader","constructor","upload","file","then","on","evt","data","uploadTotal","total","uploaded","send","abort","EasyImage","has","logWarning"],"mappings":";;;;AAAA,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAChE,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACrE,MAAM,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC1E;ACUA,CAAA,CAAA,CAAA;ADRA,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC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AAA,CAAA,CAAA;AACD,CAAA,CAAA,CAAA,CAAA,CAAA;AACD,CAAA;AFgDA;AACA,MAAM,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;AACjD,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG","file":"index.js.map","sourcesContent":["import { Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';\nimport { logWarning } from '@ckeditor/ckeditor5-utils/dist/index.js';\nimport { FileRepository } from '@ckeditor/ckeditor5-upload/dist/index.js';\n\n/**\n * A plugin that enables upload to [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/).\n *\n * It is mainly used by the {@link module:easy-image/easyimage~EasyImage} feature.\n *\n * After enabling this adapter you need to configure the CKEditor Cloud Services integration through\n * {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig `config.cloudServices`}.\n */ class CloudServicesUploadAdapter extends Plugin {\n _uploadGateway;\n /**\n\t * @inheritDoc\n\t */ static get pluginName() {\n return 'CloudServicesUploadAdapter';\n }\n /**\n\t * @inheritDoc\n\t */ static get requires() {\n return [\n 'CloudServices',\n FileRepository\n ];\n }\n /**\n\t * @inheritDoc\n\t */ init() {\n const editor = this.editor;\n const cloudServices = editor.plugins.get('CloudServices');\n const token = cloudServices.token;\n const uploadUrl = cloudServices.uploadUrl;\n if (!token) {\n return;\n }\n const cloudServicesCore = editor.plugins.get('CloudServicesCore');\n this._uploadGateway = cloudServicesCore.createUploadGateway(token, uploadUrl);\n editor.plugins.get(FileRepository).createUploadAdapter = (loader)=>{\n return new Adapter(this._uploadGateway, loader);\n };\n }\n}\nclass Adapter {\n uploadGateway;\n loader;\n fileUploader;\n constructor(uploadGateway, loader){\n this.uploadGateway = uploadGateway;\n this.loader = loader;\n }\n upload() {\n return this.loader.file.then((file)=>{\n this.fileUploader = this.uploadGateway.upload(file);\n this.fileUploader.on('progress', (evt, data)=>{\n this.loader.uploadTotal = data.total;\n this.loader.uploaded = data.uploaded;\n });\n return this.fileUploader.send();\n });\n }\n abort() {\n this.fileUploader.abort();\n }\n}\n\n/**\n * The Easy Image feature, which makes the image upload in CKEditor 5 possible with virtually zero\n * server setup. A part of the [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)\n * family.\n *\n * This is a \"glue\" plugin which enables:\n *\n * * {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter}.\n *\n * This plugin requires plugin to be present in the editor configuration:\n *\n * * {@link module:image/image~Image},\n * * {@link module:image/imageupload~ImageUpload},\n *\n * See the {@glink features/images/image-upload/easy-image \"Easy Image integration\" guide} to learn how to configure\n * and use this feature.\n *\n * Check out the {@glink features/images/image-upload/image-upload comprehensive \"Image upload\" guide} to learn about\n * other ways to upload images into CKEditor 5.\n *\n * **Note**: After enabling the Easy Image plugin you need to configure the\n * [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)\n * integration through {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig `config.cloudServices`}.\n */ class EasyImage extends Plugin {\n /**\n\t * @inheritDoc\n\t */ static get pluginName() {\n return 'EasyImage';\n }\n /**\n\t * @inheritDoc\n\t */ static get requires() {\n return [\n CloudServicesUploadAdapter,\n 'ImageUpload'\n ];\n }\n /**\n\t * @inheritDoc\n\t */ init() {\n const editor = this.editor;\n if (!editor.plugins.has('ImageBlockEditing') && !editor.plugins.has('ImageInlineEditing')) {\n /**\n\t\t\t * The Easy Image feature requires one of the following plugins to be loaded to work correctly:\n\t\t\t *\n\t\t\t * * {@link module:image/imageblock~ImageBlock},\n\t\t\t * * {@link module:image/imageinline~ImageInline},\n\t\t\t * * {@link module:image/image~Image} (loads both `ImageBlock` and `ImageInline`)\n\t\t\t *\n\t\t\t * Please make sure your editor configuration is correct.\n\t\t\t *\n\t\t\t * @error easy-image-image-feature-missing\n\t\t\t * @param {module:core/editor/editor~Editor} editor\n\t\t\t */ logWarning('easy-image-image-feature-missing', editor);\n }\n }\n}\n\nexport { CloudServicesUploadAdapter, EasyImage };\n//# sourceMappingURL=index.js.map\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n* @module easy-image/cloudservicesuploadadapter\n*/\n\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { FileRepository, type FileLoader, type UploadAdapter } from 'ckeditor5/src/upload.js';\nimport type { CloudServicesCore, CloudServices, UploadGateway, FileUploader } from '@ckeditor/ckeditor5-cloud-services';\n\n/**\n * A plugin that enables upload to [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/).\n *\n * It is mainly used by the {@link module:easy-image/easyimage~EasyImage} feature.\n *\n * After enabling this adapter you need to configure the CKEditor Cloud Services integration through\n * {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig `config.cloudServices`}.\n */\nexport default class CloudServicesUploadAdapter extends Plugin {\n\tprivate _uploadGateway?: UploadGateway;\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'CloudServicesUploadAdapter' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get requires() {\n\t\treturn [ 'CloudServices', FileRepository ] as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\n\t\tconst editor = this.editor;\n\n\t\tconst cloudServices: CloudServices = editor.plugins.get( 'CloudServices' );\n\n\t\tconst token = cloudServices.token;\n\t\tconst uploadUrl = cloudServices.uploadUrl;\n\n\t\tif ( !token ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst cloudServicesCore: CloudServicesCore = editor.plugins.get( 'CloudServicesCore' );\n\t\tthis._uploadGateway = cloudServicesCore.createUploadGateway( token, uploadUrl! );\n\n\t\teditor.plugins.get( FileRepository ).createUploadAdapter = loader => {\n\t\t\treturn new Adapter( this._uploadGateway!, loader );\n\t\t};\n\t}\n}\n\nclass Adapter implements UploadAdapter {\n\tprivate uploadGateway: UploadGateway;\n\tprivate loader: FileLoader;\n\tprivate fileUploader?: FileUploader;\n\n\tconstructor( uploadGateway: UploadGateway, loader: FileLoader ) {\n\t\tthis.uploadGateway = uploadGateway;\n\n\t\tthis.loader = loader;\n\t}\n\n\tpublic upload() {\n\t\treturn this.loader.file.then( file => {\n\t\t\tthis.fileUploader = this.uploadGateway.upload( file! );\n\n\t\t\tthis.fileUploader.on( 'progress', ( evt, data ) => {\n\t\t\t\tthis.loader.uploadTotal = data.total;\n\t\t\t\tthis.loader.uploaded = data.uploaded;\n\t\t\t} );\n\n\t\t\treturn this.fileUploader.send();\n\t\t} );\n\t}\n\n\tpublic abort() {\n\t\tthis.fileUploader!.abort();\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license\n */\n\n/**\n * @module easy-image/easyimage\n */\n\nimport { Plugin } from 'ckeditor5/src/core.js';\nimport { logWarning } from 'ckeditor5/src/utils.js';\n\nimport CloudServicesUploadAdapter from './cloudservicesuploadadapter.js';\n\n/**\n * The Easy Image feature, which makes the image upload in CKEditor 5 possible with virtually zero\n * server setup. A part of the [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)\n * family.\n *\n * This is a \"glue\" plugin which enables:\n *\n * * {@link module:easy-image/cloudservicesuploadadapter~CloudServicesUploadAdapter}.\n *\n * This plugin requires plugin to be present in the editor configuration:\n *\n * * {@link module:image/image~Image},\n * * {@link module:image/imageupload~ImageUpload},\n *\n * See the {@glink features/images/image-upload/easy-image \"Easy Image integration\" guide} to learn how to configure\n * and use this feature.\n *\n * Check out the {@glink features/images/image-upload/image-upload comprehensive \"Image upload\" guide} to learn about\n * other ways to upload images into CKEditor 5.\n *\n * **Note**: After enabling the Easy Image plugin you need to configure the\n * [CKEditor Cloud Services](https://ckeditor.com/ckeditor-cloud-services/)\n * integration through {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig `config.cloudServices`}.\n */\nexport default class EasyImage extends Plugin {\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get pluginName() {\n\t\treturn 'EasyImage' as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic static get requires() {\n\t\treturn [ CloudServicesUploadAdapter, 'ImageUpload' ] as const;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tpublic init(): void {\n\t\tconst editor = this.editor;\n\n\t\tif ( !editor.plugins.has( 'ImageBlockEditing' ) && !editor.plugins.has( 'ImageInlineEditing' ) ) {\n\t\t\t/**\n\t\t\t * The Easy Image feature requires one of the following plugins to be loaded to work correctly:\n\t\t\t *\n\t\t\t * * {@link module:image/imageblock~ImageBlock},\n\t\t\t * * {@link module:image/imageinline~ImageInline},\n\t\t\t * * {@link module:image/image~Image} (loads both `ImageBlock` and `ImageInline`)\n\t\t\t *\n\t\t\t * Please make sure your editor configuration is correct.\n\t\t\t *\n\t\t\t * @error easy-image-image-feature-missing\n\t\t\t * @param {module:core/editor/editor~Editor} editor\n\t\t\t */\n\t\t\tlogWarning( 'easy-image-image-feature-missing', editor );\n\t\t}\n\t}\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-easy-image",
3
- "version": "41.4.2",
3
+ "version": "42.0.0-alpha.0",
4
4
  "description": "Easy Image feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -13,7 +13,7 @@
13
13
  "type": "module",
14
14
  "main": "src/index.js",
15
15
  "dependencies": {
16
- "ckeditor5": "41.4.2"
16
+ "ckeditor5": "42.0.0-alpha.0"
17
17
  },
18
18
  "author": "CKSource (http://cksource.com/)",
19
19
  "license": "GPL-2.0-or-later",