8
0
Szymon Kupś 9 лет назад
Родитель
Сommit
52ae2db6a8

+ 1 - 1
packages/ckeditor5-image/src/imagestyle/converters.js

@@ -7,7 +7,7 @@
  * @module image/imagestyle/converters
  */
 
-import { isImage, getStyleByValue } from './utils.js';
+import { isImage, getStyleByValue } from './utils';
 
 /**
  * Returns converter for `imageStyle` attribute. It can be used for adding, changing and removing the attribute.

+ 3 - 3
packages/ckeditor5-image/src/imagestyle/imagestyle.js

@@ -7,9 +7,9 @@
  * @module image/imagestyle/imagestyle
  */
 
-import Plugin from '../../core/plugin.js';
-import ImageStyleEngine from './imagestyleengine.js';
-import ButtonView from '../../ui/button/buttonview.js';
+import Plugin from 'ckeditor5-core/src/plugin';
+import ImageStyleEngine from './imagestyleengine';
+import ButtonView from 'ckeditor5-ui/src/button/buttonview';
 
 /**
  * The image style plugin.

+ 2 - 2
packages/ckeditor5-image/src/imagestyle/imagestylecommand.js

@@ -7,8 +7,8 @@
  * @module image/imagestyle/imagestylecommand
  */
 
-import Command from '../../core/command/command.js';
-import { isImage, getStyleByValue } from './utils.js';
+import Command from 'ckeditor5-core/src/command/command';
+import { isImage, getStyleByValue } from './utils';
 
 /**
  * The image style command. It is used to apply different image styles.

+ 9 - 7
packages/ckeditor5-image/src/imagestyle/imagestyleengine.js

@@ -7,10 +7,12 @@
  * @module image/imagestyle/imagestyleengine
  */
 
-import Plugin from '../../core/plugin.js';
-import ImageStyleCommand from './imagestylecommand.js';
-import ImageEngine from '../imageengine.js';
-import { viewToModelImageStyle, modelToViewSetStyle } from './converters.js';
+import Plugin from 'ckeditor5-core/src/plugin';
+import ImageStyleCommand from './imagestylecommand';
+import ImageEngine from '../imageengine';
+import { viewToModelImageStyle, modelToViewSetStyle } from './converters';
+import fullSizeIcon from 'ckeditor5-core/theme/icons/align-center.svg';
+import sideIcon from 'ckeditor5-core/theme/icons/align-right.svg';
 
 /**
  * The image style engine plugin. Sets default configuration, creates converters and registers
@@ -39,10 +41,10 @@ export default class ImageStyleEngine extends Plugin {
 		// Define default configuration.
 		editor.config.define( 'image.styles', [
 			// This option is equal to situation when no style is applied.
-			{ name: 'imageStyleFull', title: 'Full size image', icon: 'object-center', value: null },
+			{ name: 'imageStyleFull', title: 'Full size image', icon: fullSizeIcon, value: null },
 
 			// This represents side image.
-			{ name: 'imageStyleSide', title: 'Side image', icon: 'object-right', value: 'side', className: 'image-style-side' }
+			{ name: 'imageStyleSide', title: 'Side image', icon: sideIcon, value: 'side', className: 'image-style-side' }
 		] );
 
 		// Get configuration.
@@ -82,7 +84,7 @@ export default class ImageStyleEngine extends Plugin {
  * {@link module:ui/componentfactory~ComponentFactory ComponentFactory}.
  * @property {String} value Value used to store this style in model attribute.
  * When value is `null` style will be used as default one. Default style does not apply any CSS class to the view element.
- * @property {String} icon Icon name to use when creating style's toolbar button.
+ * @property {String} icon SVG icon representation to use when creating style's button.
  * @property {String} title Style's title.
  * @property {String} className CSS class used to represent style in view.
  */

+ 1 - 1
packages/ckeditor5-image/src/imagestyle/utils.js

@@ -7,7 +7,7 @@
  * @module image/imagestyle/utils
  */
 
-import ModelElement from '../../engine/model/element.js';
+import ModelElement from 'ckeditor5-engine/src/model/element';
 
 /**
  * Checks if provided modelElement is an instance of {@link module:engine/model/element~Element Element} and its name

+ 7 - 7
packages/ckeditor5-image/src/imagetoolbar.js

@@ -7,13 +7,13 @@
  * @module image/imagetoolbar
  */
 
-import Plugin from '../core/plugin.js';
-import ToolbarView from '../ui/toolbar/toolbarview.js';
-import BalloonPanelView from '../ui/balloonpanel/balloonpanelview.js';
-import Template from '../ui/template.js';
-import { isImageWidget } from './utils.js';
-import throttle from '../utils/lib/lodash/throttle.js';
-import global from '../utils/dom/global.js';
+import Plugin from 'ckeditor5-core/src/plugin';
+import ToolbarView from 'ckeditor5-ui/src/toolbar/toolbarview';
+import BalloonPanelView from 'ckeditor5-ui/src/balloonpanel/balloonpanelview';
+import Template from 'ckeditor5-ui/src/template';
+import { isImageWidget } from './utils';
+import throttle from 'ckeditor5-utils/src/lib/lodash/throttle';
+import global from 'ckeditor5-utils/src/dom/global';
 
 const arrowVOffset = BalloonPanelView.arrowVerticalOffset;
 const positions = {

+ 5 - 5
packages/ckeditor5-image/tests/imagestyle/imagestyle.js

@@ -3,11 +3,11 @@
  * For licensing, see LICENSE.md.
  */
 
-import ClassicTestEditor from 'tests/core/_utils/classictesteditor.js';
-import ImageStyle from 'ckeditor5/image/imagestyle/imagestyle.js';
-import ImageStyleEngine from 'ckeditor5/image/imagestyle/imagestyleengine.js';
-import ButtonView from 'ckeditor5/ui/button/buttonview.js';
-import global from 'ckeditor5/utils/dom/global.js';
+import ClassicTestEditor from 'ckeditor5-core/tests/_utils/classictesteditor';
+import ImageStyle from 'ckeditor5-image/src/imagestyle/imagestyle';
+import ImageStyleEngine from 'ckeditor5-image/src/imagestyle/imagestyleengine';
+import ButtonView from 'ckeditor5-ui/src/button/buttonview';
+import global from 'ckeditor5-utils/src/dom/global';
 
 describe( 'ImageStyle', () => {
 	let editor;

+ 3 - 3
packages/ckeditor5-image/tests/imagestyle/imagestylecommand.js

@@ -3,9 +3,9 @@
  * For licensing, see LICENSE.md.
  */
 
-import ModelTestEditor from 'tests/core/_utils/modeltesteditor.js';
-import ImageStyleCommand from 'ckeditor5/image/imagestyle/imagestylecommand.js';
-import { setData, getData } from 'ckeditor5/engine/dev-utils/model.js';
+import ModelTestEditor from 'ckeditor5-core/tests/_utils/modeltesteditor';
+import ImageStyleCommand from 'ckeditor5-image/src/imagestyle/imagestylecommand';
+import { setData, getData } from 'ckeditor5-engine/src/dev-utils/model';
 
 describe( 'ImageStyleCommand', () => {
 	const styles = [

+ 6 - 6
packages/ckeditor5-image/tests/imagestyle/imagestyleengine.js

@@ -3,12 +3,12 @@
  * For licensing, see LICENSE.md.
  */
 
-import VirtualTestEditor from 'tests/core/_utils/virtualtesteditor.js';
-import ImageStyleEngine from 'ckeditor5/image/imagestyle/imagestyleengine.js';
-import ImageEngine from 'ckeditor5/image/imageengine.js';
-import ImageStyleCommand from 'ckeditor5/image/imagestyle/imagestylecommand.js';
-import { getData as getModelData, setData as setModelData } from 'ckeditor5/engine/dev-utils/model.js';
-import { getData as getViewData } from 'ckeditor5/engine/dev-utils/view.js';
+import VirtualTestEditor from 'ckeditor5-core/tests/_utils/virtualtesteditor';
+import ImageStyleEngine from 'ckeditor5-image/src/imagestyle/imagestyleengine';
+import ImageEngine from 'ckeditor5-image/src/imageengine';
+import ImageStyleCommand from 'ckeditor5-image/src/imagestyle/imagestylecommand';
+import { getData as getModelData, setData as setModelData } from 'ckeditor5-engine/src/dev-utils/model';
+import { getData as getViewData } from 'ckeditor5-engine/src/dev-utils/view';
 
 describe( 'ImageStyleEngine', () => {
 	let editor, document, viewDocument;

+ 2 - 2
packages/ckeditor5-image/tests/imagestyle/utils.js

@@ -3,8 +3,8 @@
  * For licensing, see LICENSE.md.
  */
 
-import { isImage, getStyleByValue } from 'ckeditor5/image/imagestyle/utils.js';
-import ModelElement from 'ckeditor5/engine/model/element.js';
+import { isImage, getStyleByValue } from 'ckeditor5-image/src/imagestyle/utils';
+import ModelElement from 'ckeditor5-engine/src/model/element';
 
 describe( 'ImageStyle utils', () => {
 	describe( 'isImage', () => {

+ 8 - 8
packages/ckeditor5-image/tests/imagetoolbar.js

@@ -5,14 +5,14 @@
 
 /* global Event */
 
-import ClassicEditor from 'ckeditor5/editor-classic/classic.js';
-import ImageToolbar from 'ckeditor5/image/imagetoolbar.js';
-import Image from 'ckeditor5/image/image.js';
-import global from 'ckeditor5/utils/dom/global.js';
-import BalloonPanelView from 'ckeditor5/ui/balloonpanel/balloonpanelview.js';
-import Plugin from 'ckeditor5/core/plugin.js';
-import ButtonView from 'ckeditor5/ui/button/buttonview.js';
-import { setData } from 'ckeditor5/engine/dev-utils/model.js';
+import ClassicEditor from 'ckeditor5-editor-classic/src/classic';
+import ImageToolbar from 'ckeditor5-image/src/imagetoolbar';
+import Image from 'ckeditor5-image/src/image';
+import global from 'ckeditor5-utils/src/dom/global';
+import BalloonPanelView from 'ckeditor5-ui/src/balloonpanel/balloonpanelview';
+import Plugin from 'ckeditor5-core/src/plugin';
+import ButtonView from 'ckeditor5-ui/src/button/buttonview';
+import { setData } from 'ckeditor5-engine/src/dev-utils/model';
 
 describe( 'ImageToolbar', () => {
 	let editor, button, editingView, doc, panel;

+ 2 - 3
packages/ckeditor5-image/tests/manual/image.js

@@ -13,11 +13,10 @@ import HeadingPlugin from 'ckeditor5-heading/src/heading';
 import ImagePlugin from 'ckeditor5-image/src/image';
 import UndoPlugin from 'ckeditor5-undo/src/undo';
 import ClipboardPlugin from 'ckeditor5-clipboard/src/clipboard';
-import ImageStyle from 'ckeditor5-image/src/imagestyle/imagestyle';
 
 ClassicEditor.create( document.querySelector( '#editor' ), {
-	plugins: [ EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin, UndoPlugin, ClipboardPlugin, ImageStyle ],
-	toolbar: [ 'headings', 'undo', 'redo', 'imagestyle' ]
+	plugins: [ EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin, UndoPlugin, ClipboardPlugin ],
+	toolbar: [ 'headings', 'undo', 'redo' ]
 } )
 .then( editor => {
 	window.editor = editor;

+ 0 - 4
packages/ckeditor5-image/tests/manual/imagestyle.html

@@ -1,7 +1,3 @@
-<head>
-	<link rel="stylesheet" href="/theme/ckeditor.css">
-</head>
-
 <div id="editor">
 	<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla finibus consequat placerat. Vestibulum id tellus et mauris sagittis tincidunt quis id mauris. Curabitur consectetur lectus sit amet tellus mattis, non lobortis leo interdum. </p>
 	<figure class="image">

+ 10 - 10
packages/ckeditor5-image/tests/manual/imagestyle.js

@@ -5,16 +5,16 @@
 
 /* global document, console, window */
 
-import ClassicEditor from 'ckeditor5/editor-classic/classic.js';
-import EnterPlugin from 'ckeditor5/enter/enter.js';
-import TypingPlugin from 'ckeditor5/typing/typing.js';
-import ParagraphPlugin from 'ckeditor5/paragraph/paragraph.js';
-import HeadingPlugin from 'ckeditor5/heading/heading.js';
-import ImagePlugin from 'ckeditor5/image/image.js';
-import UndoPlugin from 'ckeditor5/undo/undo.js';
-import ClipboardPlugin from 'ckeditor5/clipboard/clipboard.js';
-import ImageStyle from 'ckeditor5/image/imagestyle/imagestyle.js';
-import ImageToolbar from 'ckeditor5/image/imagetoolbar.js';
+import ClassicEditor from 'ckeditor5-editor-classic/src/classic';
+import EnterPlugin from 'ckeditor5-enter/src/enter';
+import TypingPlugin from 'ckeditor5-typing/src/typing';
+import ParagraphPlugin from 'ckeditor5-paragraph/src/paragraph';
+import HeadingPlugin from 'ckeditor5-heading/src/heading';
+import ImagePlugin from 'ckeditor5-image/src/image';
+import UndoPlugin from 'ckeditor5-undo/src/undo';
+import ClipboardPlugin from 'ckeditor5-clipboard/src/clipboard';
+import ImageStyle from 'ckeditor5-image/src/imagestyle/imagestyle';
+import ImageToolbar from 'ckeditor5-image/src/imagetoolbar';
 
 ClassicEditor.create( document.querySelector( '#editor' ), {
 	plugins: [ ImageToolbar, EnterPlugin, TypingPlugin, ParagraphPlugin, HeadingPlugin, ImagePlugin, UndoPlugin, ClipboardPlugin, ImageStyle ],

+ 0 - 1
packages/ckeditor5-image/theme/icons/object-center.svg

@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"><path d="M2,16l16,0l0,1l-16,0l0,-1Zm15,-2l-14,0l0,-8l14,0l0,8Zm-1,-7l-12,0l0,6l12,0l0,-6Zm-14,-4l16,0l0,1l-16,0l0,-1Z" style="fill:#343434;"/></svg>

+ 0 - 1
packages/ckeditor5-image/theme/icons/object-left.svg

@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"><path d="M2,15l16,0l0,1l-16,0l0,-1Zm11,-3l5,0l0,1l-5,0l0,-1Zm-2,1l-9,0l0,-7l9,0l0,7Zm-1,-6l-7,0l0,5l7,0l0,-5Zm3,2l5,0l0,1l-5,0l0,-1Zm0,-3l5,0l0,1l-5,0l0,-1Zm-11,-3l16,0l0,1l-16,0l0,-1Z" style="fill:#343434;"/></svg>

+ 0 - 1
packages/ckeditor5-image/theme/icons/object-right.svg

@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"><path id="_-Curves-" d="M18,16l-16,0l0,-1l16,0l0,1Zm-11.022,-3l-4.978,0l0,-1l4.978,0l0,1Zm11.022,-7l0,7l-9,0l0,-7l9,0Zm-1,6l0,-5l-7,0l0,5l7,0Zm-10.022,-2l-4.978,0l0,-1l4.978,0l0,1Zm0,-3l-4.978,0l0,-1l4.978,0l0,1Zm11.022,-3l-16,0l0,-1l16,0l0,1Z" style="fill:#343434;"/></svg>