浏览代码

Remove unnecessary API docs from "ImageUpload" plugin.

panr 5 年之前
父节点
当前提交
3e33753d3d
共有 2 个文件被更改,包括 0 次插入123 次删除
  1. 0 54
      packages/ckeditor5-image/src/imageupload.js
  2. 0 69
      packages/ckeditor5-image/src/imageupload/utils.js

+ 0 - 54
packages/ckeditor5-image/src/imageupload.js

@@ -83,57 +83,3 @@ export default class ImageUpload extends Plugin {
  * @member {Array.<String>} module:image/imageupload~ImageUploadConfig#types
  * @default [ 'jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff' ]
  */
-
-/**
- * Image upload panel view configuration.
- *
- * @protected
- * @member {module:image/imageupload~ImageUploadPanelConfig} module:image/imageupload~ImageUploadConfig#panel
- */
-
-/**
- * The configuration of the image upload dropdown panel view. Used by the image upload feature in the `@ckeditor/ckeditor5-image` package.
- *
- *		ClassicEditor
- *			.create( editorElement, {
- * 				image: {
- * 					upload: {
- * 						panel: ... // panel settings goes here
- * 					}
- * 				}
- *			} )
- *			.then( ... )
- *			.catch( ... );
- *
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
- *
- * @protected
- * @interface module:image/imageupload~ImageUploadPanelConfig
- */
-
-/**
- * The list of {@link module:image/imageupload~ImageUpload} integrations.
- *
- * The option accepts string tokens.
- * * for predefined integrations, we have two special strings: `insertImageViaUrl` and `openCKFinder`.
- * The former adds **Insert image via URL** feature, while the latter adds built-in **CKFinder** integration.
- * * for custom integrations, each string should be a name of the already registered component.
- * If you have a plugin `PluginX` that registers `pluginXButton` component, then the integration token
- * in that case should be `pluginXButton`.
- *
- *		// Add `insertImageViaUrl`, `openCKFinder` and custom `pluginXButton` integrations.
- *		const imageUploadConfig = {
- *			upload: {
- *				panel: {
- *					items: [
- *						'insertImageViaUrl',
- *						'openCKFinder',
- *						'pluginXButton'
- *					]
- *				}
- *			}
- *		};
- *
- * @member {Array.<String>} module:image/imageupload~ImageUploadPanelConfig#items
- * @default [ 'insertImageViaUrl' ]
- */

+ 0 - 69
packages/ckeditor5-image/src/imageupload/utils.js

@@ -9,9 +9,6 @@
 
 /* global fetch, File */
 
-import LabeledFieldView from '@ckeditor/ckeditor5-ui/src/labeledfield/labeledfieldview';
-import { createLabeledInputText } from '@ckeditor/ckeditor5-ui/src/labeledfield/utils';
-
 /**
  * Creates a regular expression used to test for image files.
  *
@@ -85,69 +82,3 @@ function getImageMimeType( blob, src ) {
 		return 'image/jpeg';
 	}
 }
-
-/**
- * Creates integrations object that will be passed to the
- * {@link module:image/imageupload/ui/imageuploadpanelview~ImageUploadPanelView}.
- *
- * @param {module:core/editor/editor~Editor} editor Editor instance.
- *
- * @returns {Object.<String, module:ui/view~View>} Integrations object.
- */
-export function prepareIntegrations( editor ) {
-	const panelItems = editor.config.get( 'image.upload.panel.items' );
-	const imageUploadUIPlugin = editor.plugins.get( 'ImageUploadUI' );
-
-	const PREDEFINED_INTEGRATIONS = {
-		'insertImageViaUrl': createLabeledInputView( editor.locale )
-	};
-
-	if ( !panelItems ) {
-		return PREDEFINED_INTEGRATIONS;
-	}
-
-	// Prepares ckfinder component for the `openCKFinder` integration token.
-	if ( panelItems.find( item => item === 'openCKFinder' ) && editor.ui.componentFactory.has( 'ckfinder' ) ) {
-		const ckFinderButton = editor.ui.componentFactory.create( 'ckfinder' );
-		ckFinderButton.set( {
-			withText: true,
-			class: 'ck-image-upload__ck-finder-button'
-		} );
-
-		// We want to close the dropdown panel view when user clicks the ckFinderButton.
-		ckFinderButton.delegate( 'execute' ).to( imageUploadUIPlugin, 'cancel' );
-
-		PREDEFINED_INTEGRATIONS.openCKFinder = ckFinderButton;
-	}
-
-	// Creates integrations object of valid views to pass it to the ImageUploadPanelView.
-	return panelItems.reduce( ( object, key ) => {
-		if ( PREDEFINED_INTEGRATIONS[ key ] ) {
-			object[ key ] = PREDEFINED_INTEGRATIONS[ key ];
-		} else if ( editor.ui.componentFactory.has( key ) ) {
-			object[ key ] = editor.ui.componentFactory.create( key );
-		}
-
-		return object;
-	}, {} );
-}
-
-/**
- * Creates labeled field view.
- *
- * @param {module:utils/locale~Locale} locale The localization services instance.
- *
- * @returns {module:ui/labeledfield/labeledfieldview~LabeledFieldView}
- */
-export function createLabeledInputView( locale ) {
-	const t = locale.t;
-	const labeledInputView = new LabeledFieldView( locale, createLabeledInputText );
-
-	labeledInputView.set( {
-		label: t( 'Insert image via URL' )
-	} );
-	labeledInputView.fieldView.placeholder = 'https://example.com/src/image.png';
-	labeledInputView.infoText = t( 'Paste the image source URL.' );
-
-	return labeledInputView;
-}