8
0
Piotrek Koszuliński 9 лет назад
Родитель
Сommit
a5be0c69d5

+ 2 - 2
packages/ckeditor5-link/src/findlinkrange.js

@@ -7,8 +7,8 @@
  * @module link/findlinkrange
  * @module link/findlinkrange
  */
  */
 
 
-import Range from '../engine/model/range.js';
-import Position from '../engine/model/position.js';
+import Range from 'ckeditor5-engine/src/model/range';
+import Position from 'ckeditor5-engine/src/model/position';
 
 
 /**
 /**
  * Walk backward and forward from start position, node by node as long as they have the same `linkHref` attribute value and return
  * Walk backward and forward from start position, node by node as long as they have the same `linkHref` attribute value and return

+ 16 - 11
packages/ckeditor5-link/src/link.js

@@ -7,18 +7,23 @@
  * @module link/link
  * @module link/link
  */
  */
 
 
-import Plugin from '../core/plugin.js';
-import ClickObserver from '../engine/view/observer/clickobserver.js';
-import LinkEngine from './linkengine.js';
-import LinkElement from './linkelement.js';
+import Plugin from 'ckeditor5-core/src/plugin';
+import ClickObserver from 'ckeditor5-engine/src/view/observer/clickobserver';
+import LinkEngine from './linkengine';
+import LinkElement from './linkelement';
 
 
-import clickOutsideHandler from '../ui/bindings/clickoutsidehandler.js';
-import escPressHandler from '../ui/bindings/escpresshandler.js';
+import clickOutsideHandler from 'ckeditor5-ui/src/bindings/clickoutsidehandler';
+import escPressHandler from 'ckeditor5-ui/src/bindings/escpresshandler';
 
 
-import ButtonView from '../ui/button/buttonview.js';
-import BalloonPanelView from '../ui/balloonpanel/balloonpanelview.js';
+import ButtonView from 'ckeditor5-ui/src/button/buttonview';
+import BalloonPanelView from 'ckeditor5-ui/src/balloonpanel/balloonpanelview';
 
 
-import LinkFormView from './ui/linkformview.js';
+import LinkFormView from './ui/linkformview';
+
+import linkIcon from '../theme/icons/link.svg';
+import unlinkIcon from '../theme/icons/unlink.svg';
+
+import '../theme/theme.scss';
 
 
 /**
 /**
  * The link feature. It introduces the Link and Unlink buttons and the <kbd>Ctrl+K</kbd> keystroke.
  * The link feature. It introduces the Link and Unlink buttons and the <kbd>Ctrl+K</kbd> keystroke.
@@ -79,7 +84,7 @@ export default class Link extends Plugin {
 
 
 			button.isEnabled = true;
 			button.isEnabled = true;
 			button.label = t( 'Link' );
 			button.label = t( 'Link' );
-			button.icon = 'link';
+			button.icon = linkIcon;
 			button.keystroke = 'CTRL+K';
 			button.keystroke = 'CTRL+K';
 
 
 			// Bind button to the command.
 			// Bind button to the command.
@@ -108,7 +113,7 @@ export default class Link extends Plugin {
 
 
 			button.isEnabled = false;
 			button.isEnabled = false;
 			button.label = t( 'Unlink' );
 			button.label = t( 'Unlink' );
-			button.icon = 'unlink';
+			button.icon = unlinkIcon;
 
 
 			// Bind button to the command.
 			// Bind button to the command.
 			button.bind( 'isEnabled' ).to( unlinkCommand, 'isEnabled' );
 			button.bind( 'isEnabled' ).to( unlinkCommand, 'isEnabled' );

+ 6 - 6
packages/ckeditor5-link/src/linkcommand.js

@@ -7,12 +7,12 @@
  * @module link/linkcommand
  * @module link/linkcommand
  */
  */
 
 
-import Command from '../core/command/command.js';
-import Text from '../engine/model/text.js';
-import Range from '../engine/model/range.js';
-import getSchemaValidRanges from '../core/command/helpers/getschemavalidranges.js';
-import isAttributeAllowedInSelection from '../core/command/helpers/isattributeallowedinselection.js';
-import findLinkRange from './findlinkrange.js';
+import Command from 'ckeditor5-core/src/command/command';
+import Text from 'ckeditor5-engine/src/model/text';
+import Range from 'ckeditor5-engine/src/model/range';
+import getSchemaValidRanges from 'ckeditor5-core/src/command/helpers/getschemavalidranges';
+import isAttributeAllowedInSelection from 'ckeditor5-core/src/command/helpers/isattributeallowedinselection';
+import findLinkRange from './findlinkrange';
 
 
 /**
 /**
  * The link command. It is used by the {@link module:link/link~Link link feature}.
  * The link command. It is used by the {@link module:link/link~Link link feature}.

+ 1 - 1
packages/ckeditor5-link/src/linkelement.js

@@ -7,7 +7,7 @@
  * @module link/linkelement
  * @module link/linkelement
  */
  */
 
 
-import AttributeElement from '../engine/view/attributeelement.js';
+import AttributeElement from 'ckeditor5-engine/src/view/attributeelement';
 
 
 /**
 /**
  * This class is to mark specific {@link module:engine/view/node~Node} as {@link module:link/linkelement~LinkElement}.
  * This class is to mark specific {@link module:engine/view/node~Node} as {@link module:link/linkelement~LinkElement}.

+ 6 - 6
packages/ckeditor5-link/src/linkengine.js

@@ -7,12 +7,12 @@
  * @module link/linkengine
  * @module link/linkengine
  */
  */
 
 
-import Plugin from '../core/plugin.js';
-import buildModelConverter from '../engine/conversion/buildmodelconverter.js';
-import buildViewConverter from '../engine/conversion/buildviewconverter.js';
-import LinkElement from './linkelement.js';
-import LinkCommand from './linkcommand.js';
-import UnlinkCommand from './unlinkcommand.js';
+import Plugin from 'ckeditor5-core/src/plugin';
+import buildModelConverter from 'ckeditor5-engine/src/conversion/buildmodelconverter';
+import buildViewConverter from 'ckeditor5-engine/src/conversion/buildviewconverter';
+import LinkElement from './linkelement';
+import LinkCommand from './linkcommand';
+import UnlinkCommand from './unlinkcommand';
 
 
 /**
 /**
  * The link engine feature.
  * The link engine feature.

+ 6 - 6
packages/ckeditor5-link/src/ui/linkformview.js

@@ -7,14 +7,14 @@
  * @module link/ui/linkformview
  * @module link/ui/linkformview
  */
  */
 
 
-import View from '../../ui/view.js';
-import Template from '../../ui/template.js';
+import View from 'ckeditor5-ui/src/view';
+import Template from 'ckeditor5-ui/src/template';
 
 
-import ButtonView from '../../ui/button/buttonview.js';
-import LabeledInputView from '../../ui/labeledinput/labeledinputview.js';
-import InputTextView from '../../ui/inputtext/inputtextview.js';
+import ButtonView from 'ckeditor5-ui/src/button/buttonview';
+import LabeledInputView from 'ckeditor5-ui/src/labeledinput/labeledinputview';
+import InputTextView from 'ckeditor5-ui/src/inputtext/inputtextview';
 
 
-import submitHandler from '../../ui/bindings/submithandler.js';
+import submitHandler from 'ckeditor5-ui/src/bindings/submithandler';
 
 
 /**
 /**
  * The link form view controller class.
  * The link form view controller class.

+ 2 - 2
packages/ckeditor5-link/src/unlinkcommand.js

@@ -7,8 +7,8 @@
  * @module link/unlinkcommand
  * @module link/unlinkcommand
  */
  */
 
 
-import Command from '../core/command/command.js';
-import findLinkRange from './findlinkrange.js';
+import Command from 'ckeditor5-core/src/command/command';
+import findLinkRange from './findlinkrange';
 
 
 /**
 /**
  * The unlink command. It is used by the {@link module:link/link~Link link plugin}.
  * The unlink command. It is used by the {@link module:link/link~Link link plugin}.

+ 5 - 5
packages/ckeditor5-link/tests/findlinkrange.js

@@ -5,11 +5,11 @@
 
 
 /* bender-tags: link */
 /* bender-tags: link */
 
 
-import findLinkRange from 'ckeditor5/link/findlinkrange.js';
-import Document from 'ckeditor5/engine/model/document.js';
-import Range from 'ckeditor5/engine/model/range.js';
-import Position from 'ckeditor5/engine/model/position.js';
-import { setData } from 'ckeditor5/engine/dev-utils/model.js';
+import findLinkRange from 'ckeditor5-link/src/findlinkrange';
+import Document from 'ckeditor5-engine/src/model/document';
+import Range from 'ckeditor5-engine/src/model/range';
+import Position from 'ckeditor5-engine/src/model/position';
+import { setData } from 'ckeditor5-engine/src/dev-utils/model';
 
 
 describe( 'findLinkRange', () => {
 describe( 'findLinkRange', () => {
 	let document, root;
 	let document, root;

+ 12 - 12
packages/ckeditor5-link/tests/link.js

@@ -5,18 +5,18 @@
 
 
 /* globals document */
 /* globals document */
 
 
-import ClassicTestEditor from 'tests/core/_utils/classictesteditor.js';
-import testUtils from 'tests/core/_utils/utils.js';
-import { keyCodes } from 'ckeditor5/utils/keyboard.js';
-import { setData as setModelData } from 'ckeditor5/engine/dev-utils/model.js';
-
-import Link from 'ckeditor5/link/link.js';
-import LinkEngine from 'ckeditor5/link/linkengine.js';
-import ButtonView from 'ckeditor5/ui/button/buttonview.js';
-import BalloonPanelView from 'ckeditor5/ui/balloonpanel/balloonpanelview.js';
-
-import Range from 'ckeditor5/engine/view/range.js';
-import ClickObserver from 'ckeditor5/engine/view/observer/clickobserver.js';
+import ClassicTestEditor from 'ckeditor5-core/tests/_utils/classictesteditor';
+import testUtils from 'ckeditor5-core/tests/_utils/utils';
+import { keyCodes } from 'ckeditor5-utils/src/keyboard';
+import { setData as setModelData } from 'ckeditor5-engine/src/dev-utils/model';
+
+import Link from 'ckeditor5-link/src/link';
+import LinkEngine from 'ckeditor5-link/src/linkengine';
+import ButtonView from 'ckeditor5-ui/src/button/buttonview';
+import BalloonPanelView from 'ckeditor5-ui/src/balloonpanel/balloonpanelview';
+
+import Range from 'ckeditor5-engine/src/view/range';
+import ClickObserver from 'ckeditor5-engine/src/view/observer/clickobserver';
 
 
 testUtils.createSinonSandbox();
 testUtils.createSinonSandbox();
 
 

+ 3 - 3
packages/ckeditor5-link/tests/linkcommand.js

@@ -3,9 +3,9 @@
  * For licensing, see LICENSE.md.
  * For licensing, see LICENSE.md.
  */
  */
 
 
-import ModelTestEditor from 'tests/core/_utils/modeltesteditor.js';
-import LinkCommand from 'ckeditor5/link/linkcommand.js';
-import { setData, getData } from 'ckeditor5/engine/dev-utils/model.js';
+import ModelTestEditor from 'ckeditor5-core/tests/_utils/modeltesteditor';
+import LinkCommand from 'ckeditor5-link/src/linkcommand';
+import { setData, getData } from 'ckeditor5-engine/src/dev-utils/model';
 
 
 describe( 'LinkCommand', () => {
 describe( 'LinkCommand', () => {
 	let editor, document, command;
 	let editor, document, command;

+ 2 - 2
packages/ckeditor5-link/tests/linkelement.js

@@ -3,8 +3,8 @@
  * For licensing, see LICENSE.md.
  * For licensing, see LICENSE.md.
  */
  */
 
 
-import LinkElement from 'ckeditor5/link/linkelement.js';
-import AttributeElement from 'ckeditor5/engine/view/attributeelement.js';
+import LinkElement from 'ckeditor5-link/src/linkelement';
+import AttributeElement from 'ckeditor5-engine/src/view/attributeelement';
 
 
 describe( 'LinkElement', () => {
 describe( 'LinkElement', () => {
 	it( 'should extend AttributeElement', () => {
 	it( 'should extend AttributeElement', () => {

+ 7 - 7
packages/ckeditor5-link/tests/linkengine.js

@@ -3,13 +3,13 @@
  * For licensing, see LICENSE.md.
  * For licensing, see LICENSE.md.
  */
  */
 
 
-import LinkEngine from 'ckeditor5/link/linkengine.js';
-import LinkCommand from 'ckeditor5/link/linkcommand.js';
-import LinkElement from 'ckeditor5/link/linkelement.js';
-import UnlinkCommand from 'ckeditor5/link/unlinkcommand.js';
-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 LinkEngine from 'ckeditor5-link/src/linkengine';
+import LinkCommand from 'ckeditor5-link/src/linkcommand';
+import LinkElement from 'ckeditor5-link/src/linkelement';
+import UnlinkCommand from 'ckeditor5-link/src/unlinkcommand';
+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( 'LinkEngine', () => {
 describe( 'LinkEngine', () => {
 	let editor, doc;
 	let editor, doc;

+ 6 - 6
packages/ckeditor5-link/tests/manual/link.js

@@ -5,12 +5,12 @@
 
 
 /* globals console:false, window, document */
 /* globals console:false, 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 Link from 'ckeditor5/link/link.js';
-import Paragraph from 'ckeditor5/paragraph/paragraph.js';
-import Undo from 'ckeditor5/undo/undo.js';
+import ClassicEditor from 'ckeditor5-editor-classic/src/classic';
+import Enter from 'ckeditor5-enter/src/enter';
+import Typing from 'ckeditor5-typing/src/typing';
+import Link from 'ckeditor5-link/src/link';
+import Paragraph from 'ckeditor5-paragraph/src/paragraph';
+import Undo from 'ckeditor5-undo/src/undo';
 
 
 ClassicEditor.create( document.querySelector( '#editor' ), {
 ClassicEditor.create( document.querySelector( '#editor' ), {
 	plugins: [ Link, Typing, Paragraph, Undo, Enter ],
 	plugins: [ Link, Typing, Paragraph, Undo, Enter ],

+ 2 - 2
packages/ckeditor5-link/tests/ui/linkformview.js

@@ -5,8 +5,8 @@
 
 
 /* bender-tags: ui, form */
 /* bender-tags: ui, form */
 
 
-import View from 'ckeditor5/ui/view.js';
-import LinkFormView from 'ckeditor5/link/ui/linkformview.js';
+import View from 'ckeditor5-ui/src/view';
+import LinkFormView from 'ckeditor5-link/src/ui/linkformview';
 
 
 describe( 'LinkFormView', () => {
 describe( 'LinkFormView', () => {
 	let view;
 	let view;

+ 4 - 4
packages/ckeditor5-link/tests/unlinkcommand.js

@@ -3,10 +3,10 @@
  * For licensing, see LICENSE.md.
  * For licensing, see LICENSE.md.
  */
  */
 
 
-import ModelTestEditor from 'tests/core/_utils/modeltesteditor.js';
-import UnlinkCommand from 'ckeditor5/link/unlinkcommand.js';
-import { setData, getData } from 'ckeditor5/engine/dev-utils/model.js';
-import testUtils from 'tests/core/_utils/utils.js';
+import ModelTestEditor from 'ckeditor5-core/tests/_utils/modeltesteditor';
+import UnlinkCommand from 'ckeditor5-link/src/unlinkcommand';
+import { setData, getData } from 'ckeditor5-engine/src/dev-utils/model';
+import testUtils from 'ckeditor5-core/tests/_utils/utils';
 
 
 testUtils.createSinonSandbox();
 testUtils.createSinonSandbox();
 
 

+ 2 - 0
packages/ckeditor5-link/theme/components/linkform.scss

@@ -1,6 +1,8 @@
 // Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
 // Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
 // For licensing, see LICENSE.md or http://ckeditor.com/license
 // For licensing, see LICENSE.md or http://ckeditor.com/license
 
 
+@import '~ckeditor5-theme-lark/theme/helpers/_spacing';
+
 .ck-link {
 .ck-link {
 	&-form {
 	&-form {
 		padding: ck-spacing( 'large' );
 		padding: ck-spacing( 'large' );

+ 17 - 0
packages/ckeditor5-link/theme/icons/link.svg

@@ -0,0 +1,17 @@
+<?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>link</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="link" sketch:type="MSArtboardGroup" fill="#222222">
+            <g id="icon:link" sketch:type="MSLayerGroup">
+                <g id="Rectangle-18-+-Rectangle-18-Copy-+-Path-28" transform="translate(9.646447, 9.853553) rotate(-315.000000) translate(-9.646447, -9.853553) translate(5.646447, 0.853553)" sketch:type="MSShapeGroup">
+                    <path d="M8,6.55919636 L8,4.82450549 C8,2.61334348 6.2104719,0.828427125 4,0.828427125 C1.79353398,0.828427125 -3.20810045e-12,2.61822724 -3.20810045e-12,4.82450549 L-3.20810045e-12,7.75542568 C-3.20810045e-12,9.96658769 1.7895281,11.751504 4,11.751504 C4.5511606,11.751504 5.07655559,11.6398264 5.55466651,11.437876 L5.12132034,11.437876 L5.12132034,10.5346402 C4.77469964,10.6745028 4.39616036,10.751504 4,10.751504 C2.34314575,10.751504 1,9.41562927 1,7.75542568 L1,4.82450549 C1,3.1698171 2.34651712,1.82842712 4,1.82842712 C5.65685425,1.82842712 7,3.1643019 7,4.82450549 L7,6.55919636 L8,6.55919636 Z" id="Shape"></path>
+                    <path d="M2.63603897,6.90151354 C3.06184352,6.74698845 3.52119959,6.66270951 4,6.66270951 C6.2104719,6.66270951 8,8.44762587 8,10.6587879 L8,13.5897081 C8,15.7959863 6.20646602,17.5857864 4,17.5857864 C1.7895281,17.5857864 -2.32347475e-12,15.8008701 -2.32347475e-12,13.5897081 L-2.32347475e-12,11.6627095 L1,11.6627095 L1,13.5897081 C1,15.2499117 2.34314575,16.5857864 4,16.5857864 C5.65348288,16.5857864 7,15.2443965 7,13.5897081 L7,10.6587879 C7,8.99858429 5.65685425,7.66270951 4,7.66270951 C3.5092458,7.66270951 3.04553235,7.78087311 2.63603897,7.99032058 L2.63603897,6.90151354 Z" id="Shape"></path>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 17 - 0
packages/ckeditor5-link/theme/icons/unlink.svg

@@ -0,0 +1,17 @@
+<?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>unlink</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="unlink" sketch:type="MSArtboardGroup" fill="#222222">
+            <g id="icon:unlink" sketch:type="MSLayerGroup">
+                <g id="Rectangle-18-+-Rectangle-18-Copy-+-Path-28-Copy" transform="translate(12.828427, 13.035534) rotate(-315.000000) translate(-12.828427, -13.035534) translate(4.328427, 4.035534)" sketch:type="MSShapeGroup">
+                    <path d="M8,6.55919636 L8,4.82450549 C8,2.61334348 6.2104719,0.828427125 4,0.828427125 C1.79353398,0.828427125 -3.20454774e-12,2.61822724 -3.20454774e-12,4.82450549 L-3.20454774e-12,7.75542568 C-3.20454774e-12,9.96658769 1.7895281,11.751504 4,11.751504 C4.5511606,11.751504 5.07655559,11.6398264 5.55466651,11.437876 L5.12132034,11.437876 L5.12132034,10.5346402 C4.77469964,10.6745028 4.39616036,10.751504 4,10.751504 C2.34314575,10.751504 1,9.41562927 1,7.75542568 L1,4.82450549 C1,3.1698171 2.34651712,1.82842712 4,1.82842712 C5.65685425,1.82842712 7,3.1643019 7,4.82450549 L7,6.55919636 L8,6.55919636 Z" id="Shape"></path>
+                    <path d="M12.1301896,9.691731 L12.1301896,6.07623654 L11.1099103,6.07623654 L11.1099103,9.691731 L7.79324873,9.691731 L7.79324873,10.7120103 L11.1099103,10.7120103 L11.1099103,14.3275047 L12.1301896,14.3275047 L12.1301896,10.7120103 L16.0445169,10.7120103 L16.0445169,9.691731 L12.1301896,9.691731 Z M7.52584209,8.6418508 C6.80172121,7.49371533 5.53005392,6.73384534 4.08111717,6.73384534 C3.59260703,6.73384534 3.12393555,6.82077136 2.68949598,6.98014985 L2.68949598,8.10315471 C3.10729359,7.8871288 3.58041083,7.76525387 4.08111717,7.76525387 C5.2472836,7.76525387 6.26112906,8.4209623 6.77783518,9.38985772 L7.52584209,8.6418508 Z M8.16223435,12.3942945 L8.16223435,13.8784107 C8.16223435,16.1539849 6.33232877,18 4.08111717,18 C1.82581847,18 -8.17124146e-14,16.1590221 -8.17124146e-14,13.8784107 L-8.17124146e-14,11.890888 L1.02027929,11.890888 L1.02027929,13.8784107 C1.02027929,15.5907588 2.39066309,16.9685915 4.08111717,16.9685915 C5.76813152,16.9685915 7.14195505,15.5850704 7.14195505,13.8784107 L7.14195505,11.3740152 L8.16223435,12.3942945 Z" id="Shape"></path>
+                </g>
+            </g>
+        </g>
+    </g>
+</svg>

+ 1 - 1
packages/ckeditor5-link/theme/theme.scss

@@ -1,4 +1,4 @@
 // Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
 // Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
 // For licensing, see LICENSE.md or http://ckeditor.com/license
 // For licensing, see LICENSE.md or http://ckeditor.com/license
 
 
-@import 'components/linkform';
+@import './components/linkform';