@ckeditor/ckeditor5-basic-styles 35.4.0 → 36.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,60 +1,47 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
-
6
5
  /**
7
6
  * @module basic-styles/superscript/superscriptui
8
7
  */
9
-
10
8
  import { Plugin } from 'ckeditor5/src/core';
11
9
  import { ButtonView } from 'ckeditor5/src/ui';
12
-
13
10
  import superscriptIcon from '../../theme/icons/superscript.svg';
14
-
15
11
  const SUPERSCRIPT = 'superscript';
16
-
17
12
  /**
18
13
  * The superscript UI feature. It introduces the Superscript button.
19
- *
20
- * @extends module:core/plugin~Plugin
21
14
  */
22
15
  export default class SuperscriptUI extends Plugin {
23
- /**
24
- * @inheritDoc
25
- */
26
- static get pluginName() {
27
- return 'SuperscriptUI';
28
- }
29
-
30
- /**
31
- * @inheritDoc
32
- */
33
- init() {
34
- const editor = this.editor;
35
- const t = editor.t;
36
-
37
- // Add superscript button to feature components.
38
- editor.ui.componentFactory.add( SUPERSCRIPT, locale => {
39
- const command = editor.commands.get( SUPERSCRIPT );
40
- const view = new ButtonView( locale );
41
-
42
- view.set( {
43
- label: t( 'Superscript' ),
44
- icon: superscriptIcon,
45
- tooltip: true,
46
- isToggleable: true
47
- } );
48
-
49
- view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
50
-
51
- // Execute command.
52
- this.listenTo( view, 'execute', () => {
53
- editor.execute( SUPERSCRIPT );
54
- editor.editing.view.focus();
55
- } );
56
-
57
- return view;
58
- } );
59
- }
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ static get pluginName() {
20
+ return 'SuperscriptUI';
21
+ }
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ init() {
26
+ const editor = this.editor;
27
+ const t = editor.t;
28
+ // Add superscript button to feature components.
29
+ editor.ui.componentFactory.add(SUPERSCRIPT, locale => {
30
+ const command = editor.commands.get(SUPERSCRIPT);
31
+ const view = new ButtonView(locale);
32
+ view.set({
33
+ label: t('Superscript'),
34
+ icon: superscriptIcon,
35
+ tooltip: true,
36
+ isToggleable: true
37
+ });
38
+ view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');
39
+ // Execute command.
40
+ this.listenTo(view, 'execute', () => {
41
+ editor.execute(SUPERSCRIPT);
42
+ editor.editing.view.focus();
43
+ });
44
+ return view;
45
+ });
46
+ }
60
47
  }
@@ -1,36 +1,30 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
-
6
5
  /**
7
6
  * @module basic-styles/superscript
8
7
  */
9
-
10
8
  import { Plugin } from 'ckeditor5/src/core';
11
9
  import SuperscriptEditing from './superscript/superscriptediting';
12
10
  import SuperscriptUI from './superscript/superscriptui';
13
-
14
11
  /**
15
12
  * The superscript feature.
16
13
  *
17
14
  * It loads the {@link module:basic-styles/superscript/superscriptediting~SuperscriptEditing} and
18
15
  * {@link module:basic-styles/superscript/superscriptui~SuperscriptUI} plugins.
19
- *
20
- * @extends module:core/plugin~Plugin
21
16
  */
22
17
  export default class Superscript extends Plugin {
23
- /**
24
- * @inheritDoc
25
- */
26
- static get requires() {
27
- return [ SuperscriptEditing, SuperscriptUI ];
28
- }
29
-
30
- /**
31
- * @inheritDoc
32
- */
33
- static get pluginName() {
34
- return 'Superscript';
35
- }
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ static get requires() {
22
+ return [SuperscriptEditing, SuperscriptUI];
23
+ }
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get pluginName() {
28
+ return 'Superscript';
29
+ }
36
30
  }
@@ -1,60 +1,49 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
-
6
5
  /**
7
6
  * @module basic-styles/underline/underlineediting
8
7
  */
9
-
10
8
  import { Plugin } from 'ckeditor5/src/core';
11
9
  import AttributeCommand from '../attributecommand';
12
-
13
10
  const UNDERLINE = 'underline';
14
-
15
11
  /**
16
12
  * The underline editing feature.
17
13
  *
18
14
  * It registers the `'underline'` command, the <kbd>Ctrl+U</kbd> keystroke
19
15
  * and introduces the `underline` attribute in the model which renders to the view as an `<u>` element.
20
- *
21
- * @extends module:core/plugin~Plugin
22
16
  */
23
17
  export default class UnderlineEditing extends Plugin {
24
- /**
25
- * @inheritDoc
26
- */
27
- static get pluginName() {
28
- return 'UnderlineEditing';
29
- }
30
-
31
- /**
32
- * @inheritDoc
33
- */
34
- init() {
35
- const editor = this.editor;
36
-
37
- // Allow strikethrough attribute on text nodes.
38
- editor.model.schema.extend( '$text', { allowAttributes: UNDERLINE } );
39
- editor.model.schema.setAttributeProperties( UNDERLINE, {
40
- isFormatting: true,
41
- copyOnEnter: true
42
- } );
43
-
44
- editor.conversion.attributeToElement( {
45
- model: UNDERLINE,
46
- view: 'u',
47
- upcastAlso: {
48
- styles: {
49
- 'text-decoration': 'underline'
50
- }
51
- }
52
- } );
53
-
54
- // Create underline command.
55
- editor.commands.add( UNDERLINE, new AttributeCommand( editor, UNDERLINE ) );
56
-
57
- // Set the Ctrl+U keystroke.
58
- editor.keystrokes.set( 'CTRL+U', 'underline' );
59
- }
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ static get pluginName() {
22
+ return 'UnderlineEditing';
23
+ }
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ init() {
28
+ const editor = this.editor;
29
+ // Allow strikethrough attribute on text nodes.
30
+ editor.model.schema.extend('$text', { allowAttributes: UNDERLINE });
31
+ editor.model.schema.setAttributeProperties(UNDERLINE, {
32
+ isFormatting: true,
33
+ copyOnEnter: true
34
+ });
35
+ editor.conversion.attributeToElement({
36
+ model: UNDERLINE,
37
+ view: 'u',
38
+ upcastAlso: {
39
+ styles: {
40
+ 'text-decoration': 'underline'
41
+ }
42
+ }
43
+ });
44
+ // Create underline command.
45
+ editor.commands.add(UNDERLINE, new AttributeCommand(editor, UNDERLINE));
46
+ // Set the Ctrl+U keystroke.
47
+ editor.keystrokes.set('CTRL+U', 'underline');
48
+ }
60
49
  }
@@ -1,61 +1,48 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
-
6
5
  /**
7
6
  * @module basic-styles/underline/underlineui
8
7
  */
9
-
10
8
  import { Plugin } from 'ckeditor5/src/core';
11
9
  import { ButtonView } from 'ckeditor5/src/ui';
12
-
13
10
  import underlineIcon from '../../theme/icons/underline.svg';
14
-
15
11
  const UNDERLINE = 'underline';
16
-
17
12
  /**
18
13
  * The underline UI feature. It introduces the Underline button.
19
- *
20
- * @extends module:core/plugin~Plugin
21
14
  */
22
15
  export default class UnderlineUI extends Plugin {
23
- /**
24
- * @inheritDoc
25
- */
26
- static get pluginName() {
27
- return 'UnderlineUI';
28
- }
29
-
30
- /**
31
- * @inheritDoc
32
- */
33
- init() {
34
- const editor = this.editor;
35
- const t = editor.t;
36
-
37
- // Add bold button to feature components.
38
- editor.ui.componentFactory.add( UNDERLINE, locale => {
39
- const command = editor.commands.get( UNDERLINE );
40
- const view = new ButtonView( locale );
41
-
42
- view.set( {
43
- label: t( 'Underline' ),
44
- icon: underlineIcon,
45
- keystroke: 'CTRL+U',
46
- tooltip: true,
47
- isToggleable: true
48
- } );
49
-
50
- view.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
51
-
52
- // Execute command.
53
- this.listenTo( view, 'execute', () => {
54
- editor.execute( UNDERLINE );
55
- editor.editing.view.focus();
56
- } );
57
-
58
- return view;
59
- } );
60
- }
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ static get pluginName() {
20
+ return 'UnderlineUI';
21
+ }
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ init() {
26
+ const editor = this.editor;
27
+ const t = editor.t;
28
+ // Add bold button to feature components.
29
+ editor.ui.componentFactory.add(UNDERLINE, locale => {
30
+ const command = editor.commands.get(UNDERLINE);
31
+ const view = new ButtonView(locale);
32
+ view.set({
33
+ label: t('Underline'),
34
+ icon: underlineIcon,
35
+ keystroke: 'CTRL+U',
36
+ tooltip: true,
37
+ isToggleable: true
38
+ });
39
+ view.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');
40
+ // Execute command.
41
+ this.listenTo(view, 'execute', () => {
42
+ editor.execute(UNDERLINE);
43
+ editor.editing.view.focus();
44
+ });
45
+ return view;
46
+ });
47
+ }
61
48
  }
package/src/underline.js CHANGED
@@ -1,16 +1,13 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
-
6
5
  /**
7
6
  * @module basic-styles/underline
8
7
  */
9
-
10
8
  import { Plugin } from 'ckeditor5/src/core';
11
9
  import UnderlineEditing from './underline/underlineediting';
12
10
  import UnderlineUI from './underline/underlineui';
13
-
14
11
  /**
15
12
  * The underline feature.
16
13
  *
@@ -19,21 +16,18 @@ import UnderlineUI from './underline/underlineui';
19
16
  *
20
17
  * This is a "glue" plugin which loads the {@link module:basic-styles/underline/underlineediting~UnderlineEditing} and
21
18
  * {@link module:basic-styles/underline/underlineui~UnderlineUI} plugins.
22
- *
23
- * @extends module:core/plugin~Plugin
24
19
  */
25
20
  export default class Underline extends Plugin {
26
- /**
27
- * @inheritDoc
28
- */
29
- static get requires() {
30
- return [ UnderlineEditing, UnderlineUI ];
31
- }
32
-
33
- /**
34
- * @inheritDoc
35
- */
36
- static get pluginName() {
37
- return 'Underline';
38
- }
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get requires() {
25
+ return [UnderlineEditing, UnderlineUI];
26
+ }
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ static get pluginName() {
31
+ return 'Underline';
32
+ }
39
33
  }
package/theme/code.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5