@ckeditor/ckeditor5-basic-styles 40.0.0 → 40.2.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.
- package/CHANGELOG.md +25 -25
- package/LICENSE.md +2 -2
- package/package.json +2 -2
- 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/build/basic-styles.js.map +0 -1
package/src/augmentation.d.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
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
|
-
import type { Superscript, Subscript, Bold, Code, AttributeCommand, BoldUI, CodeEditing, CodeUI, Italic, ItalicEditing, ItalicUI, Strikethrough, StrikethroughEditing, StrikethroughUI, SubscriptEditing, SubscriptUI, SuperscriptEditing, SuperscriptUI, Underline, UnderlineEditing, UnderlineUI } from './index';
|
|
6
|
-
declare module '@ckeditor/ckeditor5-core' {
|
|
7
|
-
interface PluginsMap {
|
|
8
|
-
[Superscript.pluginName]: Superscript;
|
|
9
|
-
[Subscript.pluginName]: Subscript;
|
|
10
|
-
[Bold.pluginName]: Bold;
|
|
11
|
-
[Code.pluginName]: Code;
|
|
12
|
-
[Code.pluginName]: Code;
|
|
13
|
-
[Code.pluginName]: Code;
|
|
14
|
-
[BoldUI.pluginName]: BoldUI;
|
|
15
|
-
[CodeEditing.pluginName]: CodeEditing;
|
|
16
|
-
[CodeUI.pluginName]: CodeUI;
|
|
17
|
-
[Italic.pluginName]: Italic;
|
|
18
|
-
[ItalicEditing.pluginName]: ItalicEditing;
|
|
19
|
-
[ItalicUI.pluginName]: ItalicUI;
|
|
20
|
-
[Strikethrough.pluginName]: Strikethrough;
|
|
21
|
-
[StrikethroughEditing.pluginName]: StrikethroughEditing;
|
|
22
|
-
[StrikethroughUI.pluginName]: StrikethroughUI;
|
|
23
|
-
[SubscriptEditing.pluginName]: SubscriptEditing;
|
|
24
|
-
[SubscriptUI.pluginName]: SubscriptUI;
|
|
25
|
-
[SuperscriptEditing.pluginName]: SuperscriptEditing;
|
|
26
|
-
[SuperscriptUI.pluginName]: SuperscriptUI;
|
|
27
|
-
[Underline.pluginName]: Underline;
|
|
28
|
-
[UnderlineEditing.pluginName]: UnderlineEditing;
|
|
29
|
-
[UnderlineUI.pluginName]: UnderlineUI;
|
|
30
|
-
}
|
|
31
|
-
interface CommandsMap {
|
|
32
|
-
bold: AttributeCommand;
|
|
33
|
-
code: AttributeCommand;
|
|
34
|
-
italic: AttributeCommand;
|
|
35
|
-
strikethrough: AttributeCommand;
|
|
36
|
-
subscript: AttributeCommand;
|
|
37
|
-
superscript: AttributeCommand;
|
|
38
|
-
underline: AttributeCommand;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
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
|
+
import type { Superscript, Subscript, Bold, Code, AttributeCommand, BoldUI, CodeEditing, CodeUI, Italic, ItalicEditing, ItalicUI, Strikethrough, StrikethroughEditing, StrikethroughUI, SubscriptEditing, SubscriptUI, SuperscriptEditing, SuperscriptUI, Underline, UnderlineEditing, UnderlineUI } from './index';
|
|
6
|
+
declare module '@ckeditor/ckeditor5-core' {
|
|
7
|
+
interface PluginsMap {
|
|
8
|
+
[Superscript.pluginName]: Superscript;
|
|
9
|
+
[Subscript.pluginName]: Subscript;
|
|
10
|
+
[Bold.pluginName]: Bold;
|
|
11
|
+
[Code.pluginName]: Code;
|
|
12
|
+
[Code.pluginName]: Code;
|
|
13
|
+
[Code.pluginName]: Code;
|
|
14
|
+
[BoldUI.pluginName]: BoldUI;
|
|
15
|
+
[CodeEditing.pluginName]: CodeEditing;
|
|
16
|
+
[CodeUI.pluginName]: CodeUI;
|
|
17
|
+
[Italic.pluginName]: Italic;
|
|
18
|
+
[ItalicEditing.pluginName]: ItalicEditing;
|
|
19
|
+
[ItalicUI.pluginName]: ItalicUI;
|
|
20
|
+
[Strikethrough.pluginName]: Strikethrough;
|
|
21
|
+
[StrikethroughEditing.pluginName]: StrikethroughEditing;
|
|
22
|
+
[StrikethroughUI.pluginName]: StrikethroughUI;
|
|
23
|
+
[SubscriptEditing.pluginName]: SubscriptEditing;
|
|
24
|
+
[SubscriptUI.pluginName]: SubscriptUI;
|
|
25
|
+
[SuperscriptEditing.pluginName]: SuperscriptEditing;
|
|
26
|
+
[SuperscriptUI.pluginName]: SuperscriptUI;
|
|
27
|
+
[Underline.pluginName]: Underline;
|
|
28
|
+
[UnderlineEditing.pluginName]: UnderlineEditing;
|
|
29
|
+
[UnderlineUI.pluginName]: UnderlineUI;
|
|
30
|
+
}
|
|
31
|
+
interface CommandsMap {
|
|
32
|
+
bold: AttributeCommand;
|
|
33
|
+
code: AttributeCommand;
|
|
34
|
+
italic: AttributeCommand;
|
|
35
|
+
strikethrough: AttributeCommand;
|
|
36
|
+
subscript: AttributeCommand;
|
|
37
|
+
superscript: AttributeCommand;
|
|
38
|
+
underline: AttributeCommand;
|
|
39
|
+
}
|
|
40
|
+
}
|
package/src/augmentation.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
-
export {};
|
|
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
|
+
export {};
|
|
@@ -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/bold/boldediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
/**
|
|
10
|
-
* The bold editing feature.
|
|
11
|
-
*
|
|
12
|
-
* It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view
|
|
13
|
-
* as a `<strong>` element.
|
|
14
|
-
*/
|
|
15
|
-
export default class BoldEditing extends Plugin {
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
static get pluginName(): "BoldEditing";
|
|
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/bold/boldediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
/**
|
|
10
|
+
* The bold editing feature.
|
|
11
|
+
*
|
|
12
|
+
* It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view
|
|
13
|
+
* as a `<strong>` element.
|
|
14
|
+
*/
|
|
15
|
+
export default class BoldEditing extends Plugin {
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
static get pluginName(): "BoldEditing";
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
init(): void;
|
|
24
|
+
}
|
package/src/bold/boldediting.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
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/bold/boldediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import AttributeCommand from '../attributecommand';
|
|
10
|
-
const BOLD = 'bold';
|
|
11
|
-
/**
|
|
12
|
-
* The bold editing feature.
|
|
13
|
-
*
|
|
14
|
-
* It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view
|
|
15
|
-
* as a `<strong>` element.
|
|
16
|
-
*/
|
|
17
|
-
export default class BoldEditing extends Plugin {
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
static get pluginName() {
|
|
22
|
-
return 'BoldEditing';
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @inheritDoc
|
|
26
|
-
*/
|
|
27
|
-
init() {
|
|
28
|
-
const editor = this.editor;
|
|
29
|
-
// Allow bold attribute on text nodes.
|
|
30
|
-
editor.model.schema.extend('$text', { allowAttributes: BOLD });
|
|
31
|
-
editor.model.schema.setAttributeProperties(BOLD, {
|
|
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: BOLD,
|
|
38
|
-
view: 'strong',
|
|
39
|
-
upcastAlso: [
|
|
40
|
-
'b',
|
|
41
|
-
viewElement => {
|
|
42
|
-
const fontWeight = viewElement.getStyle('font-weight');
|
|
43
|
-
if (!fontWeight) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
// Value of the `font-weight` attribute can be defined as a string or a number.
|
|
47
|
-
if (fontWeight == 'bold' || Number(fontWeight) >= 600) {
|
|
48
|
-
return {
|
|
49
|
-
name: true,
|
|
50
|
-
styles: ['font-weight']
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
});
|
|
57
|
-
// Create bold command.
|
|
58
|
-
editor.commands.add(BOLD, new AttributeCommand(editor, BOLD));
|
|
59
|
-
// Set the Ctrl+B keystroke.
|
|
60
|
-
editor.keystrokes.set('CTRL+B', BOLD);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
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/bold/boldediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import AttributeCommand from '../attributecommand';
|
|
10
|
+
const BOLD = 'bold';
|
|
11
|
+
/**
|
|
12
|
+
* The bold editing feature.
|
|
13
|
+
*
|
|
14
|
+
* It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view
|
|
15
|
+
* as a `<strong>` element.
|
|
16
|
+
*/
|
|
17
|
+
export default class BoldEditing extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get pluginName() {
|
|
22
|
+
return 'BoldEditing';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
init() {
|
|
28
|
+
const editor = this.editor;
|
|
29
|
+
// Allow bold attribute on text nodes.
|
|
30
|
+
editor.model.schema.extend('$text', { allowAttributes: BOLD });
|
|
31
|
+
editor.model.schema.setAttributeProperties(BOLD, {
|
|
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: BOLD,
|
|
38
|
+
view: 'strong',
|
|
39
|
+
upcastAlso: [
|
|
40
|
+
'b',
|
|
41
|
+
viewElement => {
|
|
42
|
+
const fontWeight = viewElement.getStyle('font-weight');
|
|
43
|
+
if (!fontWeight) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
// Value of the `font-weight` attribute can be defined as a string or a number.
|
|
47
|
+
if (fontWeight == 'bold' || Number(fontWeight) >= 600) {
|
|
48
|
+
return {
|
|
49
|
+
name: true,
|
|
50
|
+
styles: ['font-weight']
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
// Create bold command.
|
|
58
|
+
editor.commands.add(BOLD, new AttributeCommand(editor, BOLD));
|
|
59
|
+
// Set the Ctrl+B keystroke.
|
|
60
|
+
editor.keystrokes.set('CTRL+B', BOLD);
|
|
61
|
+
}
|
|
62
|
+
}
|
package/src/bold/boldui.d.ts
CHANGED
|
@@ -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/bold/boldui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
/**
|
|
10
|
-
* The bold UI feature. It introduces the Bold button.
|
|
11
|
-
*/
|
|
12
|
-
export default class BoldUI extends Plugin {
|
|
13
|
-
/**
|
|
14
|
-
* @inheritDoc
|
|
15
|
-
*/
|
|
16
|
-
static get pluginName(): "BoldUI";
|
|
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/bold/boldui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
/**
|
|
10
|
+
* The bold UI feature. It introduces the Bold button.
|
|
11
|
+
*/
|
|
12
|
+
export default class BoldUI extends Plugin {
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
static get pluginName(): "BoldUI";
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
init(): void;
|
|
21
|
+
}
|
package/src/bold/boldui.js
CHANGED
|
@@ -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/bold/boldui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin, icons } from 'ckeditor5/src/core';
|
|
9
|
-
import { ButtonView } from 'ckeditor5/src/ui';
|
|
10
|
-
const BOLD = 'bold';
|
|
11
|
-
/**
|
|
12
|
-
* The bold UI feature. It introduces the Bold button.
|
|
13
|
-
*/
|
|
14
|
-
export default class BoldUI extends Plugin {
|
|
15
|
-
/**
|
|
16
|
-
* @inheritDoc
|
|
17
|
-
*/
|
|
18
|
-
static get pluginName() {
|
|
19
|
-
return 'BoldUI';
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* @inheritDoc
|
|
23
|
-
*/
|
|
24
|
-
init() {
|
|
25
|
-
const editor = this.editor;
|
|
26
|
-
const t = editor.t;
|
|
27
|
-
// Add bold button to feature components.
|
|
28
|
-
editor.ui.componentFactory.add(BOLD, locale => {
|
|
29
|
-
const command = editor.commands.get(BOLD);
|
|
30
|
-
const view = new ButtonView(locale);
|
|
31
|
-
view.set({
|
|
32
|
-
label: t('Bold'),
|
|
33
|
-
icon: icons.bold,
|
|
34
|
-
keystroke: 'CTRL+B',
|
|
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(BOLD);
|
|
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/bold/boldui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, icons } from 'ckeditor5/src/core';
|
|
9
|
+
import { ButtonView } from 'ckeditor5/src/ui';
|
|
10
|
+
const BOLD = 'bold';
|
|
11
|
+
/**
|
|
12
|
+
* The bold UI feature. It introduces the Bold button.
|
|
13
|
+
*/
|
|
14
|
+
export default class BoldUI extends Plugin {
|
|
15
|
+
/**
|
|
16
|
+
* @inheritDoc
|
|
17
|
+
*/
|
|
18
|
+
static get pluginName() {
|
|
19
|
+
return 'BoldUI';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
init() {
|
|
25
|
+
const editor = this.editor;
|
|
26
|
+
const t = editor.t;
|
|
27
|
+
// Add bold button to feature components.
|
|
28
|
+
editor.ui.componentFactory.add(BOLD, locale => {
|
|
29
|
+
const command = editor.commands.get(BOLD);
|
|
30
|
+
const view = new ButtonView(locale);
|
|
31
|
+
view.set({
|
|
32
|
+
label: t('Bold'),
|
|
33
|
+
icon: icons.bold,
|
|
34
|
+
keystroke: 'CTRL+B',
|
|
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(BOLD);
|
|
42
|
+
editor.editing.view.focus();
|
|
43
|
+
});
|
|
44
|
+
return view;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
package/src/bold.d.ts
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
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/bold
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import BoldEditing from './bold/boldediting';
|
|
10
|
-
import BoldUI from './bold/boldui';
|
|
11
|
-
/**
|
|
12
|
-
* The bold feature.
|
|
13
|
-
*
|
|
14
|
-
* For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
|
|
15
|
-
* and the {@glink api/basic-styles package page}.
|
|
16
|
-
*
|
|
17
|
-
* This is a "glue" plugin which loads the {@link module:basic-styles/bold/boldediting~BoldEditing bold editing feature}
|
|
18
|
-
* and {@link module:basic-styles/bold/boldui~BoldUI bold UI feature}.
|
|
19
|
-
*/
|
|
20
|
-
export default class Bold extends Plugin {
|
|
21
|
-
/**
|
|
22
|
-
* @inheritDoc
|
|
23
|
-
*/
|
|
24
|
-
static get requires(): readonly [typeof BoldEditing, typeof BoldUI];
|
|
25
|
-
/**
|
|
26
|
-
* @inheritDoc
|
|
27
|
-
*/
|
|
28
|
-
static get pluginName(): "Bold";
|
|
29
|
-
}
|
|
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/bold
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import BoldEditing from './bold/boldediting';
|
|
10
|
+
import BoldUI from './bold/boldui';
|
|
11
|
+
/**
|
|
12
|
+
* The bold feature.
|
|
13
|
+
*
|
|
14
|
+
* For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
|
|
15
|
+
* and the {@glink api/basic-styles package page}.
|
|
16
|
+
*
|
|
17
|
+
* This is a "glue" plugin which loads the {@link module:basic-styles/bold/boldediting~BoldEditing bold editing feature}
|
|
18
|
+
* and {@link module:basic-styles/bold/boldui~BoldUI bold UI feature}.
|
|
19
|
+
*/
|
|
20
|
+
export default class Bold extends Plugin {
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static get requires(): readonly [typeof BoldEditing, typeof BoldUI];
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get pluginName(): "Bold";
|
|
29
|
+
}
|
package/src/bold.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
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/bold
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import BoldEditing from './bold/boldediting';
|
|
10
|
-
import BoldUI from './bold/boldui';
|
|
11
|
-
/**
|
|
12
|
-
* The bold feature.
|
|
13
|
-
*
|
|
14
|
-
* For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
|
|
15
|
-
* and the {@glink api/basic-styles package page}.
|
|
16
|
-
*
|
|
17
|
-
* This is a "glue" plugin which loads the {@link module:basic-styles/bold/boldediting~BoldEditing bold editing feature}
|
|
18
|
-
* and {@link module:basic-styles/bold/boldui~BoldUI bold UI feature}.
|
|
19
|
-
*/
|
|
20
|
-
export default class Bold extends Plugin {
|
|
21
|
-
/**
|
|
22
|
-
* @inheritDoc
|
|
23
|
-
*/
|
|
24
|
-
static get requires() {
|
|
25
|
-
return [BoldEditing, BoldUI];
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
static get pluginName() {
|
|
31
|
-
return 'Bold';
|
|
32
|
-
}
|
|
33
|
-
}
|
|
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/bold
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import BoldEditing from './bold/boldediting';
|
|
10
|
+
import BoldUI from './bold/boldui';
|
|
11
|
+
/**
|
|
12
|
+
* The bold feature.
|
|
13
|
+
*
|
|
14
|
+
* For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
|
|
15
|
+
* and the {@glink api/basic-styles package page}.
|
|
16
|
+
*
|
|
17
|
+
* This is a "glue" plugin which loads the {@link module:basic-styles/bold/boldediting~BoldEditing bold editing feature}
|
|
18
|
+
* and {@link module:basic-styles/bold/boldui~BoldUI bold UI feature}.
|
|
19
|
+
*/
|
|
20
|
+
export default class Bold extends Plugin {
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static get requires() {
|
|
25
|
+
return [BoldEditing, BoldUI];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get pluginName() {
|
|
31
|
+
return 'Bold';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,29 +1,29 @@
|
|
|
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/code/codeediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
-
import { TwoStepCaretMovement } from 'ckeditor5/src/typing';
|
|
10
|
-
/**
|
|
11
|
-
* The code editing feature.
|
|
12
|
-
*
|
|
13
|
-
* It registers the `'code'` command and introduces the `code` attribute in the model which renders to the view
|
|
14
|
-
* as a `<code>` element.
|
|
15
|
-
*/
|
|
16
|
-
export default class CodeEditing extends Plugin {
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
static get pluginName(): "CodeEditing";
|
|
21
|
-
/**
|
|
22
|
-
* @inheritDoc
|
|
23
|
-
*/
|
|
24
|
-
static get requires(): readonly [typeof TwoStepCaretMovement];
|
|
25
|
-
/**
|
|
26
|
-
* @inheritDoc
|
|
27
|
-
*/
|
|
28
|
-
init(): void;
|
|
29
|
-
}
|
|
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/code/codeediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
9
|
+
import { TwoStepCaretMovement } from 'ckeditor5/src/typing';
|
|
10
|
+
/**
|
|
11
|
+
* The code editing feature.
|
|
12
|
+
*
|
|
13
|
+
* It registers the `'code'` command and introduces the `code` attribute in the model which renders to the view
|
|
14
|
+
* as a `<code>` element.
|
|
15
|
+
*/
|
|
16
|
+
export default class CodeEditing extends Plugin {
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get pluginName(): "CodeEditing";
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static get requires(): readonly [typeof TwoStepCaretMovement];
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
init(): void;
|
|
29
|
+
}
|