浏览代码

Moved adapters to dedicated namespace.

Kamil Piechaczek 6 年之前
父节点
当前提交
f262a1bee2

+ 1 - 1
packages/ckeditor5-upload/docs/_snippets/features/base64-upload.js

@@ -6,7 +6,7 @@
 /* globals console, window, document */
 
 import ClassicEditor from '@ckeditor/ckeditor5-build-classic/src/ckeditor';
-import Base64UploadAdapter from '@ckeditor/ckeditor5-upload/src/base64uploadadapter';
+import Base64UploadAdapter from '@ckeditor/ckeditor5-upload/src/adapters/base64uploadadapter';
 
 ClassicEditor.builtinPlugins.push( Base64UploadAdapter );
 

+ 2 - 1
packages/ckeditor5-upload/docs/api/upload.md

@@ -16,7 +16,8 @@ See the {@link module:upload/filerepository~FileRepository} plugin documentation
 
 This repository contains the following upload adapters:
 
-* {@link module:upload/base64uploadadapter~Base64UploadAdapter `Base64UploadAdapter`} - plugin that converts images inserted into the editor into [Base64 strings](https://en.wikipedia.org/wiki/Base64) in the {@glink builds/guides/integration/saving-data editor output}.
+* {@link module:upload/adapters/base64uploadadapter~Base64UploadAdapter `Base64UploadAdapter`} - plugin that converts images inserted into the editor into [Base64 strings](https://en.wikipedia.org/wiki/Base64) in the {@glink builds/guides/integration/saving-data editor output}.
+* {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter `SimpleUploadAdapter`} - A plugin that enables file uploads in CKEditor 5 using the external side-server connection.
 
 ## Installation
 

+ 2 - 2
packages/ckeditor5-upload/docs/features/base64-upload-adapter.md

@@ -6,7 +6,7 @@ order: 40
 
 # Base64 upload adapter
 
-The {@link module:upload/base64uploadadapter~Base64UploadAdapter Base64 image upload adapter} plugin converts images inserted into the editor into [Base64 strings](https://en.wikipedia.org/wiki/Base64) in the {@link builds/guides/integration/saving-data editor output}.
+The {@link module:upload/adapters/base64uploadadapter~Base64UploadAdapter Base64 image upload adapter} plugin converts images inserted into the editor into [Base64 strings](https://en.wikipedia.org/wiki/Base64) in the {@link builds/guides/integration/saving-data editor output}.
 
 This kind of image upload does not require server processing – images are stored with the rest of the text and displayed by the web browser without additional requests. On the downside, this approach can bloat your database with very long data strings which, in theory, could have a negative impact on the performance.
 
@@ -32,7 +32,7 @@ To add this feature to your editor, install the [`@ckeditor/ckeditor5-upload`](h
 npm install --save @ckeditor/ckeditor5-upload
 ```
 
-Then add the {@link module:upload/base64uploadadapter~Base64UploadAdapter `Base64UploadAdapter`} to your plugin list:
+Then add the {@link module:upload/adapters/base64uploadadapter~Base64UploadAdapter `Base64UploadAdapter`} to your plugin list:
 
 ```js
 import Base64UploadAdapter from '@ckeditor/ckeditor5-upload/src/base64uploadadapter';

+ 2 - 2
packages/ckeditor5-upload/docs/features/simple-upload-adapter.md

@@ -6,7 +6,7 @@ order: 50
 
 # Simple Upload Adapter
 
-The {@link module:upload/simpleuploadadapter~SimpleUploadAdapter} plugin that enables file uploads in CKEditor 5 using the external side-server connection.
+The {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter} plugin that enables file uploads in CKEditor 5 using the external side-server connection.
 
 ## Installation
 
@@ -39,7 +39,7 @@ ClassicEditor
 
 ## Configuration
 
-All available options are defined in the {@link module:upload/simpleuploadadapter~SimpleUploadConfig} interface. 
+All available options are defined in the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} interface. 
 
  ## Contribute
 

+ 2 - 2
packages/ckeditor5-upload/src/base64uploadadapter.js

@@ -4,13 +4,13 @@
  */
 
 /**
- * @module upload/base64uploadadapter
+ * @module upload/adapters/base64uploadadapter
  */
 
 /* globals window */
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
-import FileRepository from './filerepository';
+import FileRepository from '../filerepository';
 
 /**
  * A plugin that converts images inserted into the editor into [Base64 strings](https://en.wikipedia.org/wiki/Base64)

+ 10 - 10
packages/ckeditor5-upload/src/simpleuploadadapter.js

@@ -4,13 +4,13 @@
  */
 
 /**
- * @module upload/simpleuploadadapter
+ * @module upload/adapters/simpleuploadadapter
  */
 
 /* globals XMLHttpRequest, FormData */
 
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
-import FileRepository from './filerepository';
+import FileRepository from '../filerepository';
 import log from '@ckeditor/ckeditor5-utils/src/log';
 
 /**
@@ -72,7 +72,7 @@ class Adapter {
 	 * Creates a new adapter instance.
 	 *
 	 * @param {module:upload/filerepository~FileLoader} loader
-	 * @param {module:upload/simpleuploadadapter~SimpleUploadConfig} options
+	 * @param {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} options
 	 * @param {String} options.uploadUrl A URL where the image will be sent.
 	 */
 	constructor( loader, options ) {
@@ -86,7 +86,7 @@ class Adapter {
 		/**
 		 * The configuration of the adapter.
 		 *
-		 * @member {module:upload/simpleuploadadapter~SimpleUploadConfig} #options
+		 * @member {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} #options
 		 */
 		this.options = options;
 	}
@@ -203,7 +203,7 @@ class Adapter {
 }
 
 /**
- * The configuration of the {@link module:upload/simpleuploadadapter~SimpleUploadAdapter simple upload adapter}.
+ * The configuration of the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter simple upload adapter}.
  *
  *		ClassicEditor
  *			.create( editorElement, {
@@ -223,18 +223,18 @@ class Adapter {
  */
 
 /**
- * The configuration of the {@link module:upload/simpleuploadadapter~SimpleUploadAdapter simple upload adapter}.
+ * The configuration of the {@link module:upload/adapters/simpleuploadadapter~SimpleUploadAdapter simple upload adapter}.
  *
- * Read more in {@link module:upload/simpleuploadadapter~SimpleUploadConfig}.
+ * Read more in {@link module:upload/adapters/simpleuploadadapter~SimpleUploadConfig}.
  *
- * @member {module:upload/simpleuploadadapter~SimpleUploadConfig} module:core/editor/editorconfig~EditorConfig#simpleUpload
+ * @member {module:upload/adapters/simpleuploadadapter~SimpleUploadConfig} module:core/editor/editorconfig~EditorConfig#simpleUpload
  */
 
 /**
  * The path (URL) to the server which handles the file upload. When specified, enables the automatic
  * upload of resources such as images inserted into the content.
  *
- * @member {String} module:upload/simpleuploadadapter~SimpleUploadConfig#uploadUrl
+ * @member {String} module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#uploadUrl
  */
 
 /**
@@ -253,5 +253,5 @@ class Adapter {
  *			.then( ... )
  *			.catch( ... );
  *
- * @member {Object.<String, String>} module:upload/simpleuploadadapter~SimpleUploadConfig#headers
+ * @member {Object.<String, String>} module:upload/adapters/simpleuploadadapter~SimpleUploadConfig#headers
  */

+ 3 - 3
packages/ckeditor5-upload/tests/base64uploadadapter.js

@@ -5,11 +5,11 @@
 
 /* globals window, setTimeout */
 
-import Base64UploadAdapter from '../src/base64uploadadapter';
-import FileRepository from '../src/filerepository';
+import Base64UploadAdapter from '../../src/adapters/base64uploadadapter';
+import FileRepository from '../../src/filerepository';
 import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
 import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';
-import { createNativeFileMock } from './_utils/mocks';
+import { createNativeFileMock } from '../_utils/mocks';
 
 describe( 'Base64UploadAdapter', () => {
 	let div, stubs;

+ 2 - 2
packages/ckeditor5-upload/tests/simpleuploadadapter.js

@@ -6,8 +6,8 @@
 /* globals document */
 
 import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictesteditor';
-import SimpleUploadAdapter from '../src/simpleuploadadapter';
-import FileRepository from '../src/filerepository';
+import SimpleUploadAdapter from '../../src/adapters/simpleuploadadapter';
+import FileRepository from '../../src/filerepository';
 import log from '@ckeditor/ckeditor5-utils/src/log';
 import { createNativeFileMock } from '@ckeditor/ckeditor5-upload/tests/_utils/mocks';
 import testUtils from '@ckeditor/ckeditor5-core/tests/_utils/utils';