@ckeditor/ckeditor5-basic-styles 47.6.1-alpha.1 → 48.0.0-alpha.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/ckeditor5-metadata.json +14 -14
- package/{src → dist}/attributecommand.d.ts +1 -1
- package/{src → dist}/bold/boldediting.d.ts +1 -1
- package/{src → dist}/bold/boldui.d.ts +1 -1
- package/{src → dist}/bold.d.ts +1 -1
- package/{src → dist}/code/codeediting.d.ts +2 -2
- package/{src → dist}/code/codeui.d.ts +1 -1
- package/{src → dist}/code.d.ts +1 -1
- package/dist/index-content.css +3 -3
- package/dist/index-editor.css +1 -1
- package/dist/index.css +5 -10
- package/dist/index.css.map +1 -1
- package/dist/index.js.map +1 -1
- package/{src → dist}/italic/italicediting.d.ts +1 -1
- package/{src → dist}/italic/italicui.d.ts +1 -1
- package/{src → dist}/italic.d.ts +1 -1
- package/{src → dist}/strikethrough/strikethroughediting.d.ts +1 -1
- package/{src → dist}/strikethrough/strikethroughui.d.ts +1 -1
- package/{src → dist}/strikethrough.d.ts +1 -1
- package/{src → dist}/subscript/subscriptediting.d.ts +1 -1
- package/{src → dist}/subscript/subscriptui.d.ts +1 -1
- package/{src → dist}/subscript.d.ts +1 -1
- package/{src → dist}/superscript/superscriptediting.d.ts +1 -1
- package/{src → dist}/superscript/superscriptui.d.ts +1 -1
- package/{src → dist}/superscript.d.ts +1 -1
- package/{src → dist}/underline/underlineediting.d.ts +1 -1
- package/{src → dist}/underline/underlineui.d.ts +1 -1
- package/{src → dist}/underline.d.ts +1 -1
- package/{src → dist}/utils.d.ts +2 -2
- package/package.json +24 -48
- package/build/basic-styles.js +0 -5
- package/build/translations/af.js +0 -1
- package/build/translations/ar.js +0 -1
- package/build/translations/ast.js +0 -1
- package/build/translations/az.js +0 -1
- package/build/translations/be.js +0 -1
- package/build/translations/bg.js +0 -1
- package/build/translations/bn.js +0 -1
- package/build/translations/bs.js +0 -1
- package/build/translations/ca.js +0 -1
- package/build/translations/cs.js +0 -1
- package/build/translations/da.js +0 -1
- package/build/translations/de-ch.js +0 -1
- package/build/translations/de.js +0 -1
- package/build/translations/el.js +0 -1
- package/build/translations/en-au.js +0 -1
- package/build/translations/en-gb.js +0 -1
- package/build/translations/eo.js +0 -1
- package/build/translations/es-co.js +0 -1
- package/build/translations/es.js +0 -1
- package/build/translations/et.js +0 -1
- package/build/translations/eu.js +0 -1
- package/build/translations/fa.js +0 -1
- package/build/translations/fi.js +0 -1
- package/build/translations/fr.js +0 -1
- package/build/translations/gl.js +0 -1
- package/build/translations/gu.js +0 -1
- package/build/translations/he.js +0 -1
- package/build/translations/hi.js +0 -1
- package/build/translations/hr.js +0 -1
- package/build/translations/hu.js +0 -1
- package/build/translations/hy.js +0 -1
- package/build/translations/id.js +0 -1
- package/build/translations/it.js +0 -1
- package/build/translations/ja.js +0 -1
- package/build/translations/jv.js +0 -1
- package/build/translations/kk.js +0 -1
- package/build/translations/km.js +0 -1
- package/build/translations/kn.js +0 -1
- package/build/translations/ko.js +0 -1
- package/build/translations/ku.js +0 -1
- package/build/translations/lt.js +0 -1
- package/build/translations/lv.js +0 -1
- package/build/translations/ms.js +0 -1
- package/build/translations/nb.js +0 -1
- package/build/translations/ne.js +0 -1
- package/build/translations/nl.js +0 -1
- package/build/translations/no.js +0 -1
- package/build/translations/oc.js +0 -1
- package/build/translations/pl.js +0 -1
- package/build/translations/pt-br.js +0 -1
- package/build/translations/pt.js +0 -1
- package/build/translations/ro.js +0 -1
- package/build/translations/ru.js +0 -1
- package/build/translations/si.js +0 -1
- package/build/translations/sk.js +0 -1
- package/build/translations/sl.js +0 -1
- package/build/translations/sq.js +0 -1
- package/build/translations/sr-latn.js +0 -1
- package/build/translations/sr.js +0 -1
- package/build/translations/sv.js +0 -1
- package/build/translations/th.js +0 -1
- package/build/translations/ti.js +0 -1
- package/build/translations/tk.js +0 -1
- package/build/translations/tr.js +0 -1
- package/build/translations/tt.js +0 -1
- package/build/translations/ug.js +0 -1
- package/build/translations/uk.js +0 -1
- package/build/translations/ur.js +0 -1
- package/build/translations/uz.js +0 -1
- package/build/translations/vi.js +0 -1
- package/build/translations/zh-cn.js +0 -1
- package/build/translations/zh.js +0 -1
- package/lang/contexts.json +0 -14
- package/lang/translations/af.po +0 -60
- package/lang/translations/ar.po +0 -60
- package/lang/translations/ast.po +0 -60
- package/lang/translations/az.po +0 -60
- package/lang/translations/be.po +0 -60
- package/lang/translations/bg.po +0 -60
- package/lang/translations/bn.po +0 -60
- package/lang/translations/bs.po +0 -60
- package/lang/translations/ca.po +0 -60
- package/lang/translations/cs.po +0 -60
- package/lang/translations/da.po +0 -60
- package/lang/translations/de-ch.po +0 -60
- package/lang/translations/de.po +0 -60
- package/lang/translations/el.po +0 -60
- package/lang/translations/en-au.po +0 -60
- package/lang/translations/en-gb.po +0 -60
- package/lang/translations/en.po +0 -60
- package/lang/translations/eo.po +0 -60
- package/lang/translations/es-co.po +0 -60
- package/lang/translations/es.po +0 -60
- package/lang/translations/et.po +0 -60
- package/lang/translations/eu.po +0 -60
- package/lang/translations/fa.po +0 -60
- package/lang/translations/fi.po +0 -60
- package/lang/translations/fr.po +0 -60
- package/lang/translations/gl.po +0 -60
- package/lang/translations/gu.po +0 -60
- package/lang/translations/he.po +0 -60
- package/lang/translations/hi.po +0 -60
- package/lang/translations/hr.po +0 -60
- package/lang/translations/hu.po +0 -60
- package/lang/translations/hy.po +0 -60
- package/lang/translations/id.po +0 -60
- package/lang/translations/it.po +0 -60
- package/lang/translations/ja.po +0 -60
- package/lang/translations/jv.po +0 -60
- package/lang/translations/kk.po +0 -60
- package/lang/translations/km.po +0 -60
- package/lang/translations/kn.po +0 -60
- package/lang/translations/ko.po +0 -60
- package/lang/translations/ku.po +0 -60
- package/lang/translations/lt.po +0 -60
- package/lang/translations/lv.po +0 -60
- package/lang/translations/ms.po +0 -60
- package/lang/translations/nb.po +0 -60
- package/lang/translations/ne.po +0 -60
- package/lang/translations/nl.po +0 -60
- package/lang/translations/no.po +0 -60
- package/lang/translations/oc.po +0 -60
- package/lang/translations/pl.po +0 -60
- package/lang/translations/pt-br.po +0 -60
- package/lang/translations/pt.po +0 -60
- package/lang/translations/ro.po +0 -60
- package/lang/translations/ru.po +0 -60
- package/lang/translations/si.po +0 -60
- package/lang/translations/sk.po +0 -60
- package/lang/translations/sl.po +0 -60
- package/lang/translations/sq.po +0 -60
- package/lang/translations/sr-latn.po +0 -60
- package/lang/translations/sr.po +0 -60
- package/lang/translations/sv.po +0 -60
- package/lang/translations/th.po +0 -60
- package/lang/translations/ti.po +0 -60
- package/lang/translations/tk.po +0 -60
- package/lang/translations/tr.po +0 -60
- package/lang/translations/tt.po +0 -60
- package/lang/translations/ug.po +0 -60
- package/lang/translations/uk.po +0 -60
- package/lang/translations/ur.po +0 -60
- package/lang/translations/uz.po +0 -60
- package/lang/translations/vi.po +0 -60
- package/lang/translations/zh-cn.po +0 -60
- package/lang/translations/zh.po +0 -60
- package/src/attributecommand.js +0 -118
- package/src/augmentation.js +0 -5
- package/src/bold/boldediting.js +0 -78
- package/src/bold/boldui.js +0 -47
- package/src/bold.js +0 -39
- package/src/code/codeediting.js +0 -73
- package/src/code/codeui.js +0 -47
- package/src/code.js +0 -40
- package/src/index.js +0 -31
- package/src/italic/italicediting.js +0 -68
- package/src/italic/italicui.js +0 -47
- package/src/italic.js +0 -39
- package/src/strikethrough/strikethroughediting.js +0 -70
- package/src/strikethrough/strikethroughui.js +0 -47
- package/src/strikethrough.js +0 -39
- package/src/subscript/subscriptediting.js +0 -56
- package/src/subscript/subscriptui.js +0 -46
- package/src/subscript.js +0 -36
- package/src/superscript/superscriptediting.js +0 -56
- package/src/superscript/superscriptui.js +0 -46
- package/src/superscript.js +0 -36
- package/src/underline/underlineediting.js +0 -65
- package/src/underline/underlineui.js +0 -47
- package/src/underline.js +0 -39
- package/src/utils.js +0 -40
- package/theme/code.css +0 -14
- /package/{src → dist}/augmentation.d.ts +0 -0
- /package/{src → dist}/index.d.ts +0 -0
package/src/bold/boldediting.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/bold/boldediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { AttributeCommand } from '../attributecommand.js';
|
|
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 class BoldEditing extends Plugin {
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
static get pluginName() {
|
|
22
|
-
return 'BoldEditing';
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @inheritDoc
|
|
26
|
-
*/
|
|
27
|
-
static get isOfficialPlugin() {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* @inheritDoc
|
|
32
|
-
*/
|
|
33
|
-
init() {
|
|
34
|
-
const editor = this.editor;
|
|
35
|
-
const t = this.editor.t;
|
|
36
|
-
// Allow bold attribute on text nodes.
|
|
37
|
-
editor.model.schema.extend('$text', { allowAttributes: BOLD });
|
|
38
|
-
editor.model.schema.setAttributeProperties(BOLD, {
|
|
39
|
-
isFormatting: true,
|
|
40
|
-
copyOnEnter: true
|
|
41
|
-
});
|
|
42
|
-
// Build converter from model to view for data and editing pipelines.
|
|
43
|
-
editor.conversion.attributeToElement({
|
|
44
|
-
model: BOLD,
|
|
45
|
-
view: 'strong',
|
|
46
|
-
upcastAlso: [
|
|
47
|
-
'b',
|
|
48
|
-
viewElement => {
|
|
49
|
-
const fontWeight = viewElement.getStyle('font-weight');
|
|
50
|
-
if (!fontWeight) {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
// Value of the `font-weight` attribute can be defined as a string or a number.
|
|
54
|
-
if (fontWeight == 'bold' || Number(fontWeight) >= 600) {
|
|
55
|
-
return {
|
|
56
|
-
name: true,
|
|
57
|
-
styles: ['font-weight']
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
});
|
|
64
|
-
// Create bold command.
|
|
65
|
-
editor.commands.add(BOLD, new AttributeCommand(editor, BOLD));
|
|
66
|
-
// Set the Ctrl+B keystroke.
|
|
67
|
-
editor.keystrokes.set('CTRL+B', BOLD);
|
|
68
|
-
// Add the information about the keystroke to the accessibility database.
|
|
69
|
-
editor.accessibility.addKeystrokeInfos({
|
|
70
|
-
keystrokes: [
|
|
71
|
-
{
|
|
72
|
-
label: t('Bold text'),
|
|
73
|
-
keystroke: 'CTRL+B'
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
}
|
package/src/bold/boldui.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/bold/boldui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { IconBold } from 'ckeditor5/src/icons.js';
|
|
10
|
-
import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
11
|
-
import { getButtonCreator } from '../utils.js';
|
|
12
|
-
const BOLD = 'bold';
|
|
13
|
-
/**
|
|
14
|
-
* The bold UI feature. It introduces the Bold button.
|
|
15
|
-
*/
|
|
16
|
-
export class BoldUI extends Plugin {
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
static get pluginName() {
|
|
21
|
-
return 'BoldUI';
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
static get isOfficialPlugin() {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
init() {
|
|
33
|
-
const editor = this.editor;
|
|
34
|
-
const t = editor.locale.t;
|
|
35
|
-
const createButton = getButtonCreator({
|
|
36
|
-
editor,
|
|
37
|
-
commandName: BOLD,
|
|
38
|
-
plugin: this,
|
|
39
|
-
icon: IconBold,
|
|
40
|
-
label: t('Bold'),
|
|
41
|
-
keystroke: 'CTRL+B'
|
|
42
|
-
});
|
|
43
|
-
// Add bold button to feature components.
|
|
44
|
-
editor.ui.componentFactory.add(BOLD, () => createButton(ButtonView));
|
|
45
|
-
editor.ui.componentFactory.add('menuBar:' + BOLD, () => createButton(MenuBarMenuListItemButtonView));
|
|
46
|
-
}
|
|
47
|
-
}
|
package/src/bold.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/bold
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { BoldEditing } from './bold/boldediting.js';
|
|
10
|
-
import { BoldUI } from './bold/boldui.js';
|
|
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 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
|
-
/**
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
static get isOfficialPlugin() {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
}
|
package/src/code/codeediting.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/code/codeediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { TwoStepCaretMovement, inlineHighlight } from 'ckeditor5/src/typing.js';
|
|
10
|
-
import { AttributeCommand } from '../attributecommand.js';
|
|
11
|
-
const CODE = 'code';
|
|
12
|
-
const HIGHLIGHT_CLASS = 'ck-code_selected';
|
|
13
|
-
/**
|
|
14
|
-
* The code editing feature.
|
|
15
|
-
*
|
|
16
|
-
* It registers the `'code'` command and introduces the `code` attribute in the model which renders to the view
|
|
17
|
-
* as a `<code>` element.
|
|
18
|
-
*/
|
|
19
|
-
export class CodeEditing extends Plugin {
|
|
20
|
-
/**
|
|
21
|
-
* @inheritDoc
|
|
22
|
-
*/
|
|
23
|
-
static get pluginName() {
|
|
24
|
-
return 'CodeEditing';
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* @inheritDoc
|
|
28
|
-
*/
|
|
29
|
-
static get isOfficialPlugin() {
|
|
30
|
-
return true;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* @inheritDoc
|
|
34
|
-
*/
|
|
35
|
-
static get requires() {
|
|
36
|
-
return [TwoStepCaretMovement];
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @inheritDoc
|
|
40
|
-
*/
|
|
41
|
-
init() {
|
|
42
|
-
const editor = this.editor;
|
|
43
|
-
const t = this.editor.t;
|
|
44
|
-
// Allow code attribute on text nodes.
|
|
45
|
-
editor.model.schema.extend('$text', { allowAttributes: CODE });
|
|
46
|
-
editor.model.schema.setAttributeProperties(CODE, {
|
|
47
|
-
isFormatting: true,
|
|
48
|
-
copyOnEnter: false
|
|
49
|
-
});
|
|
50
|
-
editor.conversion.attributeToElement({
|
|
51
|
-
model: CODE,
|
|
52
|
-
view: 'code'
|
|
53
|
-
});
|
|
54
|
-
// Create code command.
|
|
55
|
-
editor.commands.add(CODE, new AttributeCommand(editor, CODE));
|
|
56
|
-
// Enable two-step caret movement for `code` attribute.
|
|
57
|
-
editor.plugins.get(TwoStepCaretMovement).registerAttribute(CODE);
|
|
58
|
-
// Setup highlight over selected element.
|
|
59
|
-
inlineHighlight(editor, CODE, 'code', HIGHLIGHT_CLASS);
|
|
60
|
-
// Add the information about the keystroke to the accessibility database.
|
|
61
|
-
editor.accessibility.addKeystrokeInfos({
|
|
62
|
-
keystrokes: [
|
|
63
|
-
{
|
|
64
|
-
label: t('Move out of an inline code style'),
|
|
65
|
-
keystroke: [
|
|
66
|
-
['arrowleft', 'arrowleft'],
|
|
67
|
-
['arrowright', 'arrowright']
|
|
68
|
-
]
|
|
69
|
-
}
|
|
70
|
-
]
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
package/src/code/codeui.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/code/codeui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { IconCode } from 'ckeditor5/src/icons.js';
|
|
10
|
-
import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
11
|
-
import { getButtonCreator } from '../utils.js';
|
|
12
|
-
import '../../theme/code.css';
|
|
13
|
-
const CODE = 'code';
|
|
14
|
-
/**
|
|
15
|
-
* The code UI feature. It introduces the Code button.
|
|
16
|
-
*/
|
|
17
|
-
export class CodeUI extends Plugin {
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
static get pluginName() {
|
|
22
|
-
return 'CodeUI';
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @inheritDoc
|
|
26
|
-
*/
|
|
27
|
-
static get isOfficialPlugin() {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* @inheritDoc
|
|
32
|
-
*/
|
|
33
|
-
init() {
|
|
34
|
-
const editor = this.editor;
|
|
35
|
-
const t = editor.locale.t;
|
|
36
|
-
const createButton = getButtonCreator({
|
|
37
|
-
editor,
|
|
38
|
-
commandName: CODE,
|
|
39
|
-
plugin: this,
|
|
40
|
-
icon: IconCode,
|
|
41
|
-
label: t('Code')
|
|
42
|
-
});
|
|
43
|
-
// Add code button to feature components.
|
|
44
|
-
editor.ui.componentFactory.add(CODE, () => createButton(ButtonView));
|
|
45
|
-
editor.ui.componentFactory.add('menuBar:' + CODE, () => createButton(MenuBarMenuListItemButtonView));
|
|
46
|
-
}
|
|
47
|
-
}
|
package/src/code.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/code
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { CodeEditing } from './code/codeediting.js';
|
|
10
|
-
import { CodeUI } from './code/codeui.js';
|
|
11
|
-
import '../theme/code.css';
|
|
12
|
-
/**
|
|
13
|
-
* The code feature.
|
|
14
|
-
*
|
|
15
|
-
* For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
|
|
16
|
-
* and the {@glink api/basic-styles package page}.
|
|
17
|
-
*
|
|
18
|
-
* This is a "glue" plugin which loads the {@link module:basic-styles/code/codeediting~CodeEditing code editing feature}
|
|
19
|
-
* and {@link module:basic-styles/code/codeui~CodeUI code UI feature}.
|
|
20
|
-
*/
|
|
21
|
-
export class Code extends Plugin {
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
static get requires() {
|
|
26
|
-
return [CodeEditing, CodeUI];
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* @inheritDoc
|
|
30
|
-
*/
|
|
31
|
-
static get pluginName() {
|
|
32
|
-
return 'Code';
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @inheritDoc
|
|
36
|
-
*/
|
|
37
|
-
static get isOfficialPlugin() {
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
}
|
package/src/index.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles
|
|
7
|
-
*/
|
|
8
|
-
export { Bold } from './bold.js';
|
|
9
|
-
export { BoldEditing } from './bold/boldediting.js';
|
|
10
|
-
export { BoldUI } from './bold/boldui.js';
|
|
11
|
-
export { Code } from './code.js';
|
|
12
|
-
export { CodeEditing } from './code/codeediting.js';
|
|
13
|
-
export { CodeUI } from './code/codeui.js';
|
|
14
|
-
export { Italic } from './italic.js';
|
|
15
|
-
export { ItalicEditing } from './italic/italicediting.js';
|
|
16
|
-
export { ItalicUI } from './italic/italicui.js';
|
|
17
|
-
export { Strikethrough } from './strikethrough.js';
|
|
18
|
-
export { StrikethroughEditing } from './strikethrough/strikethroughediting.js';
|
|
19
|
-
export { StrikethroughUI } from './strikethrough/strikethroughui.js';
|
|
20
|
-
export { Subscript } from './subscript.js';
|
|
21
|
-
export { SubscriptEditing } from './subscript/subscriptediting.js';
|
|
22
|
-
export { SubscriptUI } from './subscript/subscriptui.js';
|
|
23
|
-
export { Superscript } from './superscript.js';
|
|
24
|
-
export { SuperscriptEditing } from './superscript/superscriptediting.js';
|
|
25
|
-
export { SuperscriptUI } from './superscript/superscriptui.js';
|
|
26
|
-
export { Underline } from './underline.js';
|
|
27
|
-
export { UnderlineEditing } from './underline/underlineediting.js';
|
|
28
|
-
export { UnderlineUI } from './underline/underlineui.js';
|
|
29
|
-
export { AttributeCommand } from './attributecommand.js';
|
|
30
|
-
export { getButtonCreator as _getBasicStylesButtonCreator } from './utils.js';
|
|
31
|
-
import './augmentation.js';
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/italic/italicediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { AttributeCommand } from '../attributecommand.js';
|
|
10
|
-
const ITALIC = 'italic';
|
|
11
|
-
/**
|
|
12
|
-
* The italic editing feature.
|
|
13
|
-
*
|
|
14
|
-
* It registers the `'italic'` command, the <kbd>Ctrl+I</kbd> keystroke and introduces the `italic` attribute in the model
|
|
15
|
-
* which renders to the view as an `<i>` element.
|
|
16
|
-
*/
|
|
17
|
-
export class ItalicEditing extends Plugin {
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
static get pluginName() {
|
|
22
|
-
return 'ItalicEditing';
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* @inheritDoc
|
|
26
|
-
*/
|
|
27
|
-
static get isOfficialPlugin() {
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* @inheritDoc
|
|
32
|
-
*/
|
|
33
|
-
init() {
|
|
34
|
-
const editor = this.editor;
|
|
35
|
-
const t = this.editor.t;
|
|
36
|
-
// Allow italic attribute on text nodes.
|
|
37
|
-
editor.model.schema.extend('$text', { allowAttributes: ITALIC });
|
|
38
|
-
editor.model.schema.setAttributeProperties(ITALIC, {
|
|
39
|
-
isFormatting: true,
|
|
40
|
-
copyOnEnter: true
|
|
41
|
-
});
|
|
42
|
-
editor.conversion.attributeToElement({
|
|
43
|
-
model: ITALIC,
|
|
44
|
-
view: 'i',
|
|
45
|
-
upcastAlso: [
|
|
46
|
-
'em',
|
|
47
|
-
{
|
|
48
|
-
styles: {
|
|
49
|
-
'font-style': 'italic'
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
]
|
|
53
|
-
});
|
|
54
|
-
// Create italic command.
|
|
55
|
-
editor.commands.add(ITALIC, new AttributeCommand(editor, ITALIC));
|
|
56
|
-
// Set the Ctrl+I keystroke.
|
|
57
|
-
editor.keystrokes.set('CTRL+I', ITALIC);
|
|
58
|
-
// Add the information about the keystroke to the accessibility database.
|
|
59
|
-
editor.accessibility.addKeystrokeInfos({
|
|
60
|
-
keystrokes: [
|
|
61
|
-
{
|
|
62
|
-
label: t('Italic text'),
|
|
63
|
-
keystroke: 'CTRL+I'
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
}
|
package/src/italic/italicui.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/italic/italicui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { IconItalic } from 'ckeditor5/src/icons.js';
|
|
10
|
-
import { MenuBarMenuListItemButtonView, ButtonView } from 'ckeditor5/src/ui.js';
|
|
11
|
-
import { getButtonCreator } from '../utils.js';
|
|
12
|
-
const ITALIC = 'italic';
|
|
13
|
-
/**
|
|
14
|
-
* The italic UI feature. It introduces the Italic button.
|
|
15
|
-
*/
|
|
16
|
-
export class ItalicUI extends Plugin {
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
static get pluginName() {
|
|
21
|
-
return 'ItalicUI';
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
static get isOfficialPlugin() {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
init() {
|
|
33
|
-
const editor = this.editor;
|
|
34
|
-
const t = editor.locale.t;
|
|
35
|
-
const createButton = getButtonCreator({
|
|
36
|
-
editor,
|
|
37
|
-
commandName: ITALIC,
|
|
38
|
-
plugin: this,
|
|
39
|
-
icon: IconItalic,
|
|
40
|
-
keystroke: 'CTRL+I',
|
|
41
|
-
label: t('Italic')
|
|
42
|
-
});
|
|
43
|
-
// Add bold button to feature components.
|
|
44
|
-
editor.ui.componentFactory.add(ITALIC, () => createButton(ButtonView));
|
|
45
|
-
editor.ui.componentFactory.add('menuBar:' + ITALIC, () => createButton(MenuBarMenuListItemButtonView));
|
|
46
|
-
}
|
|
47
|
-
}
|
package/src/italic.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/italic
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { ItalicEditing } from './italic/italicediting.js';
|
|
10
|
-
import { ItalicUI } from './italic/italicui.js';
|
|
11
|
-
/**
|
|
12
|
-
* The italic 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/italic/italicediting~ItalicEditing} and
|
|
18
|
-
* {@link module:basic-styles/italic/italicui~ItalicUI} plugins.
|
|
19
|
-
*/
|
|
20
|
-
export class Italic extends Plugin {
|
|
21
|
-
/**
|
|
22
|
-
* @inheritDoc
|
|
23
|
-
*/
|
|
24
|
-
static get requires() {
|
|
25
|
-
return [ItalicEditing, ItalicUI];
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
static get pluginName() {
|
|
31
|
-
return 'Italic';
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
static get isOfficialPlugin() {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/strikethrough/strikethroughediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { AttributeCommand } from '../attributecommand.js';
|
|
10
|
-
const STRIKETHROUGH = 'strikethrough';
|
|
11
|
-
/**
|
|
12
|
-
* The strikethrough editing feature.
|
|
13
|
-
*
|
|
14
|
-
* It registers the `'strikethrough'` command, the <kbd>Ctrl+Shift+X</kbd> keystroke and introduces the
|
|
15
|
-
* `strikethroughsthrough` attribute in the model which renders to the view
|
|
16
|
-
* as a `<s>` element.
|
|
17
|
-
*/
|
|
18
|
-
export class StrikethroughEditing extends Plugin {
|
|
19
|
-
/**
|
|
20
|
-
* @inheritDoc
|
|
21
|
-
*/
|
|
22
|
-
static get pluginName() {
|
|
23
|
-
return 'StrikethroughEditing';
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* @inheritDoc
|
|
27
|
-
*/
|
|
28
|
-
static get isOfficialPlugin() {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* @inheritDoc
|
|
33
|
-
*/
|
|
34
|
-
init() {
|
|
35
|
-
const editor = this.editor;
|
|
36
|
-
const t = this.editor.t;
|
|
37
|
-
// Allow strikethrough attribute on text nodes.
|
|
38
|
-
editor.model.schema.extend('$text', { allowAttributes: STRIKETHROUGH });
|
|
39
|
-
editor.model.schema.setAttributeProperties(STRIKETHROUGH, {
|
|
40
|
-
isFormatting: true,
|
|
41
|
-
copyOnEnter: true
|
|
42
|
-
});
|
|
43
|
-
editor.conversion.attributeToElement({
|
|
44
|
-
model: STRIKETHROUGH,
|
|
45
|
-
view: 's',
|
|
46
|
-
upcastAlso: [
|
|
47
|
-
'del',
|
|
48
|
-
'strike',
|
|
49
|
-
{
|
|
50
|
-
styles: {
|
|
51
|
-
'text-decoration': 'line-through'
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
});
|
|
56
|
-
// Create strikethrough command.
|
|
57
|
-
editor.commands.add(STRIKETHROUGH, new AttributeCommand(editor, STRIKETHROUGH));
|
|
58
|
-
// Set the Ctrl+Shift+X keystroke.
|
|
59
|
-
editor.keystrokes.set('CTRL+SHIFT+X', 'strikethrough');
|
|
60
|
-
// Add the information about the keystroke to the accessibility database.
|
|
61
|
-
editor.accessibility.addKeystrokeInfos({
|
|
62
|
-
keystrokes: [
|
|
63
|
-
{
|
|
64
|
-
label: t('Strikethrough text'),
|
|
65
|
-
keystroke: 'CTRL+SHIFT+X'
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/strikethrough/strikethroughui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { IconStrikethrough } from 'ckeditor5/src/icons.js';
|
|
10
|
-
import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
11
|
-
import { getButtonCreator } from '../utils.js';
|
|
12
|
-
const STRIKETHROUGH = 'strikethrough';
|
|
13
|
-
/**
|
|
14
|
-
* The strikethrough UI feature. It introduces the Strikethrough button.
|
|
15
|
-
*/
|
|
16
|
-
export class StrikethroughUI extends Plugin {
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
static get pluginName() {
|
|
21
|
-
return 'StrikethroughUI';
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
static get isOfficialPlugin() {
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
init() {
|
|
33
|
-
const editor = this.editor;
|
|
34
|
-
const t = editor.locale.t;
|
|
35
|
-
const createButton = getButtonCreator({
|
|
36
|
-
editor,
|
|
37
|
-
commandName: STRIKETHROUGH,
|
|
38
|
-
plugin: this,
|
|
39
|
-
icon: IconStrikethrough,
|
|
40
|
-
keystroke: 'CTRL+SHIFT+X',
|
|
41
|
-
label: t('Strikethrough')
|
|
42
|
-
});
|
|
43
|
-
// Add strikethrough button to feature components.
|
|
44
|
-
editor.ui.componentFactory.add(STRIKETHROUGH, () => createButton(ButtonView));
|
|
45
|
-
editor.ui.componentFactory.add('menuBar:' + STRIKETHROUGH, () => createButton(MenuBarMenuListItemButtonView));
|
|
46
|
-
}
|
|
47
|
-
}
|
package/src/strikethrough.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module basic-styles/strikethrough
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { StrikethroughEditing } from './strikethrough/strikethroughediting.js';
|
|
10
|
-
import { StrikethroughUI } from './strikethrough/strikethroughui.js';
|
|
11
|
-
/**
|
|
12
|
-
* The strikethrough 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/strikethrough/strikethroughediting~StrikethroughEditing} and
|
|
18
|
-
* {@link module:basic-styles/strikethrough/strikethroughui~StrikethroughUI} plugins.
|
|
19
|
-
*/
|
|
20
|
-
export class Strikethrough extends Plugin {
|
|
21
|
-
/**
|
|
22
|
-
* @inheritDoc
|
|
23
|
-
*/
|
|
24
|
-
static get requires() {
|
|
25
|
-
return [StrikethroughEditing, StrikethroughUI];
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
static get pluginName() {
|
|
31
|
-
return 'Strikethrough';
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
static get isOfficialPlugin() {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
}
|