Răsfoiți Sursa

Merge branch 'no-compilation'

Piotrek Koszuliński 9 ani în urmă
părinte
comite
417d0127e4

+ 7 - 7
packages/ckeditor5-list/src/converters.js

@@ -7,15 +7,15 @@
  * @module list/converters
  */
 
-import ViewListItemElement from './viewlistitemelement.js';
+import ViewListItemElement from './viewlistitemelement';
 
-import ModelElement from '../engine/model/element.js';
-import ModelPosition from '../engine/model/position.js';
+import ModelElement from 'ckeditor5-engine/src/model/element';
+import ModelPosition from 'ckeditor5-engine/src/model/position';
 
-import ViewContainerElement from '../engine/view/containerelement.js';
-import ViewPosition from '../engine/view/position.js';
-import ViewRange from '../engine/view/range.js';
-import viewWriter from '../engine/view/writer.js';
+import ViewContainerElement from 'ckeditor5-engine/src/view/containerelement';
+import ViewPosition from 'ckeditor5-engine/src/view/position';
+import ViewRange from 'ckeditor5-engine/src/view/range';
+import viewWriter from 'ckeditor5-engine/src/view/writer';
 
 /**
  * Model to view converter for `listItem` model element insertion.

+ 2 - 2
packages/ckeditor5-list/src/indentcommand.js

@@ -7,8 +7,8 @@
  * @module list/indentcommand
  */
 
-import Command from '../core/command/command.js';
-import { getClosestListItem } from './utils.js';
+import Command from 'ckeditor5-core/src/command/command';
+import { getClosestListItem } from './utils';
 
 /**
  * The list indent command. It is used by the {@link module:list/list~List list feature}.

+ 12 - 8
packages/ckeditor5-list/src/list.js

@@ -7,10 +7,13 @@
  * @module list/list
  */
 
-import Plugin from '../core/plugin.js';
-import ListEngine from './listengine.js';
-import ButtonView from '../ui/button/buttonview.js';
-import { parseKeystroke } from '../utils/keyboard.js';
+import Plugin from 'ckeditor5-core/src/plugin';
+import ListEngine from './listengine';
+import ButtonView from 'ckeditor5-ui/src/button/buttonview';
+import { parseKeystroke } from 'ckeditor5-utils/src/keyboard';
+
+import numberedListIcon from '../theme/icons/numberedlist.svg';
+import bulletedListIcon from '../theme/icons/bulletedlist.svg';
 
 /**
  * The lists feature. It introduces the `numberedList` and `bulletedList` buttons which
@@ -34,8 +37,8 @@ export default class List extends Plugin {
 	init() {
 		// Create two buttons and link them with numberedList and bulletedList commands.
 		const t = this.editor.t;
-		this._addButton( 'numberedList', t( 'Numbered List' ) );
-		this._addButton( 'bulletedList', t( 'Bulleted List' ) );
+		this._addButton( 'numberedList', t( 'Numbered List' ), numberedListIcon );
+		this._addButton( 'bulletedList', t( 'Bulleted List' ), bulletedListIcon );
 
 		// Overwrite default enter key behavior.
 		// If enter key is pressed with selection collapsed in empty list item, outdent it instead of breaking it.
@@ -82,8 +85,9 @@ export default class List extends Plugin {
 	 * @private
 	 * @param {String} commandName Name of the command.
 	 * @param {Object} label Button label.
+	 * @param {String} icon Source of the icon.
 	 */
-	_addButton( commandName, label ) {
+	_addButton( commandName, label, icon ) {
 		const editor = this.editor;
 		const command = editor.commands.get( commandName );
 
@@ -92,7 +96,7 @@ export default class List extends Plugin {
 
 			buttonView.set( {
 				label: label,
-				icon: commandName.toLowerCase()
+				icon: icon
 			} );
 
 			// Bind button model to command.

+ 2 - 2
packages/ckeditor5-list/src/listcommand.js

@@ -7,8 +7,8 @@
  * @module list/listcommand
  */
 
-import Command from '../core/command/command.js';
-import { getClosestListItem, getSelectedBlocks, getPositionBeforeBlock } from './utils.js';
+import Command from 'ckeditor5-core/src/command/command';
+import { getClosestListItem, getSelectedBlocks, getPositionBeforeBlock } from './utils';
 
 /**
  * The list command. It is used by the {@link module:list/list~List list feature}.

+ 4 - 4
packages/ckeditor5-list/src/listengine.js

@@ -7,9 +7,9 @@
  * @module list/listengine
  */
 
-import Plugin from '../core/plugin.js';
-import ListCommand from './listcommand.js';
-import IndentCommand from './indentcommand.js';
+import Plugin from 'ckeditor5-core/src/plugin';
+import ListCommand from './listcommand';
+import IndentCommand from './indentcommand';
 
 import {
 	cleanList,
@@ -23,7 +23,7 @@ import {
 	viewModelConverter,
 	modelToViewPosition,
 	viewToModelPosition
-} from './converters.js';
+} from './converters';
 
 /**
  * The engine of the lists feature. It handles creating, editing and removing lists and list items.

+ 1 - 1
packages/ckeditor5-list/src/utils.js

@@ -9,7 +9,7 @@
  * @module list/utils
  */
 
-import Position from '../engine/model/position.js';
+import Position from 'ckeditor5-engine/src/model/position';
 
 /**
  * For given {@link module:engine/model/position~Position position}, returns the closest ancestor of that position which is a

+ 1 - 1
packages/ckeditor5-list/src/viewlistitemelement.js

@@ -7,7 +7,7 @@
  * @module list/viewlistitemelement
  */
 
-import ViewContainerElement from '../engine/view/containerelement.js';
+import ViewContainerElement from 'ckeditor5-engine/src/view/containerelement';
 
 /**
  * View element class representing list item (`<li>`). It extends {@link module:engine/view/containerelement~ContainerElement}

+ 6 - 6
packages/ckeditor5-list/tests/indentcommand.js

@@ -3,12 +3,12 @@
  * For licensing, see LICENSE.md.
  */
 
-import Editor from 'ckeditor5/core/editor/editor.js';
-import Document from 'ckeditor5/engine/model/document.js';
-import IndentCommand from 'ckeditor5/list/indentcommand.js';
-import Range from 'ckeditor5/engine/model/range.js';
-import Position from 'ckeditor5/engine/model/position.js';
-import { setData, getData } from 'ckeditor5/engine/dev-utils/model.js';
+import Editor from 'ckeditor5-core/src/editor/editor';
+import Document from 'ckeditor5-engine/src/model/document';
+import IndentCommand from 'ckeditor5-list/src/indentcommand';
+import Range from 'ckeditor5-engine/src/model/range';
+import Position from 'ckeditor5-engine/src/model/position';
+import { setData, getData } from 'ckeditor5-engine/src/dev-utils/model';
 
 describe( 'IndentCommand', () => {
 	let editor, doc, root;

+ 6 - 6
packages/ckeditor5-list/tests/list.js

@@ -5,12 +5,12 @@
 
 /* globals document */
 
-import ClassicTestEditor from 'tests/core/_utils/classictesteditor.js';
-import List from 'ckeditor5/list/list.js';
-import Paragraph from 'ckeditor5/paragraph/paragraph.js';
-import ListEngine from 'ckeditor5/list/listengine.js';
-import ButtonView from 'ckeditor5/ui/button/buttonview.js';
-import { getCode } from 'ckeditor5/utils/keyboard.js';
+import ClassicTestEditor from 'ckeditor5-core/tests/_utils/classictesteditor';
+import List from 'ckeditor5-list/src/list';
+import Paragraph from 'ckeditor5-paragraph/src/paragraph';
+import ListEngine from 'ckeditor5-list/src/listengine';
+import ButtonView from 'ckeditor5-ui/src/button/buttonview';
+import { getCode } from 'ckeditor5-utils/src/keyboard';
 
 describe( 'List', () => {
 	let editor, bulletedListButton, numberedListButton, schema;

+ 6 - 6
packages/ckeditor5-list/tests/listcommand.js

@@ -3,12 +3,12 @@
  * For licensing, see LICENSE.md.
  */
 
-import Editor from 'ckeditor5/core/editor/editor.js';
-import Document from 'ckeditor5/engine/model/document.js';
-import ListCommand from 'ckeditor5/list/listcommand.js';
-import Range from 'ckeditor5/engine/model/range.js';
-import Position from 'ckeditor5/engine/model/position.js';
-import { setData, getData } from 'ckeditor5/engine/dev-utils/model.js';
+import Editor from 'ckeditor5-core/src/editor/editor';
+import Document from 'ckeditor5-engine/src/model/document';
+import ListCommand from 'ckeditor5-list/src/listcommand';
+import Range from 'ckeditor5-engine/src/model/range';
+import Position from 'ckeditor5-engine/src/model/position';
+import { setData, getData } from 'ckeditor5-engine/src/dev-utils/model';
 
 describe( 'ListCommand', () => {
 	let editor, command, doc, root;

+ 11 - 11
packages/ckeditor5-list/tests/listengine.js

@@ -3,20 +3,20 @@
  * For licensing, see LICENSE.md.
  */
 
-import ListEngine from 'ckeditor5/list/listengine.js';
-import ListCommand from 'ckeditor5/list/listcommand.js';
+import ListEngine from 'ckeditor5-list/src/listengine';
+import ListCommand from 'ckeditor5-list/src/listcommand';
 
-import ModelElement from 'ckeditor5/engine/model/element.js';
-import ModelText from 'ckeditor5/engine/model/text.js';
-import ModelPosition from 'ckeditor5/engine/model/position.js';
-import ModelRange from 'ckeditor5/engine/model/range.js';
+import ModelElement from 'ckeditor5-engine/src/model/element';
+import ModelText from 'ckeditor5-engine/src/model/text';
+import ModelPosition from 'ckeditor5-engine/src/model/position';
+import ModelRange from 'ckeditor5-engine/src/model/range';
 
-import ViewPosition from 'ckeditor5/engine/view/position.js';
-import Paragraph from 'ckeditor5/paragraph/paragraph.js';
+import ViewPosition from 'ckeditor5-engine/src/view/position';
+import Paragraph from 'ckeditor5-paragraph/src/paragraph';
 
-import VirtualTestEditor from 'tests/core/_utils/virtualtesteditor.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 { 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( 'ListEngine', () => {
 	let editor, doc, root;

+ 7 - 7
packages/ckeditor5-list/tests/manual/list.js

@@ -5,13 +5,13 @@
 
 /* globals console, window, document */
 
-import ClassicEditor from 'ckeditor5/editor-classic/classic.js';
-import Enter from 'ckeditor5/enter/enter.js';
-import Typing from 'ckeditor5/typing/typing.js';
-import Heading from 'ckeditor5/heading/heading.js';
-import Paragraph from 'ckeditor5/paragraph/paragraph.js';
-import Undo from 'ckeditor5/undo/undo.js';
-import List from 'ckeditor5/list/list.js';
+import ClassicEditor from 'ckeditor5-editor-classic/src/classic';
+import Enter from 'ckeditor5-enter/src/enter';
+import Typing from 'ckeditor5-typing/src/typing';
+import Heading from 'ckeditor5-heading/src/heading';
+import Paragraph from 'ckeditor5-paragraph/src/paragraph';
+import Undo from 'ckeditor5-undo/src/undo';
+import List from 'ckeditor5-list/src/list';
 
 ClassicEditor.create( document.querySelector( '#editor' ), {
 	plugins: [ Enter, Typing, Heading, Paragraph, Undo, List ],

+ 6 - 6
packages/ckeditor5-list/tests/utils.js

@@ -3,13 +3,13 @@
  * For licensing, see LICENSE.md.
  */
 
-import { getClosestListItem, getSelectedBlocks, getPositionBeforeBlock } from 'ckeditor5/list/utils.js';
+import { getClosestListItem, getSelectedBlocks, getPositionBeforeBlock } from 'ckeditor5-list/src/utils';
 
-import Element from 'ckeditor5/engine/model/element.js';
-import Text from 'ckeditor5/engine/model/text.js';
-import Position from 'ckeditor5/engine/model/position.js';
-import Schema from 'ckeditor5/engine/model/schema.js';
-import Selection from 'ckeditor5/engine/model/selection.js';
+import Element from 'ckeditor5-engine/src/model/element';
+import Text from 'ckeditor5-engine/src/model/text';
+import Position from 'ckeditor5-engine/src/model/position';
+import Schema from 'ckeditor5-engine/src/model/schema';
+import Selection from 'ckeditor5-engine/src/model/selection';
 
 describe( 'getClosestListItem', () => {
 	const item = new Element( 'listItem', null, 'foobar' );

+ 3 - 3
packages/ckeditor5-list/tests/viewlistitemelement.js

@@ -3,9 +3,9 @@
  * For licensing, see LICENSE.md.
  */
 
-import ViewListItemElement from 'ckeditor5/list/viewlistitemelement.js';
-import ViewContainerElement from 'ckeditor5/engine/view/containerelement.js';
-import ViewText from 'ckeditor5/engine/view/text.js';
+import ViewListItemElement from 'ckeditor5-list/src/viewlistitemelement';
+import ViewContainerElement from 'ckeditor5-engine/src/view/containerelement';
+import ViewText from 'ckeditor5-engine/src/view/text';
 
 describe( 'ViewListItemElement', () => {
 	it( 'should extend ViewContainerElement', () => {

+ 14 - 0
packages/ckeditor5-list/theme/icons/bulletedlist.svg

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
+    <!-- Generator: Sketch 3.5.2 (25235) - http://www.bohemiancoding.com/sketch -->
+    <title>bulletedlist</title>
+    <desc>Created with Sketch.</desc>
+    <defs></defs>
+    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
+        <g id="bulletedlist" sketch:type="MSArtboardGroup" fill="#454545">
+            <g id="icon:bulletedlist" sketch:type="MSLayerGroup" transform="translate(1.000000, 3.000000)">
+                <path d="M5,13 L5,14 L15,14 L15,13 L5,13 L5,13 Z M5,1 L5,2 L17,2 L17,1 L5,1 L5,1 Z M5,7 L5,8 L16,8 L16,7 L5,7 L5,7 Z M0,1.5 C0,0.671572875 0.665797234,0 1.5,0 L1.5,0 C2.32842712,0 3,0.665797234 3,1.5 L3,1.5 C3,2.32842712 2.33420277,3 1.5,3 L1.5,3 C0.671572875,3 0,2.33420277 0,1.5 L0,1.5 Z M0,7.5 C0,6.67157288 0.665797234,6 1.5,6 L1.5,6 C2.32842712,6 3,6.66579723 3,7.5 L3,7.5 C3,8.32842712 2.33420277,9 1.5,9 L1.5,9 C0.671572875,9 0,8.33420277 0,7.5 L0,7.5 Z M0,13.5 C0,12.6715729 0.665797234,12 1.5,12 L1.5,12 C2.32842712,12 3,12.6657972 3,13.5 L3,13.5 C3,14.3284271 2.33420277,15 1.5,15 L1.5,15 C0.671572875,15 0,14.3342028 0,13.5 L0,13.5 Z" id="path4634" sketch:type="MSShapeGroup"></path>
+            </g>
+        </g>
+    </g>
+</svg>

+ 19 - 0
packages/ckeditor5-list/theme/icons/numberedlist.svg

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
+    <!-- Generator: Sketch 3.5.2 (25235) - http://www.bohemiancoding.com/sketch -->
+    <title>numberedlist</title>
+    <desc>Created with Sketch.</desc>
+    <defs></defs>
+    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
+        <g id="numberedlist" sketch:type="MSArtboardGroup" fill="#454545">
+            <g id="icon:numberedlist" sketch:type="MSLayerGroup" transform="translate(2.000000, 2.000000)">
+                <path d="M5,15 L15,15 L15,14 L5,14 L5,15 Z M4,2 L4,3 L17,3 L17,2 L4,2 L4,2 Z M5,8 L5,9 L16,9 L16,8 L5,8 L5,8 Z" id="path4634" sketch:type="MSShapeGroup"></path>
+                <g id="path4712-path-+-path4712-path-+-path4712-path-copy" sketch:type="MSShapeGroup">
+                    <path d="M0,0.5 C0,0.77699 0.223,1 0.5,1 L1,1 L1,4.5 C1,4.77699 1.223,5 1.5,5 C1.777,5 2,4.77699 2,4.5 L2,0.5 C2,0.223 1.777,0 1.5,0 L0.5,0 C0.223,0 0,0.223 0,0.5 Z" id="path4712-path"></path>
+                    <path d="M0.5,6 C0.223,6 0,6.223 0,6.5 C0,6.77699 0.223,7 0.5,7 L2,7 L2,8 L0.5,8 C0.223,8 0,8.223 0,8.5 L0,10.5 C0,10.77699 0.223,11 0.5,11 L2.5,11 C2.777,11 3,10.77699 3,10.5 C3,10.223 2.777,10 2.5,10 L1,10 L1,9 L2.5,9 C2.5693,9 2.62764,8.994 2.6875,8.9688 C2.81468,8.9278 2.9182,8.82667 2.96875,8.68755 C2.99395,8.62765 2.99995,8.5693 2.99995,8.50005 L2.99995,6.50005 C2.99995,6.43075 2.99395,6.3724 2.96875,6.31255 C2.91825,6.17342 2.81468,6.07227 2.6875,6.0313 C2.6471,6.0142 2.6076,6.006 2.5625,6.0001 L2.5,6.0001 L0.5,6.0001 L0.5,6 Z" id="path4712-path"></path>
+                    <path d="M2.85209534,16.8526748 C2.94267961,16.7627344 3,16.6389489 3,16.5023012 L3,12.4976988 C3,12.3570579 2.94465639,12.2332311 2.85505992,12.1442682 C2.76454727,12.057652 2.64101746,12 2.50461102,12 L0.495388985,12 C0.215752602,12 0,12.2238576 0,12.5 C0,12.7680664 0.221793203,13 0.495388985,13 L2,13 L2,14 L0.495388985,14 C0.215752602,14 0,14.2238576 0,14.5 C0,14.7680664 0.221793203,15 0.495388985,15 L2,15 L2,16 L0.495388985,16 C0.215752602,16 0,16.2238576 0,16.5 C0,16.7680664 0.221793203,17 0.495388985,17 L2.50461102,17 C2.6440432,17 2.76759251,16.9443442 2.85643212,16.854302 Z" id="Rectangle-403"></path>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>