@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
|
@@ -1,56 +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/subscript/subscriptediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { AttributeCommand } from '../attributecommand.js';
|
|
10
|
-
const SUBSCRIPT = 'subscript';
|
|
11
|
-
/**
|
|
12
|
-
* The subscript editing feature.
|
|
13
|
-
*
|
|
14
|
-
* It registers the `sub` command and introduces the `sub` attribute in the model which renders to the view
|
|
15
|
-
* as a `<sub>` element.
|
|
16
|
-
*/
|
|
17
|
-
export class SubscriptEditing extends Plugin {
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
static get pluginName() {
|
|
22
|
-
return 'SubscriptEditing';
|
|
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
|
-
// Allow sub attribute on text nodes.
|
|
36
|
-
editor.model.schema.extend('$text', { allowAttributes: SUBSCRIPT });
|
|
37
|
-
editor.model.schema.setAttributeProperties(SUBSCRIPT, {
|
|
38
|
-
isFormatting: true,
|
|
39
|
-
copyOnEnter: true
|
|
40
|
-
});
|
|
41
|
-
// Build converter from model to view for data and editing pipelines.
|
|
42
|
-
editor.conversion.attributeToElement({
|
|
43
|
-
model: SUBSCRIPT,
|
|
44
|
-
view: 'sub',
|
|
45
|
-
upcastAlso: [
|
|
46
|
-
{
|
|
47
|
-
styles: {
|
|
48
|
-
'vertical-align': 'sub'
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
});
|
|
53
|
-
// Create sub command.
|
|
54
|
-
editor.commands.add(SUBSCRIPT, new AttributeCommand(editor, SUBSCRIPT));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,46 +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/subscript/subscriptui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { IconSubscript } from 'ckeditor5/src/icons.js';
|
|
10
|
-
import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
11
|
-
import { getButtonCreator } from '../utils.js';
|
|
12
|
-
const SUBSCRIPT = 'subscript';
|
|
13
|
-
/**
|
|
14
|
-
* The subscript UI feature. It introduces the Subscript button.
|
|
15
|
-
*/
|
|
16
|
-
export class SubscriptUI extends Plugin {
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
static get pluginName() {
|
|
21
|
-
return 'SubscriptUI';
|
|
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: SUBSCRIPT,
|
|
38
|
-
plugin: this,
|
|
39
|
-
icon: IconSubscript,
|
|
40
|
-
label: t('Subscript')
|
|
41
|
-
});
|
|
42
|
-
// Add subscript button to feature components.
|
|
43
|
-
editor.ui.componentFactory.add(SUBSCRIPT, () => createButton(ButtonView));
|
|
44
|
-
editor.ui.componentFactory.add('menuBar:' + SUBSCRIPT, () => createButton(MenuBarMenuListItemButtonView));
|
|
45
|
-
}
|
|
46
|
-
}
|
package/src/subscript.js
DELETED
|
@@ -1,36 +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/subscript
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { SubscriptEditing } from './subscript/subscriptediting.js';
|
|
10
|
-
import { SubscriptUI } from './subscript/subscriptui.js';
|
|
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 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
|
-
/**
|
|
31
|
-
* @inheritDoc
|
|
32
|
-
*/
|
|
33
|
-
static get isOfficialPlugin() {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,56 +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/superscript/superscriptediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { AttributeCommand } from '../attributecommand.js';
|
|
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 class SuperscriptEditing extends Plugin {
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
static get pluginName() {
|
|
22
|
-
return 'SuperscriptEditing';
|
|
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
|
-
// Allow super attribute on text nodes.
|
|
36
|
-
editor.model.schema.extend('$text', { allowAttributes: SUPERSCRIPT });
|
|
37
|
-
editor.model.schema.setAttributeProperties(SUPERSCRIPT, {
|
|
38
|
-
isFormatting: true,
|
|
39
|
-
copyOnEnter: true
|
|
40
|
-
});
|
|
41
|
-
// Build converter from model to view for data and editing pipelines.
|
|
42
|
-
editor.conversion.attributeToElement({
|
|
43
|
-
model: SUPERSCRIPT,
|
|
44
|
-
view: 'sup',
|
|
45
|
-
upcastAlso: [
|
|
46
|
-
{
|
|
47
|
-
styles: {
|
|
48
|
-
'vertical-align': 'super'
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
]
|
|
52
|
-
});
|
|
53
|
-
// Create super command.
|
|
54
|
-
editor.commands.add(SUPERSCRIPT, new AttributeCommand(editor, SUPERSCRIPT));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1,46 +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/superscript/superscriptui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { IconSuperscript } from 'ckeditor5/src/icons.js';
|
|
10
|
-
import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
11
|
-
import { getButtonCreator } from '../utils.js';
|
|
12
|
-
const SUPERSCRIPT = 'superscript';
|
|
13
|
-
/**
|
|
14
|
-
* The superscript UI feature. It introduces the Superscript button.
|
|
15
|
-
*/
|
|
16
|
-
export class SuperscriptUI extends Plugin {
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
static get pluginName() {
|
|
21
|
-
return 'SuperscriptUI';
|
|
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: SUPERSCRIPT,
|
|
38
|
-
plugin: this,
|
|
39
|
-
icon: IconSuperscript,
|
|
40
|
-
label: t('Superscript')
|
|
41
|
-
});
|
|
42
|
-
// Add superscript button to feature components.
|
|
43
|
-
editor.ui.componentFactory.add(SUPERSCRIPT, () => createButton(ButtonView));
|
|
44
|
-
editor.ui.componentFactory.add('menuBar:' + SUPERSCRIPT, () => createButton(MenuBarMenuListItemButtonView));
|
|
45
|
-
}
|
|
46
|
-
}
|
package/src/superscript.js
DELETED
|
@@ -1,36 +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/superscript
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { SuperscriptEditing } from './superscript/superscriptediting.js';
|
|
10
|
-
import { SuperscriptUI } from './superscript/superscriptui.js';
|
|
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 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
|
-
/**
|
|
31
|
-
* @inheritDoc
|
|
32
|
-
*/
|
|
33
|
-
static get isOfficialPlugin() {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,65 +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/underline/underlineediting
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { AttributeCommand } from '../attributecommand.js';
|
|
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 class UnderlineEditing extends Plugin {
|
|
18
|
-
/**
|
|
19
|
-
* @inheritDoc
|
|
20
|
-
*/
|
|
21
|
-
static get pluginName() {
|
|
22
|
-
return 'UnderlineEditing';
|
|
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 strikethrough attribute on text nodes.
|
|
37
|
-
editor.model.schema.extend('$text', { allowAttributes: UNDERLINE });
|
|
38
|
-
editor.model.schema.setAttributeProperties(UNDERLINE, {
|
|
39
|
-
isFormatting: true,
|
|
40
|
-
copyOnEnter: true
|
|
41
|
-
});
|
|
42
|
-
editor.conversion.attributeToElement({
|
|
43
|
-
model: UNDERLINE,
|
|
44
|
-
view: 'u',
|
|
45
|
-
upcastAlso: {
|
|
46
|
-
styles: {
|
|
47
|
-
'text-decoration': 'underline'
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
// Create underline command.
|
|
52
|
-
editor.commands.add(UNDERLINE, new AttributeCommand(editor, UNDERLINE));
|
|
53
|
-
// Set the Ctrl+U keystroke.
|
|
54
|
-
editor.keystrokes.set('CTRL+U', 'underline');
|
|
55
|
-
// Add the information about the keystroke to the accessibility database.
|
|
56
|
-
editor.accessibility.addKeystrokeInfos({
|
|
57
|
-
keystrokes: [
|
|
58
|
-
{
|
|
59
|
-
label: t('Underline text'),
|
|
60
|
-
keystroke: 'CTRL+U'
|
|
61
|
-
}
|
|
62
|
-
]
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -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/underline/underlineui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { IconUnderline } from 'ckeditor5/src/icons.js';
|
|
10
|
-
import { ButtonView, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
11
|
-
import { getButtonCreator } from '../utils.js';
|
|
12
|
-
const UNDERLINE = 'underline';
|
|
13
|
-
/**
|
|
14
|
-
* The underline UI feature. It introduces the Underline button.
|
|
15
|
-
*/
|
|
16
|
-
export class UnderlineUI extends Plugin {
|
|
17
|
-
/**
|
|
18
|
-
* @inheritDoc
|
|
19
|
-
*/
|
|
20
|
-
static get pluginName() {
|
|
21
|
-
return 'UnderlineUI';
|
|
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: UNDERLINE,
|
|
38
|
-
plugin: this,
|
|
39
|
-
icon: IconUnderline,
|
|
40
|
-
label: t('Underline'),
|
|
41
|
-
keystroke: 'CTRL+U'
|
|
42
|
-
});
|
|
43
|
-
// Add bold button to feature components.
|
|
44
|
-
editor.ui.componentFactory.add(UNDERLINE, () => createButton(ButtonView));
|
|
45
|
-
editor.ui.componentFactory.add('menuBar:' + UNDERLINE, () => createButton(MenuBarMenuListItemButtonView));
|
|
46
|
-
}
|
|
47
|
-
}
|
package/src/underline.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/underline
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { UnderlineEditing } from './underline/underlineediting.js';
|
|
10
|
-
import { UnderlineUI } from './underline/underlineui.js';
|
|
11
|
-
/**
|
|
12
|
-
* The underline 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/underline/underlineediting~UnderlineEditing} and
|
|
18
|
-
* {@link module:basic-styles/underline/underlineui~UnderlineUI} plugins.
|
|
19
|
-
*/
|
|
20
|
-
export class Underline extends Plugin {
|
|
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
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
static get isOfficialPlugin() {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
}
|
package/src/utils.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
|
-
import { MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
6
|
-
/**
|
|
7
|
-
* Returns a function that creates a (toolbar or menu bar) button for a basic style feature.
|
|
8
|
-
*
|
|
9
|
-
* @internal
|
|
10
|
-
*/
|
|
11
|
-
export function getButtonCreator({ editor, commandName, plugin, icon, label, keystroke }) {
|
|
12
|
-
return (ButtonClass) => {
|
|
13
|
-
const command = editor.commands.get(commandName);
|
|
14
|
-
const view = new ButtonClass(editor.locale);
|
|
15
|
-
view.set({
|
|
16
|
-
label,
|
|
17
|
-
icon,
|
|
18
|
-
keystroke,
|
|
19
|
-
isToggleable: true
|
|
20
|
-
});
|
|
21
|
-
view.bind('isEnabled').to(command, 'isEnabled');
|
|
22
|
-
view.bind('isOn').to(command, 'value');
|
|
23
|
-
if (view instanceof MenuBarMenuListItemButtonView) {
|
|
24
|
-
view.set({
|
|
25
|
-
role: 'menuitemcheckbox'
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
view.set({
|
|
30
|
-
tooltip: true
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
// Execute the command.
|
|
34
|
-
plugin.listenTo(view, 'execute', () => {
|
|
35
|
-
editor.execute(commandName);
|
|
36
|
-
editor.editing.view.focus();
|
|
37
|
-
});
|
|
38
|
-
return view;
|
|
39
|
-
};
|
|
40
|
-
}
|
package/theme/code.css
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* 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
|
-
.ck-content code {
|
|
7
|
-
background-color: hsla(0, 0%, 78%, 0.3);
|
|
8
|
-
padding: .15em;
|
|
9
|
-
border-radius: 2px;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.ck.ck-editor__editable .ck-code_selected {
|
|
13
|
-
background-color: hsla(0, 0%, 78%, 0.5);
|
|
14
|
-
}
|
|
File without changes
|
/package/{src → dist}/index.d.ts
RENAMED
|
File without changes
|