8
0
Просмотр исходного кода

Added WidgetResizer plugin class.

Reason why I'm adding a plugin is that in the end resizer feature needs editor instance.
Marek Lewandowski 6 лет назад
Родитель
Сommit
faea363e06
1 измененных файлов с 32 добавлено и 0 удалено
  1. 32 0
      packages/ckeditor5-widget/src/widgetresizer.js

+ 32 - 0
packages/ckeditor5-widget/src/widgetresizer.js

@@ -0,0 +1,32 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
+ */
+
+/**
+ * @module widget/widget
+ */
+
+import WidgetResizeFeature from './widgetresizefeature';
+import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
+
+/**
+ * The base class for widget features. This type provides a common API for reusable features of widgets.
+ */
+export default class WidgetResizer extends Plugin {
+	/**
+	 * @inheritDoc
+	 */
+	static get pluginName() {
+		return 'WidgetResizer';
+	}
+
+	apply( widgetElement, writer ) {
+		// @todo inline the logic
+		const ret = new WidgetResizeFeature();
+
+		ret.apply( widgetElement, writer );
+
+		return ret;
+	}
+}