@ckeditor/ckeditor5-basic-styles 38.0.1 → 38.1.1
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.
- package/build/basic-styles.js +1 -1
- package/build/basic-styles.js.map +1 -0
- package/package.json +2 -21
- package/src/attributecommand.d.ts +74 -74
- package/src/attributecommand.js +105 -105
- package/src/augmentation.d.ts +40 -40
- package/src/augmentation.js +5 -5
- package/src/bold/boldediting.d.ts +24 -24
- package/src/bold/boldediting.js +62 -62
- package/src/bold/boldui.d.ts +21 -21
- package/src/bold/boldui.js +47 -47
- package/src/bold.d.ts +29 -29
- package/src/bold.js +33 -33
- package/src/code/codeediting.d.ts +29 -29
- package/src/code/codeediting.js +59 -59
- package/src/code/codeui.d.ts +22 -22
- package/src/code/codeui.js +48 -48
- package/src/code.d.ts +30 -30
- package/src/code.js +34 -34
- package/src/index.d.ts +30 -30
- package/src/index.js +29 -29
- package/src/italic/italicediting.d.ts +24 -24
- package/src/italic/italicediting.js +52 -52
- package/src/italic/italicui.d.ts +21 -21
- package/src/italic/italicui.js +48 -48
- package/src/italic.d.ts +29 -29
- package/src/italic.js +33 -33
- package/src/strikethrough/strikethroughediting.d.ts +25 -25
- package/src/strikethrough/strikethroughediting.js +54 -54
- package/src/strikethrough/strikethroughui.d.ts +21 -21
- package/src/strikethrough/strikethroughui.js +48 -48
- package/src/strikethrough.d.ts +29 -29
- package/src/strikethrough.js +33 -33
- package/src/subscript/subscriptediting.d.ts +24 -24
- package/src/subscript/subscriptediting.js +50 -50
- package/src/subscript/subscriptui.d.ts +21 -21
- package/src/subscript/subscriptui.js +47 -47
- package/src/subscript.d.ts +26 -26
- package/src/subscript.js +30 -30
- package/src/superscript/superscriptediting.d.ts +24 -24
- package/src/superscript/superscriptediting.js +50 -50
- package/src/superscript/superscriptui.d.ts +21 -21
- package/src/superscript/superscriptui.js +47 -47
- package/src/superscript.d.ts +26 -26
- package/src/superscript.js +30 -30
- package/src/underline/underlineediting.d.ts +24 -24
- package/src/underline/underlineediting.js +49 -49
- package/src/underline/underlineui.d.ts +21 -21
- package/src/underline/underlineui.js +48 -48
- package/src/underline.d.ts +29 -29
- package/src/underline.js +33 -33
package/src/subscript.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/subscript
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import SubscriptEditing from './subscript/subscriptediting';
|
|
10
|
-
import SubscriptUI from './subscript/subscriptui';
|
|
11
|
-
/**
|
|
12
|
-
* The subscript feature.
|
|
13
|
-
*
|
|
14
|
-
* It loads the {@link module:basic-styles/subscript/subscriptediting~SubscriptEditing} and
|
|
15
|
-
* {@link module:basic-styles/subscript/subscriptui~SubscriptUI} plugins.
|
|
16
|
-
*/
|
|
17
|
-
export default class Subscript extends Plugin {
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
static get requires() {
|
|
22
|
-
return [SubscriptEditing, SubscriptUI];
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @inheritDoc
|
|
26
|
-
*/
|
|
27
|
-
static get pluginName() {
|
|
28
|
-
return 'Subscript';
|
|
29
|
-
}
|
|
30
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module basic-styles/subscript
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import SubscriptEditing from './subscript/subscriptediting';
|
|
10
|
+
import SubscriptUI from './subscript/subscriptui';
|
|
11
|
+
/**
|
|
12
|
+
* The subscript feature.
|
|
13
|
+
*
|
|
14
|
+
* It loads the {@link module:basic-styles/subscript/subscriptediting~SubscriptEditing} and
|
|
15
|
+
* {@link module:basic-styles/subscript/subscriptui~SubscriptUI} plugins.
|
|
16
|
+
*/
|
|
17
|
+
export default class Subscript extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get requires() {
|
|
22
|
+
return [SubscriptEditing, SubscriptUI];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get pluginName() {
|
|
28
|
+
return 'Subscript';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/superscript/superscriptediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
/**
|
|
10
|
-
* The superscript editing feature.
|
|
11
|
-
*
|
|
12
|
-
* It registers the `super` command and introduces the `super` attribute in the model which renders to the view
|
|
13
|
-
* as a `<super>` element.
|
|
14
|
-
*/
|
|
15
|
-
export default class SuperscriptEditing extends Plugin {
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
static get pluginName():
|
|
20
|
-
/**
|
|
21
|
-
* @inheritDoc
|
|
22
|
-
*/
|
|
23
|
-
init(): void;
|
|
24
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module basic-styles/superscript/superscriptediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
/**
|
|
10
|
+
* The superscript editing feature.
|
|
11
|
+
*
|
|
12
|
+
* It registers the `super` command and introduces the `super` attribute in the model which renders to the view
|
|
13
|
+
* as a `<super>` element.
|
|
14
|
+
*/
|
|
15
|
+
export default class SuperscriptEditing extends Plugin {
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
static get pluginName(): "SuperscriptEditing";
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
init(): void;
|
|
24
|
+
}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/superscript/superscriptediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import AttributeCommand from '../attributecommand';
|
|
10
|
-
const SUPERSCRIPT = 'superscript';
|
|
11
|
-
/**
|
|
12
|
-
* The superscript editing feature.
|
|
13
|
-
*
|
|
14
|
-
* It registers the `super` command and introduces the `super` attribute in the model which renders to the view
|
|
15
|
-
* as a `<super>` element.
|
|
16
|
-
*/
|
|
17
|
-
export default class SuperscriptEditing extends Plugin {
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
static get pluginName() {
|
|
22
|
-
return 'SuperscriptEditing';
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @inheritDoc
|
|
26
|
-
*/
|
|
27
|
-
init() {
|
|
28
|
-
const editor = this.editor;
|
|
29
|
-
// Allow super attribute on text nodes.
|
|
30
|
-
editor.model.schema.extend('$text', { allowAttributes: SUPERSCRIPT });
|
|
31
|
-
editor.model.schema.setAttributeProperties(SUPERSCRIPT, {
|
|
32
|
-
isFormatting: true,
|
|
33
|
-
copyOnEnter: true
|
|
34
|
-
});
|
|
35
|
-
// Build converter from model to view for data and editing pipelines.
|
|
36
|
-
editor.conversion.attributeToElement({
|
|
37
|
-
model: SUPERSCRIPT,
|
|
38
|
-
view: 'sup',
|
|
39
|
-
upcastAlso: [
|
|
40
|
-
{
|
|
41
|
-
styles: {
|
|
42
|
-
'vertical-align': 'super'
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
});
|
|
47
|
-
// Create super command.
|
|
48
|
-
editor.commands.add(SUPERSCRIPT, new AttributeCommand(editor, SUPERSCRIPT));
|
|
49
|
-
}
|
|
50
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module basic-styles/superscript/superscriptediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import AttributeCommand from '../attributecommand';
|
|
10
|
+
const SUPERSCRIPT = 'superscript';
|
|
11
|
+
/**
|
|
12
|
+
* The superscript editing feature.
|
|
13
|
+
*
|
|
14
|
+
* It registers the `super` command and introduces the `super` attribute in the model which renders to the view
|
|
15
|
+
* as a `<super>` element.
|
|
16
|
+
*/
|
|
17
|
+
export default class SuperscriptEditing extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get pluginName() {
|
|
22
|
+
return 'SuperscriptEditing';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
init() {
|
|
28
|
+
const editor = this.editor;
|
|
29
|
+
// Allow super attribute on text nodes.
|
|
30
|
+
editor.model.schema.extend('$text', { allowAttributes: SUPERSCRIPT });
|
|
31
|
+
editor.model.schema.setAttributeProperties(SUPERSCRIPT, {
|
|
32
|
+
isFormatting: true,
|
|
33
|
+
copyOnEnter: true
|
|
34
|
+
});
|
|
35
|
+
// Build converter from model to view for data and editing pipelines.
|
|
36
|
+
editor.conversion.attributeToElement({
|
|
37
|
+
model: SUPERSCRIPT,
|
|
38
|
+
view: 'sup',
|
|
39
|
+
upcastAlso: [
|
|
40
|
+
{
|
|
41
|
+
styles: {
|
|
42
|
+
'vertical-align': 'super'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
// Create super command.
|
|
48
|
+
editor.commands.add(SUPERSCRIPT, new AttributeCommand(editor, SUPERSCRIPT));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/superscript/superscriptui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
/**
|
|
10
|
-
* The superscript UI feature. It introduces the Superscript button.
|
|
11
|
-
*/
|
|
12
|
-
export default class SuperscriptUI extends Plugin {
|
|
13
|
-
/**
|
|
14
|
-
* @inheritDoc
|
|
15
|
-
*/
|
|
16
|
-
static get pluginName():
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
init(): void;
|
|
21
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module basic-styles/superscript/superscriptui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
/**
|
|
10
|
+
* The superscript UI feature. It introduces the Superscript button.
|
|
11
|
+
*/
|
|
12
|
+
export default class SuperscriptUI extends Plugin {
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
static get pluginName(): "SuperscriptUI";
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
init(): void;
|
|
21
|
+
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/superscript/superscriptui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import { ButtonView } from 'ckeditor5/src/ui';
|
|
10
|
-
import superscriptIcon from '../../theme/icons/superscript.svg';
|
|
11
|
-
const SUPERSCRIPT = 'superscript';
|
|
12
|
-
/**
|
|
13
|
-
* The superscript UI feature. It introduces the Superscript button.
|
|
14
|
-
*/
|
|
15
|
-
export default class SuperscriptUI extends Plugin {
|
|
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
|
-
}
|
|
47
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module basic-styles/superscript/superscriptui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import { ButtonView } from 'ckeditor5/src/ui';
|
|
10
|
+
import superscriptIcon from '../../theme/icons/superscript.svg';
|
|
11
|
+
const SUPERSCRIPT = 'superscript';
|
|
12
|
+
/**
|
|
13
|
+
* The superscript UI feature. It introduces the Superscript button.
|
|
14
|
+
*/
|
|
15
|
+
export default class SuperscriptUI extends Plugin {
|
|
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
|
+
}
|
|
47
|
+
}
|
package/src/superscript.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/superscript
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import SuperscriptEditing from './superscript/superscriptediting';
|
|
10
|
-
import SuperscriptUI from './superscript/superscriptui';
|
|
11
|
-
/**
|
|
12
|
-
* The superscript feature.
|
|
13
|
-
*
|
|
14
|
-
* It loads the {@link module:basic-styles/superscript/superscriptediting~SuperscriptEditing} and
|
|
15
|
-
* {@link module:basic-styles/superscript/superscriptui~SuperscriptUI} plugins.
|
|
16
|
-
*/
|
|
17
|
-
export default class Superscript extends Plugin {
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
static get requires(): readonly [typeof SuperscriptEditing, typeof SuperscriptUI];
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
static get pluginName():
|
|
26
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module basic-styles/superscript
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import SuperscriptEditing from './superscript/superscriptediting';
|
|
10
|
+
import SuperscriptUI from './superscript/superscriptui';
|
|
11
|
+
/**
|
|
12
|
+
* The superscript feature.
|
|
13
|
+
*
|
|
14
|
+
* It loads the {@link module:basic-styles/superscript/superscriptediting~SuperscriptEditing} and
|
|
15
|
+
* {@link module:basic-styles/superscript/superscriptui~SuperscriptUI} plugins.
|
|
16
|
+
*/
|
|
17
|
+
export default class Superscript extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get requires(): readonly [typeof SuperscriptEditing, typeof SuperscriptUI];
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName(): "Superscript";
|
|
26
|
+
}
|
package/src/superscript.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/superscript
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import SuperscriptEditing from './superscript/superscriptediting';
|
|
10
|
-
import SuperscriptUI from './superscript/superscriptui';
|
|
11
|
-
/**
|
|
12
|
-
* The superscript feature.
|
|
13
|
-
*
|
|
14
|
-
* It loads the {@link module:basic-styles/superscript/superscriptediting~SuperscriptEditing} and
|
|
15
|
-
* {@link module:basic-styles/superscript/superscriptui~SuperscriptUI} plugins.
|
|
16
|
-
*/
|
|
17
|
-
export default class Superscript extends Plugin {
|
|
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
|
-
}
|
|
30
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module basic-styles/superscript
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import SuperscriptEditing from './superscript/superscriptediting';
|
|
10
|
+
import SuperscriptUI from './superscript/superscriptui';
|
|
11
|
+
/**
|
|
12
|
+
* The superscript feature.
|
|
13
|
+
*
|
|
14
|
+
* It loads the {@link module:basic-styles/superscript/superscriptediting~SuperscriptEditing} and
|
|
15
|
+
* {@link module:basic-styles/superscript/superscriptui~SuperscriptUI} plugins.
|
|
16
|
+
*/
|
|
17
|
+
export default class Superscript extends Plugin {
|
|
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
|
+
}
|
|
30
|
+
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/underline/underlineediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
/**
|
|
10
|
-
* The underline editing feature.
|
|
11
|
-
*
|
|
12
|
-
* It registers the `'underline'` command, the <kbd>Ctrl+U</kbd> keystroke
|
|
13
|
-
* and introduces the `underline` attribute in the model which renders to the view as an `<u>` element.
|
|
14
|
-
*/
|
|
15
|
-
export default class UnderlineEditing extends Plugin {
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
static get pluginName():
|
|
20
|
-
/**
|
|
21
|
-
* @inheritDoc
|
|
22
|
-
*/
|
|
23
|
-
init(): void;
|
|
24
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module basic-styles/underline/underlineediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
/**
|
|
10
|
+
* The underline editing feature.
|
|
11
|
+
*
|
|
12
|
+
* It registers the `'underline'` command, the <kbd>Ctrl+U</kbd> keystroke
|
|
13
|
+
* and introduces the `underline` attribute in the model which renders to the view as an `<u>` element.
|
|
14
|
+
*/
|
|
15
|
+
export default class UnderlineEditing extends Plugin {
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
static get pluginName(): "UnderlineEditing";
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
init(): void;
|
|
24
|
+
}
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/underline/underlineediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import AttributeCommand from '../attributecommand';
|
|
10
|
-
const UNDERLINE = 'underline';
|
|
11
|
-
/**
|
|
12
|
-
* The underline editing feature.
|
|
13
|
-
*
|
|
14
|
-
* It registers the `'underline'` command, the <kbd>Ctrl+U</kbd> keystroke
|
|
15
|
-
* and introduces the `underline` attribute in the model which renders to the view as an `<u>` element.
|
|
16
|
-
*/
|
|
17
|
-
export default class UnderlineEditing extends Plugin {
|
|
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
|
-
}
|
|
49
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module basic-styles/underline/underlineediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import AttributeCommand from '../attributecommand';
|
|
10
|
+
const UNDERLINE = 'underline';
|
|
11
|
+
/**
|
|
12
|
+
* The underline editing feature.
|
|
13
|
+
*
|
|
14
|
+
* It registers the `'underline'` command, the <kbd>Ctrl+U</kbd> keystroke
|
|
15
|
+
* and introduces the `underline` attribute in the model which renders to the view as an `<u>` element.
|
|
16
|
+
*/
|
|
17
|
+
export default class UnderlineEditing extends Plugin {
|
|
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
|
+
}
|
|
49
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/underline/underlineui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
/**
|
|
10
|
-
* The underline UI feature. It introduces the Underline button.
|
|
11
|
-
*/
|
|
12
|
-
export default class UnderlineUI extends Plugin {
|
|
13
|
-
/**
|
|
14
|
-
* @inheritDoc
|
|
15
|
-
*/
|
|
16
|
-
static get pluginName():
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
init(): void;
|
|
21
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module basic-styles/underline/underlineui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
/**
|
|
10
|
+
* The underline UI feature. It introduces the Underline button.
|
|
11
|
+
*/
|
|
12
|
+
export default class UnderlineUI extends Plugin {
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
static get pluginName(): "UnderlineUI";
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
init(): void;
|
|
21
|
+
}
|