@ckeditor/ckeditor5-basic-styles 48.8.1-alpha.3 → 49.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/dist/attributecommand.d.ts +69 -69
- package/dist/augmentation.d.ts +38 -38
- package/dist/bold/boldediting.d.ts +23 -23
- package/dist/bold/boldui.d.ts +20 -20
- package/dist/bold.d.ts +28 -28
- package/dist/code/codeediting.d.ts +28 -28
- package/dist/code/codeui.d.ts +20 -21
- package/dist/code.d.ts +28 -29
- package/dist/index-content.css +7 -5
- package/dist/index-content.css.map +1 -0
- package/dist/index-editor.css +5 -3
- package/dist/index-editor.css.map +1 -0
- package/dist/index.css +4 -4
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +31 -29
- package/dist/index.js +1029 -937
- package/dist/index.js.map +1 -1
- package/dist/italic/italicediting.d.ts +23 -23
- package/dist/italic/italicui.d.ts +20 -20
- package/dist/italic.d.ts +28 -28
- package/dist/strikethrough/strikethroughediting.d.ts +24 -24
- package/dist/strikethrough/strikethroughui.d.ts +20 -20
- package/dist/strikethrough.d.ts +28 -28
- package/dist/subscript/subscriptediting.d.ts +23 -23
- package/dist/subscript/subscriptui.d.ts +20 -20
- package/dist/subscript.d.ts +25 -25
- package/dist/superscript/superscriptediting.d.ts +23 -23
- package/dist/superscript/superscriptui.d.ts +20 -20
- package/dist/superscript.d.ts +25 -25
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +5 -3
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +5 -3
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +5 -3
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +5 -3
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +5 -3
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +5 -3
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +5 -3
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +5 -3
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +5 -3
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +5 -3
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +5 -3
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +5 -3
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +5 -3
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +5 -3
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +5 -3
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +5 -3
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +5 -3
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +5 -3
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +5 -3
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +5 -3
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +5 -3
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +5 -3
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +5 -3
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +5 -3
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +5 -3
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +5 -3
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +5 -3
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +5 -3
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +5 -3
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +5 -3
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +5 -3
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +5 -3
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +5 -3
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +5 -3
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +5 -3
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +5 -3
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +5 -3
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +5 -3
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +5 -3
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +5 -3
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +5 -3
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +5 -3
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +5 -3
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +5 -3
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +5 -3
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +5 -3
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +5 -3
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +5 -3
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +5 -3
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +5 -3
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +5 -3
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +5 -3
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +5 -3
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +5 -3
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +5 -3
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +5 -3
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +5 -3
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +5 -3
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +5 -3
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +5 -3
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +5 -3
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +5 -3
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +5 -3
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +5 -3
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +5 -3
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +5 -3
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +5 -3
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +5 -3
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +5 -3
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +5 -3
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +5 -3
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +5 -3
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +5 -3
- package/dist/underline/underlineediting.d.ts +23 -23
- package/dist/underline/underlineui.d.ts +20 -20
- package/dist/underline.d.ts +28 -28
- package/dist/utils.d.ts +17 -17
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -2,975 +2,1067 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
|
-
import { Command, Plugin } from
|
|
6
|
-
import { ModelDocumentSelection } from
|
|
7
|
-
import { IconBold, IconCode, IconItalic, IconStrikethrough, IconSubscript, IconSuperscript, IconUnderline } from
|
|
8
|
-
import {
|
|
9
|
-
import { TwoStepCaretMovement, inlineHighlight } from
|
|
5
|
+
import { Command, Plugin } from "@ckeditor/ckeditor5-core";
|
|
6
|
+
import { ModelDocumentSelection } from "@ckeditor/ckeditor5-engine";
|
|
7
|
+
import { IconBold, IconCode, IconItalic, IconStrikethrough, IconSubscript, IconSuperscript, IconUnderline } from "@ckeditor/ckeditor5-icons";
|
|
8
|
+
import { ButtonView, MenuBarMenuListItemButtonView } from "@ckeditor/ckeditor5-ui";
|
|
9
|
+
import { TwoStepCaretMovement, inlineHighlight } from "@ckeditor/ckeditor5-typing";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
return false;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
12
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
13
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* @module basic-styles/attributecommand
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* An extension of the base {@link module:core/command~Command} class, which provides utilities for a command
|
|
20
|
+
* that toggles a single attribute on a text or an element.
|
|
21
|
+
*
|
|
22
|
+
* `AttributeCommand` uses {@link module:engine/model/document~ModelDocument#selection}
|
|
23
|
+
* to decide which nodes (if any) should be changed, and applies or removes the attribute from them.
|
|
24
|
+
*
|
|
25
|
+
* The command checks the {@link module:engine/model/model~Model#schema} to decide if it can be enabled
|
|
26
|
+
* for the current selection and to which nodes the attribute can be applied.
|
|
27
|
+
*/
|
|
28
|
+
var AttributeCommand = class extends Command {
|
|
29
|
+
/**
|
|
30
|
+
* The attribute that will be set by the command.
|
|
31
|
+
*/
|
|
32
|
+
attributeKey;
|
|
33
|
+
/**
|
|
34
|
+
* @param attributeKey Attribute that will be set by the command.
|
|
35
|
+
*/
|
|
36
|
+
constructor(editor, attributeKey) {
|
|
37
|
+
super(editor);
|
|
38
|
+
this.attributeKey = attributeKey;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Updates the command's {@link #value} and {@link #isEnabled} based on the current selection.
|
|
42
|
+
*/
|
|
43
|
+
refresh() {
|
|
44
|
+
const model = this.editor.model;
|
|
45
|
+
const doc = model.document;
|
|
46
|
+
this.value = this._getValueFromFirstAllowedNode();
|
|
47
|
+
this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, this.attributeKey);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Executes the command – applies the attribute to the selection or removes it from the selection.
|
|
51
|
+
*
|
|
52
|
+
* If the command is active (`value == true`), it will remove attributes. Otherwise, it will set attributes.
|
|
53
|
+
*
|
|
54
|
+
* The execution result differs, depending on the {@link module:engine/model/document~ModelDocument#selection}:
|
|
55
|
+
*
|
|
56
|
+
* * If the selection is on a range, the command applies the attribute to all nodes in that range
|
|
57
|
+
* (if they are allowed to have this attribute by the {@link module:engine/model/schema~ModelSchema schema}).
|
|
58
|
+
* * If the selection is collapsed in a non-empty node, the command applies the attribute to the
|
|
59
|
+
* {@link module:engine/model/document~ModelDocument#selection} itself (note that typed characters copy attributes from the selection).
|
|
60
|
+
* * If the selection is collapsed in an empty node, the command applies the attribute to the parent node of the selection (note
|
|
61
|
+
* that the selection inherits all attributes from a node if it is in an empty node).
|
|
62
|
+
*
|
|
63
|
+
* @fires execute
|
|
64
|
+
* @param options Command options.
|
|
65
|
+
* @param options.forceValue If set, it will force the command behavior. If `true`,
|
|
66
|
+
* the command will apply the attribute, otherwise the command will remove the attribute.
|
|
67
|
+
* If not set, the command will look for its current value to decide what it should do.
|
|
68
|
+
*/
|
|
69
|
+
execute(options = {}) {
|
|
70
|
+
const model = this.editor.model;
|
|
71
|
+
const selection = model.document.selection;
|
|
72
|
+
const value = options.forceValue === void 0 ? !this.value : options.forceValue;
|
|
73
|
+
model.change((writer) => {
|
|
74
|
+
if (selection.isCollapsed) {
|
|
75
|
+
if (value) writer.setSelectionAttribute(this.attributeKey, true);
|
|
76
|
+
else writer.removeSelectionAttribute(this.attributeKey);
|
|
77
|
+
} else {
|
|
78
|
+
const ranges = model.schema.getValidRanges(selection.getRanges(), this.attributeKey, { includeEmptyRanges: true });
|
|
79
|
+
for (const range of ranges) {
|
|
80
|
+
let itemOrRange = range;
|
|
81
|
+
let attributeKey = this.attributeKey;
|
|
82
|
+
if (range.isCollapsed) {
|
|
83
|
+
itemOrRange = range.start.parent;
|
|
84
|
+
attributeKey = ModelDocumentSelection._getStoreAttributeKey(this.attributeKey);
|
|
85
|
+
}
|
|
86
|
+
if (value) writer.setAttribute(attributeKey, value, itemOrRange);
|
|
87
|
+
else writer.removeAttribute(attributeKey, itemOrRange);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Checks the attribute value of the first node in the selection that allows the attribute.
|
|
94
|
+
* For the collapsed selection returns the selection attribute.
|
|
95
|
+
*
|
|
96
|
+
* @returns The attribute value.
|
|
97
|
+
*/
|
|
98
|
+
_getValueFromFirstAllowedNode() {
|
|
99
|
+
const model = this.editor.model;
|
|
100
|
+
const schema = model.schema;
|
|
101
|
+
const selection = model.document.selection;
|
|
102
|
+
if (selection.isCollapsed) return selection.hasAttribute(this.attributeKey);
|
|
103
|
+
for (const range of selection.getRanges()) for (const item of range.getItems()) if (schema.checkAttribute(item, this.attributeKey)) return item.hasAttribute(this.attributeKey);
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
111
107
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
editor.accessibility.addKeystrokeInfos({
|
|
172
|
-
keystrokes: [
|
|
173
|
-
{
|
|
174
|
-
label: t('Bold text'),
|
|
175
|
-
keystroke: 'CTRL+B'
|
|
176
|
-
}
|
|
177
|
-
]
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
}
|
|
108
|
+
/**
|
|
109
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
110
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
111
|
+
*/
|
|
112
|
+
/**
|
|
113
|
+
* @module basic-styles/bold/boldediting
|
|
114
|
+
*/
|
|
115
|
+
const BOLD$1 = "bold";
|
|
116
|
+
/**
|
|
117
|
+
* The bold editing feature.
|
|
118
|
+
*
|
|
119
|
+
* It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view
|
|
120
|
+
* as a `<strong>` element.
|
|
121
|
+
*/
|
|
122
|
+
var BoldEditing = class extends Plugin {
|
|
123
|
+
/**
|
|
124
|
+
* @inheritDoc
|
|
125
|
+
*/
|
|
126
|
+
static get pluginName() {
|
|
127
|
+
return "BoldEditing";
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* @inheritDoc
|
|
131
|
+
*/
|
|
132
|
+
static get isOfficialPlugin() {
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* @inheritDoc
|
|
137
|
+
*/
|
|
138
|
+
init() {
|
|
139
|
+
const editor = this.editor;
|
|
140
|
+
const t = this.editor.t;
|
|
141
|
+
editor.model.schema.extend("$text", { allowAttributes: BOLD$1 });
|
|
142
|
+
editor.model.schema.setAttributeProperties(BOLD$1, {
|
|
143
|
+
isFormatting: true,
|
|
144
|
+
copyOnEnter: true
|
|
145
|
+
});
|
|
146
|
+
editor.conversion.attributeToElement({
|
|
147
|
+
model: BOLD$1,
|
|
148
|
+
view: "strong",
|
|
149
|
+
upcastAlso: ["b", (viewElement) => {
|
|
150
|
+
const fontWeight = viewElement.getStyle("font-weight");
|
|
151
|
+
if (!fontWeight) return null;
|
|
152
|
+
if (fontWeight == "bold" || Number(fontWeight) >= 600) return {
|
|
153
|
+
name: true,
|
|
154
|
+
styles: ["font-weight"]
|
|
155
|
+
};
|
|
156
|
+
return null;
|
|
157
|
+
}]
|
|
158
|
+
});
|
|
159
|
+
editor.commands.add(BOLD$1, new AttributeCommand(editor, BOLD$1));
|
|
160
|
+
editor.keystrokes.set("CTRL+B", BOLD$1);
|
|
161
|
+
editor.accessibility.addKeystrokeInfos({ keystrokes: [{
|
|
162
|
+
label: t("Bold text"),
|
|
163
|
+
keystroke: "CTRL+B"
|
|
164
|
+
}] });
|
|
165
|
+
}
|
|
166
|
+
};
|
|
181
167
|
|
|
182
168
|
/**
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
});
|
|
212
|
-
return view;
|
|
213
|
-
};
|
|
169
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
170
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
171
|
+
*/
|
|
172
|
+
/**
|
|
173
|
+
* Returns a function that creates a (toolbar or menu bar) button for a basic style feature.
|
|
174
|
+
*
|
|
175
|
+
* @internal
|
|
176
|
+
*/
|
|
177
|
+
function getButtonCreator({ editor, commandName, plugin, icon, label, keystroke }) {
|
|
178
|
+
return (ButtonClass) => {
|
|
179
|
+
const command = editor.commands.get(commandName);
|
|
180
|
+
const view = new ButtonClass(editor.locale);
|
|
181
|
+
view.set({
|
|
182
|
+
label,
|
|
183
|
+
icon,
|
|
184
|
+
keystroke,
|
|
185
|
+
isToggleable: true
|
|
186
|
+
});
|
|
187
|
+
view.bind("isEnabled").to(command, "isEnabled");
|
|
188
|
+
view.bind("isOn").to(command, "value");
|
|
189
|
+
if (view instanceof MenuBarMenuListItemButtonView) view.set({ role: "menuitemcheckbox" });
|
|
190
|
+
else view.set({ tooltip: true });
|
|
191
|
+
plugin.listenTo(view, "execute", () => {
|
|
192
|
+
editor.execute(commandName);
|
|
193
|
+
editor.editing.view.focus();
|
|
194
|
+
});
|
|
195
|
+
return view;
|
|
196
|
+
};
|
|
214
197
|
}
|
|
215
198
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
199
|
+
/**
|
|
200
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
201
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
202
|
+
*/
|
|
203
|
+
/**
|
|
204
|
+
* @module basic-styles/bold/boldui
|
|
205
|
+
*/
|
|
206
|
+
const BOLD = "bold";
|
|
207
|
+
/**
|
|
208
|
+
* The bold UI feature. It introduces the Bold button.
|
|
209
|
+
*/
|
|
210
|
+
var BoldUI = class extends Plugin {
|
|
211
|
+
/**
|
|
212
|
+
* @inheritDoc
|
|
213
|
+
*/
|
|
214
|
+
static get pluginName() {
|
|
215
|
+
return "BoldUI";
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* @inheritDoc
|
|
219
|
+
*/
|
|
220
|
+
static get isOfficialPlugin() {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* @inheritDoc
|
|
225
|
+
*/
|
|
226
|
+
init() {
|
|
227
|
+
const editor = this.editor;
|
|
228
|
+
const t = editor.locale.t;
|
|
229
|
+
const createButton = getButtonCreator({
|
|
230
|
+
editor,
|
|
231
|
+
commandName: BOLD,
|
|
232
|
+
plugin: this,
|
|
233
|
+
icon: IconBold,
|
|
234
|
+
label: t("Bold"),
|
|
235
|
+
keystroke: "CTRL+B"
|
|
236
|
+
});
|
|
237
|
+
editor.ui.componentFactory.add(BOLD, () => createButton(ButtonView));
|
|
238
|
+
editor.ui.componentFactory.add("menuBar:bold", () => createButton(MenuBarMenuListItemButtonView));
|
|
239
|
+
}
|
|
240
|
+
};
|
|
248
241
|
|
|
249
242
|
/**
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
243
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
244
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
245
|
+
*/
|
|
246
|
+
/**
|
|
247
|
+
* @module basic-styles/bold
|
|
248
|
+
*/
|
|
249
|
+
/**
|
|
250
|
+
* The bold feature.
|
|
251
|
+
*
|
|
252
|
+
* For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
|
|
253
|
+
* and the {@glink api/basic-styles package page}.
|
|
254
|
+
*
|
|
255
|
+
* This is a "glue" plugin which loads the {@link module:basic-styles/bold/boldediting~BoldEditing bold editing feature}
|
|
256
|
+
* and {@link module:basic-styles/bold/boldui~BoldUI bold UI feature}.
|
|
257
|
+
*/
|
|
258
|
+
var Bold = class extends Plugin {
|
|
259
|
+
/**
|
|
260
|
+
* @inheritDoc
|
|
261
|
+
*/
|
|
262
|
+
static get requires() {
|
|
263
|
+
return [BoldEditing, BoldUI];
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* @inheritDoc
|
|
267
|
+
*/
|
|
268
|
+
static get pluginName() {
|
|
269
|
+
return "Bold";
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* @inheritDoc
|
|
273
|
+
*/
|
|
274
|
+
static get isOfficialPlugin() {
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
};
|
|
277
278
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
[
|
|
337
|
-
'arrowright',
|
|
338
|
-
'arrowright'
|
|
339
|
-
]
|
|
340
|
-
]
|
|
341
|
-
}
|
|
342
|
-
]
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
}
|
|
279
|
+
/**
|
|
280
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
281
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
282
|
+
*/
|
|
283
|
+
/**
|
|
284
|
+
* @module basic-styles/code/codeediting
|
|
285
|
+
*/
|
|
286
|
+
const CODE$1 = "code";
|
|
287
|
+
const HIGHLIGHT_CLASS = "ck-code_selected";
|
|
288
|
+
/**
|
|
289
|
+
* The code editing feature.
|
|
290
|
+
*
|
|
291
|
+
* It registers the `'code'` command and introduces the `code` attribute in the model which renders to the view
|
|
292
|
+
* as a `<code>` element.
|
|
293
|
+
*/
|
|
294
|
+
var CodeEditing = class extends Plugin {
|
|
295
|
+
/**
|
|
296
|
+
* @inheritDoc
|
|
297
|
+
*/
|
|
298
|
+
static get pluginName() {
|
|
299
|
+
return "CodeEditing";
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* @inheritDoc
|
|
303
|
+
*/
|
|
304
|
+
static get isOfficialPlugin() {
|
|
305
|
+
return true;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* @inheritDoc
|
|
309
|
+
*/
|
|
310
|
+
static get requires() {
|
|
311
|
+
return [TwoStepCaretMovement];
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* @inheritDoc
|
|
315
|
+
*/
|
|
316
|
+
init() {
|
|
317
|
+
const editor = this.editor;
|
|
318
|
+
const t = this.editor.t;
|
|
319
|
+
editor.model.schema.extend("$text", { allowAttributes: CODE$1 });
|
|
320
|
+
editor.model.schema.setAttributeProperties(CODE$1, {
|
|
321
|
+
isFormatting: true,
|
|
322
|
+
copyOnEnter: false
|
|
323
|
+
});
|
|
324
|
+
editor.conversion.attributeToElement({
|
|
325
|
+
model: CODE$1,
|
|
326
|
+
view: "code"
|
|
327
|
+
});
|
|
328
|
+
editor.commands.add(CODE$1, new AttributeCommand(editor, CODE$1));
|
|
329
|
+
editor.plugins.get(TwoStepCaretMovement).registerAttribute(CODE$1);
|
|
330
|
+
inlineHighlight(editor, CODE$1, "code", HIGHLIGHT_CLASS);
|
|
331
|
+
editor.accessibility.addKeystrokeInfos({ keystrokes: [{
|
|
332
|
+
label: t("Move out of an inline code style"),
|
|
333
|
+
keystroke: [["arrowleft", "arrowleft"], ["arrowright", "arrowright"]]
|
|
334
|
+
}] });
|
|
335
|
+
}
|
|
336
|
+
};
|
|
346
337
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
338
|
+
/**
|
|
339
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
340
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
341
|
+
*/
|
|
342
|
+
/**
|
|
343
|
+
* @module basic-styles/code/codeui
|
|
344
|
+
*/
|
|
345
|
+
const CODE = "code";
|
|
346
|
+
/**
|
|
347
|
+
* The code UI feature. It introduces the Code button.
|
|
348
|
+
*/
|
|
349
|
+
var CodeUI = class extends Plugin {
|
|
350
|
+
/**
|
|
351
|
+
* @inheritDoc
|
|
352
|
+
*/
|
|
353
|
+
static get pluginName() {
|
|
354
|
+
return "CodeUI";
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* @inheritDoc
|
|
358
|
+
*/
|
|
359
|
+
static get isOfficialPlugin() {
|
|
360
|
+
return true;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* @inheritDoc
|
|
364
|
+
*/
|
|
365
|
+
init() {
|
|
366
|
+
const editor = this.editor;
|
|
367
|
+
const t = editor.locale.t;
|
|
368
|
+
const createButton = getButtonCreator({
|
|
369
|
+
editor,
|
|
370
|
+
commandName: CODE,
|
|
371
|
+
plugin: this,
|
|
372
|
+
icon: IconCode,
|
|
373
|
+
label: t("Code")
|
|
374
|
+
});
|
|
375
|
+
editor.ui.componentFactory.add(CODE, () => createButton(ButtonView));
|
|
376
|
+
editor.ui.componentFactory.add("menuBar:code", () => createButton(MenuBarMenuListItemButtonView));
|
|
377
|
+
}
|
|
378
|
+
};
|
|
378
379
|
|
|
379
380
|
/**
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
381
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
382
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
383
|
+
*/
|
|
384
|
+
/**
|
|
385
|
+
* @module basic-styles/code
|
|
386
|
+
*/
|
|
387
|
+
/**
|
|
388
|
+
* The code feature.
|
|
389
|
+
*
|
|
390
|
+
* For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
|
|
391
|
+
* and the {@glink api/basic-styles package page}.
|
|
392
|
+
*
|
|
393
|
+
* This is a "glue" plugin which loads the {@link module:basic-styles/code/codeediting~CodeEditing code editing feature}
|
|
394
|
+
* and {@link module:basic-styles/code/codeui~CodeUI code UI feature}.
|
|
395
|
+
*/
|
|
396
|
+
var Code = class extends Plugin {
|
|
397
|
+
/**
|
|
398
|
+
* @inheritDoc
|
|
399
|
+
*/
|
|
400
|
+
static get requires() {
|
|
401
|
+
return [CodeEditing, CodeUI];
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* @inheritDoc
|
|
405
|
+
*/
|
|
406
|
+
static get pluginName() {
|
|
407
|
+
return "Code";
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* @inheritDoc
|
|
411
|
+
*/
|
|
412
|
+
static get isOfficialPlugin() {
|
|
413
|
+
return true;
|
|
414
|
+
}
|
|
415
|
+
};
|
|
407
416
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
keystroke: 'CTRL+I'
|
|
460
|
-
}
|
|
461
|
-
]
|
|
462
|
-
});
|
|
463
|
-
}
|
|
464
|
-
}
|
|
417
|
+
/**
|
|
418
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
419
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
420
|
+
*/
|
|
421
|
+
/**
|
|
422
|
+
* @module basic-styles/italic/italicediting
|
|
423
|
+
*/
|
|
424
|
+
const ITALIC$1 = "italic";
|
|
425
|
+
/**
|
|
426
|
+
* The italic editing feature.
|
|
427
|
+
*
|
|
428
|
+
* It registers the `'italic'` command, the <kbd>Ctrl+I</kbd> keystroke and introduces the `italic` attribute in the model
|
|
429
|
+
* which renders to the view as an `<i>` element.
|
|
430
|
+
*/
|
|
431
|
+
var ItalicEditing = class extends Plugin {
|
|
432
|
+
/**
|
|
433
|
+
* @inheritDoc
|
|
434
|
+
*/
|
|
435
|
+
static get pluginName() {
|
|
436
|
+
return "ItalicEditing";
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* @inheritDoc
|
|
440
|
+
*/
|
|
441
|
+
static get isOfficialPlugin() {
|
|
442
|
+
return true;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* @inheritDoc
|
|
446
|
+
*/
|
|
447
|
+
init() {
|
|
448
|
+
const editor = this.editor;
|
|
449
|
+
const t = this.editor.t;
|
|
450
|
+
editor.model.schema.extend("$text", { allowAttributes: ITALIC$1 });
|
|
451
|
+
editor.model.schema.setAttributeProperties(ITALIC$1, {
|
|
452
|
+
isFormatting: true,
|
|
453
|
+
copyOnEnter: true
|
|
454
|
+
});
|
|
455
|
+
editor.conversion.attributeToElement({
|
|
456
|
+
model: ITALIC$1,
|
|
457
|
+
view: "i",
|
|
458
|
+
upcastAlso: ["em", { styles: { "font-style": "italic" } }]
|
|
459
|
+
});
|
|
460
|
+
editor.commands.add(ITALIC$1, new AttributeCommand(editor, ITALIC$1));
|
|
461
|
+
editor.keystrokes.set("CTRL+I", ITALIC$1);
|
|
462
|
+
editor.accessibility.addKeystrokeInfos({ keystrokes: [{
|
|
463
|
+
label: t("Italic text"),
|
|
464
|
+
keystroke: "CTRL+I"
|
|
465
|
+
}] });
|
|
466
|
+
}
|
|
467
|
+
};
|
|
465
468
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
469
|
+
/**
|
|
470
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
471
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
472
|
+
*/
|
|
473
|
+
/**
|
|
474
|
+
* @module basic-styles/italic/italicui
|
|
475
|
+
*/
|
|
476
|
+
const ITALIC = "italic";
|
|
477
|
+
/**
|
|
478
|
+
* The italic UI feature. It introduces the Italic button.
|
|
479
|
+
*/
|
|
480
|
+
var ItalicUI = class extends Plugin {
|
|
481
|
+
/**
|
|
482
|
+
* @inheritDoc
|
|
483
|
+
*/
|
|
484
|
+
static get pluginName() {
|
|
485
|
+
return "ItalicUI";
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* @inheritDoc
|
|
489
|
+
*/
|
|
490
|
+
static get isOfficialPlugin() {
|
|
491
|
+
return true;
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* @inheritDoc
|
|
495
|
+
*/
|
|
496
|
+
init() {
|
|
497
|
+
const editor = this.editor;
|
|
498
|
+
const t = editor.locale.t;
|
|
499
|
+
const createButton = getButtonCreator({
|
|
500
|
+
editor,
|
|
501
|
+
commandName: ITALIC,
|
|
502
|
+
plugin: this,
|
|
503
|
+
icon: IconItalic,
|
|
504
|
+
keystroke: "CTRL+I",
|
|
505
|
+
label: t("Italic")
|
|
506
|
+
});
|
|
507
|
+
editor.ui.componentFactory.add(ITALIC, () => createButton(ButtonView));
|
|
508
|
+
editor.ui.componentFactory.add("menuBar:italic", () => createButton(MenuBarMenuListItemButtonView));
|
|
509
|
+
}
|
|
510
|
+
};
|
|
498
511
|
|
|
499
512
|
/**
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
513
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
514
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
515
|
+
*/
|
|
516
|
+
/**
|
|
517
|
+
* @module basic-styles/italic
|
|
518
|
+
*/
|
|
519
|
+
/**
|
|
520
|
+
* The italic feature.
|
|
521
|
+
*
|
|
522
|
+
* For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
|
|
523
|
+
* and the {@glink api/basic-styles package page}.
|
|
524
|
+
*
|
|
525
|
+
* This is a "glue" plugin which loads the {@link module:basic-styles/italic/italicediting~ItalicEditing} and
|
|
526
|
+
* {@link module:basic-styles/italic/italicui~ItalicUI} plugins.
|
|
527
|
+
*/
|
|
528
|
+
var Italic = class extends Plugin {
|
|
529
|
+
/**
|
|
530
|
+
* @inheritDoc
|
|
531
|
+
*/
|
|
532
|
+
static get requires() {
|
|
533
|
+
return [ItalicEditing, ItalicUI];
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* @inheritDoc
|
|
537
|
+
*/
|
|
538
|
+
static get pluginName() {
|
|
539
|
+
return "Italic";
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* @inheritDoc
|
|
543
|
+
*/
|
|
544
|
+
static get isOfficialPlugin() {
|
|
545
|
+
return true;
|
|
546
|
+
}
|
|
547
|
+
};
|
|
527
548
|
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
});
|
|
585
|
-
}
|
|
586
|
-
}
|
|
549
|
+
/**
|
|
550
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
551
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
552
|
+
*/
|
|
553
|
+
/**
|
|
554
|
+
* @module basic-styles/strikethrough/strikethroughediting
|
|
555
|
+
*/
|
|
556
|
+
const STRIKETHROUGH$1 = "strikethrough";
|
|
557
|
+
/**
|
|
558
|
+
* The strikethrough editing feature.
|
|
559
|
+
*
|
|
560
|
+
* It registers the `'strikethrough'` command, the <kbd>Ctrl+Shift+X</kbd> keystroke and introduces the
|
|
561
|
+
* `strikethroughsthrough` attribute in the model which renders to the view
|
|
562
|
+
* as a `<s>` element.
|
|
563
|
+
*/
|
|
564
|
+
var StrikethroughEditing = class extends Plugin {
|
|
565
|
+
/**
|
|
566
|
+
* @inheritDoc
|
|
567
|
+
*/
|
|
568
|
+
static get pluginName() {
|
|
569
|
+
return "StrikethroughEditing";
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* @inheritDoc
|
|
573
|
+
*/
|
|
574
|
+
static get isOfficialPlugin() {
|
|
575
|
+
return true;
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* @inheritDoc
|
|
579
|
+
*/
|
|
580
|
+
init() {
|
|
581
|
+
const editor = this.editor;
|
|
582
|
+
const t = this.editor.t;
|
|
583
|
+
editor.model.schema.extend("$text", { allowAttributes: STRIKETHROUGH$1 });
|
|
584
|
+
editor.model.schema.setAttributeProperties(STRIKETHROUGH$1, {
|
|
585
|
+
isFormatting: true,
|
|
586
|
+
copyOnEnter: true
|
|
587
|
+
});
|
|
588
|
+
editor.conversion.attributeToElement({
|
|
589
|
+
model: STRIKETHROUGH$1,
|
|
590
|
+
view: "s",
|
|
591
|
+
upcastAlso: [
|
|
592
|
+
"del",
|
|
593
|
+
"strike",
|
|
594
|
+
{ styles: { "text-decoration": "line-through" } }
|
|
595
|
+
]
|
|
596
|
+
});
|
|
597
|
+
editor.commands.add(STRIKETHROUGH$1, new AttributeCommand(editor, STRIKETHROUGH$1));
|
|
598
|
+
editor.keystrokes.set("CTRL+SHIFT+X", "strikethrough");
|
|
599
|
+
editor.accessibility.addKeystrokeInfos({ keystrokes: [{
|
|
600
|
+
label: t("Strikethrough text"),
|
|
601
|
+
keystroke: "CTRL+SHIFT+X"
|
|
602
|
+
}] });
|
|
603
|
+
}
|
|
604
|
+
};
|
|
587
605
|
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
606
|
+
/**
|
|
607
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
608
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
609
|
+
*/
|
|
610
|
+
/**
|
|
611
|
+
* @module basic-styles/strikethrough/strikethroughui
|
|
612
|
+
*/
|
|
613
|
+
const STRIKETHROUGH = "strikethrough";
|
|
614
|
+
/**
|
|
615
|
+
* The strikethrough UI feature. It introduces the Strikethrough button.
|
|
616
|
+
*/
|
|
617
|
+
var StrikethroughUI = class extends Plugin {
|
|
618
|
+
/**
|
|
619
|
+
* @inheritDoc
|
|
620
|
+
*/
|
|
621
|
+
static get pluginName() {
|
|
622
|
+
return "StrikethroughUI";
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* @inheritDoc
|
|
626
|
+
*/
|
|
627
|
+
static get isOfficialPlugin() {
|
|
628
|
+
return true;
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* @inheritDoc
|
|
632
|
+
*/
|
|
633
|
+
init() {
|
|
634
|
+
const editor = this.editor;
|
|
635
|
+
const t = editor.locale.t;
|
|
636
|
+
const createButton = getButtonCreator({
|
|
637
|
+
editor,
|
|
638
|
+
commandName: STRIKETHROUGH,
|
|
639
|
+
plugin: this,
|
|
640
|
+
icon: IconStrikethrough,
|
|
641
|
+
keystroke: "CTRL+SHIFT+X",
|
|
642
|
+
label: t("Strikethrough")
|
|
643
|
+
});
|
|
644
|
+
editor.ui.componentFactory.add(STRIKETHROUGH, () => createButton(ButtonView));
|
|
645
|
+
editor.ui.componentFactory.add("menuBar:strikethrough", () => createButton(MenuBarMenuListItemButtonView));
|
|
646
|
+
}
|
|
647
|
+
};
|
|
620
648
|
|
|
621
649
|
/**
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
650
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
651
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
652
|
+
*/
|
|
653
|
+
/**
|
|
654
|
+
* @module basic-styles/strikethrough
|
|
655
|
+
*/
|
|
656
|
+
/**
|
|
657
|
+
* The strikethrough feature.
|
|
658
|
+
*
|
|
659
|
+
* For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
|
|
660
|
+
* and the {@glink api/basic-styles package page}.
|
|
661
|
+
*
|
|
662
|
+
* This is a "glue" plugin which loads the {@link module:basic-styles/strikethrough/strikethroughediting~StrikethroughEditing} and
|
|
663
|
+
* {@link module:basic-styles/strikethrough/strikethroughui~StrikethroughUI} plugins.
|
|
664
|
+
*/
|
|
665
|
+
var Strikethrough = class extends Plugin {
|
|
666
|
+
/**
|
|
667
|
+
* @inheritDoc
|
|
668
|
+
*/
|
|
669
|
+
static get requires() {
|
|
670
|
+
return [StrikethroughEditing, StrikethroughUI];
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* @inheritDoc
|
|
674
|
+
*/
|
|
675
|
+
static get pluginName() {
|
|
676
|
+
return "Strikethrough";
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* @inheritDoc
|
|
680
|
+
*/
|
|
681
|
+
static get isOfficialPlugin() {
|
|
682
|
+
return true;
|
|
683
|
+
}
|
|
684
|
+
};
|
|
649
685
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
}
|
|
686
|
+
/**
|
|
687
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
688
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
689
|
+
*/
|
|
690
|
+
/**
|
|
691
|
+
* @module basic-styles/subscript/subscriptediting
|
|
692
|
+
*/
|
|
693
|
+
const SUBSCRIPT$1 = "subscript";
|
|
694
|
+
/**
|
|
695
|
+
* The subscript editing feature.
|
|
696
|
+
*
|
|
697
|
+
* It registers the `sub` command and introduces the `sub` attribute in the model which renders to the view
|
|
698
|
+
* as a `<sub>` element.
|
|
699
|
+
*/
|
|
700
|
+
var SubscriptEditing = class extends Plugin {
|
|
701
|
+
/**
|
|
702
|
+
* @inheritDoc
|
|
703
|
+
*/
|
|
704
|
+
static get pluginName() {
|
|
705
|
+
return "SubscriptEditing";
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* @inheritDoc
|
|
709
|
+
*/
|
|
710
|
+
static get isOfficialPlugin() {
|
|
711
|
+
return true;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* @inheritDoc
|
|
715
|
+
*/
|
|
716
|
+
init() {
|
|
717
|
+
const editor = this.editor;
|
|
718
|
+
editor.model.schema.extend("$text", { allowAttributes: SUBSCRIPT$1 });
|
|
719
|
+
editor.model.schema.setAttributeProperties(SUBSCRIPT$1, {
|
|
720
|
+
isFormatting: true,
|
|
721
|
+
copyOnEnter: true
|
|
722
|
+
});
|
|
723
|
+
editor.conversion.attributeToElement({
|
|
724
|
+
model: SUBSCRIPT$1,
|
|
725
|
+
view: "sub",
|
|
726
|
+
upcastAlso: [{ styles: { "vertical-align": "sub" } }]
|
|
727
|
+
});
|
|
728
|
+
editor.commands.add(SUBSCRIPT$1, new AttributeCommand(editor, SUBSCRIPT$1));
|
|
729
|
+
}
|
|
730
|
+
};
|
|
695
731
|
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
732
|
+
/**
|
|
733
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
734
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
735
|
+
*/
|
|
736
|
+
/**
|
|
737
|
+
* @module basic-styles/subscript/subscriptui
|
|
738
|
+
*/
|
|
739
|
+
const SUBSCRIPT = "subscript";
|
|
740
|
+
/**
|
|
741
|
+
* The subscript UI feature. It introduces the Subscript button.
|
|
742
|
+
*/
|
|
743
|
+
var SubscriptUI = class extends Plugin {
|
|
744
|
+
/**
|
|
745
|
+
* @inheritDoc
|
|
746
|
+
*/
|
|
747
|
+
static get pluginName() {
|
|
748
|
+
return "SubscriptUI";
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* @inheritDoc
|
|
752
|
+
*/
|
|
753
|
+
static get isOfficialPlugin() {
|
|
754
|
+
return true;
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* @inheritDoc
|
|
758
|
+
*/
|
|
759
|
+
init() {
|
|
760
|
+
const editor = this.editor;
|
|
761
|
+
const t = editor.locale.t;
|
|
762
|
+
const createButton = getButtonCreator({
|
|
763
|
+
editor,
|
|
764
|
+
commandName: SUBSCRIPT,
|
|
765
|
+
plugin: this,
|
|
766
|
+
icon: IconSubscript,
|
|
767
|
+
label: t("Subscript")
|
|
768
|
+
});
|
|
769
|
+
editor.ui.componentFactory.add(SUBSCRIPT, () => createButton(ButtonView));
|
|
770
|
+
editor.ui.componentFactory.add("menuBar:subscript", () => createButton(MenuBarMenuListItemButtonView));
|
|
771
|
+
}
|
|
772
|
+
};
|
|
727
773
|
|
|
728
774
|
/**
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
775
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
776
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
777
|
+
*/
|
|
778
|
+
/**
|
|
779
|
+
* @module basic-styles/subscript
|
|
780
|
+
*/
|
|
781
|
+
/**
|
|
782
|
+
* The subscript feature.
|
|
783
|
+
*
|
|
784
|
+
* It loads the {@link module:basic-styles/subscript/subscriptediting~SubscriptEditing} and
|
|
785
|
+
* {@link module:basic-styles/subscript/subscriptui~SubscriptUI} plugins.
|
|
786
|
+
*/
|
|
787
|
+
var Subscript = class extends Plugin {
|
|
788
|
+
/**
|
|
789
|
+
* @inheritDoc
|
|
790
|
+
*/
|
|
791
|
+
static get requires() {
|
|
792
|
+
return [SubscriptEditing, SubscriptUI];
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* @inheritDoc
|
|
796
|
+
*/
|
|
797
|
+
static get pluginName() {
|
|
798
|
+
return "Subscript";
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* @inheritDoc
|
|
802
|
+
*/
|
|
803
|
+
static get isOfficialPlugin() {
|
|
804
|
+
return true;
|
|
805
|
+
}
|
|
806
|
+
};
|
|
753
807
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
}
|
|
808
|
+
/**
|
|
809
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
810
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
811
|
+
*/
|
|
812
|
+
/**
|
|
813
|
+
* @module basic-styles/superscript/superscriptediting
|
|
814
|
+
*/
|
|
815
|
+
const SUPERSCRIPT$1 = "superscript";
|
|
816
|
+
/**
|
|
817
|
+
* The superscript editing feature.
|
|
818
|
+
*
|
|
819
|
+
* It registers the `super` command and introduces the `super` attribute in the model which renders to the view
|
|
820
|
+
* as a `<super>` element.
|
|
821
|
+
*/
|
|
822
|
+
var SuperscriptEditing = class extends Plugin {
|
|
823
|
+
/**
|
|
824
|
+
* @inheritDoc
|
|
825
|
+
*/
|
|
826
|
+
static get pluginName() {
|
|
827
|
+
return "SuperscriptEditing";
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* @inheritDoc
|
|
831
|
+
*/
|
|
832
|
+
static get isOfficialPlugin() {
|
|
833
|
+
return true;
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* @inheritDoc
|
|
837
|
+
*/
|
|
838
|
+
init() {
|
|
839
|
+
const editor = this.editor;
|
|
840
|
+
editor.model.schema.extend("$text", { allowAttributes: SUPERSCRIPT$1 });
|
|
841
|
+
editor.model.schema.setAttributeProperties(SUPERSCRIPT$1, {
|
|
842
|
+
isFormatting: true,
|
|
843
|
+
copyOnEnter: true
|
|
844
|
+
});
|
|
845
|
+
editor.conversion.attributeToElement({
|
|
846
|
+
model: SUPERSCRIPT$1,
|
|
847
|
+
view: "sup",
|
|
848
|
+
upcastAlso: [{ styles: { "vertical-align": "super" } }]
|
|
849
|
+
});
|
|
850
|
+
editor.commands.add(SUPERSCRIPT$1, new AttributeCommand(editor, SUPERSCRIPT$1));
|
|
851
|
+
}
|
|
852
|
+
};
|
|
799
853
|
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
854
|
+
/**
|
|
855
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
856
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
857
|
+
*/
|
|
858
|
+
/**
|
|
859
|
+
* @module basic-styles/superscript/superscriptui
|
|
860
|
+
*/
|
|
861
|
+
const SUPERSCRIPT = "superscript";
|
|
862
|
+
/**
|
|
863
|
+
* The superscript UI feature. It introduces the Superscript button.
|
|
864
|
+
*/
|
|
865
|
+
var SuperscriptUI = class extends Plugin {
|
|
866
|
+
/**
|
|
867
|
+
* @inheritDoc
|
|
868
|
+
*/
|
|
869
|
+
static get pluginName() {
|
|
870
|
+
return "SuperscriptUI";
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* @inheritDoc
|
|
874
|
+
*/
|
|
875
|
+
static get isOfficialPlugin() {
|
|
876
|
+
return true;
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* @inheritDoc
|
|
880
|
+
*/
|
|
881
|
+
init() {
|
|
882
|
+
const editor = this.editor;
|
|
883
|
+
const t = editor.locale.t;
|
|
884
|
+
const createButton = getButtonCreator({
|
|
885
|
+
editor,
|
|
886
|
+
commandName: SUPERSCRIPT,
|
|
887
|
+
plugin: this,
|
|
888
|
+
icon: IconSuperscript,
|
|
889
|
+
label: t("Superscript")
|
|
890
|
+
});
|
|
891
|
+
editor.ui.componentFactory.add(SUPERSCRIPT, () => createButton(ButtonView));
|
|
892
|
+
editor.ui.componentFactory.add("menuBar:superscript", () => createButton(MenuBarMenuListItemButtonView));
|
|
893
|
+
}
|
|
894
|
+
};
|
|
831
895
|
|
|
832
896
|
/**
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
897
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
898
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
899
|
+
*/
|
|
900
|
+
/**
|
|
901
|
+
* @module basic-styles/superscript
|
|
902
|
+
*/
|
|
903
|
+
/**
|
|
904
|
+
* The superscript feature.
|
|
905
|
+
*
|
|
906
|
+
* It loads the {@link module:basic-styles/superscript/superscriptediting~SuperscriptEditing} and
|
|
907
|
+
* {@link module:basic-styles/superscript/superscriptui~SuperscriptUI} plugins.
|
|
908
|
+
*/
|
|
909
|
+
var Superscript = class extends Plugin {
|
|
910
|
+
/**
|
|
911
|
+
* @inheritDoc
|
|
912
|
+
*/
|
|
913
|
+
static get requires() {
|
|
914
|
+
return [SuperscriptEditing, SuperscriptUI];
|
|
915
|
+
}
|
|
916
|
+
/**
|
|
917
|
+
* @inheritDoc
|
|
918
|
+
*/
|
|
919
|
+
static get pluginName() {
|
|
920
|
+
return "Superscript";
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* @inheritDoc
|
|
924
|
+
*/
|
|
925
|
+
static get isOfficialPlugin() {
|
|
926
|
+
return true;
|
|
927
|
+
}
|
|
928
|
+
};
|
|
857
929
|
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
});
|
|
910
|
-
}
|
|
911
|
-
}
|
|
930
|
+
/**
|
|
931
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
932
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
933
|
+
*/
|
|
934
|
+
/**
|
|
935
|
+
* @module basic-styles/underline/underlineediting
|
|
936
|
+
*/
|
|
937
|
+
const UNDERLINE$1 = "underline";
|
|
938
|
+
/**
|
|
939
|
+
* The underline editing feature.
|
|
940
|
+
*
|
|
941
|
+
* It registers the `'underline'` command, the <kbd>Ctrl+U</kbd> keystroke
|
|
942
|
+
* and introduces the `underline` attribute in the model which renders to the view as an `<u>` element.
|
|
943
|
+
*/
|
|
944
|
+
var UnderlineEditing = class extends Plugin {
|
|
945
|
+
/**
|
|
946
|
+
* @inheritDoc
|
|
947
|
+
*/
|
|
948
|
+
static get pluginName() {
|
|
949
|
+
return "UnderlineEditing";
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* @inheritDoc
|
|
953
|
+
*/
|
|
954
|
+
static get isOfficialPlugin() {
|
|
955
|
+
return true;
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* @inheritDoc
|
|
959
|
+
*/
|
|
960
|
+
init() {
|
|
961
|
+
const editor = this.editor;
|
|
962
|
+
const t = this.editor.t;
|
|
963
|
+
editor.model.schema.extend("$text", { allowAttributes: UNDERLINE$1 });
|
|
964
|
+
editor.model.schema.setAttributeProperties(UNDERLINE$1, {
|
|
965
|
+
isFormatting: true,
|
|
966
|
+
copyOnEnter: true
|
|
967
|
+
});
|
|
968
|
+
editor.conversion.attributeToElement({
|
|
969
|
+
model: UNDERLINE$1,
|
|
970
|
+
view: "u",
|
|
971
|
+
upcastAlso: { styles: { "text-decoration": "underline" } }
|
|
972
|
+
});
|
|
973
|
+
editor.commands.add(UNDERLINE$1, new AttributeCommand(editor, UNDERLINE$1));
|
|
974
|
+
editor.keystrokes.set("CTRL+U", "underline");
|
|
975
|
+
editor.accessibility.addKeystrokeInfos({ keystrokes: [{
|
|
976
|
+
label: t("Underline text"),
|
|
977
|
+
keystroke: "CTRL+U"
|
|
978
|
+
}] });
|
|
979
|
+
}
|
|
980
|
+
};
|
|
912
981
|
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
982
|
+
/**
|
|
983
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
984
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
985
|
+
*/
|
|
986
|
+
/**
|
|
987
|
+
* @module basic-styles/underline/underlineui
|
|
988
|
+
*/
|
|
989
|
+
const UNDERLINE = "underline";
|
|
990
|
+
/**
|
|
991
|
+
* The underline UI feature. It introduces the Underline button.
|
|
992
|
+
*/
|
|
993
|
+
var UnderlineUI = class extends Plugin {
|
|
994
|
+
/**
|
|
995
|
+
* @inheritDoc
|
|
996
|
+
*/
|
|
997
|
+
static get pluginName() {
|
|
998
|
+
return "UnderlineUI";
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* @inheritDoc
|
|
1002
|
+
*/
|
|
1003
|
+
static get isOfficialPlugin() {
|
|
1004
|
+
return true;
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* @inheritDoc
|
|
1008
|
+
*/
|
|
1009
|
+
init() {
|
|
1010
|
+
const editor = this.editor;
|
|
1011
|
+
const t = editor.locale.t;
|
|
1012
|
+
const createButton = getButtonCreator({
|
|
1013
|
+
editor,
|
|
1014
|
+
commandName: UNDERLINE,
|
|
1015
|
+
plugin: this,
|
|
1016
|
+
icon: IconUnderline,
|
|
1017
|
+
label: t("Underline"),
|
|
1018
|
+
keystroke: "CTRL+U"
|
|
1019
|
+
});
|
|
1020
|
+
editor.ui.componentFactory.add(UNDERLINE, () => createButton(ButtonView));
|
|
1021
|
+
editor.ui.componentFactory.add("menuBar:underline", () => createButton(MenuBarMenuListItemButtonView));
|
|
1022
|
+
}
|
|
1023
|
+
};
|
|
945
1024
|
|
|
946
1025
|
/**
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
1026
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
1027
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
1028
|
+
*/
|
|
1029
|
+
/**
|
|
1030
|
+
* @module basic-styles/underline
|
|
1031
|
+
*/
|
|
1032
|
+
/**
|
|
1033
|
+
* The underline feature.
|
|
1034
|
+
*
|
|
1035
|
+
* For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
|
|
1036
|
+
* and the {@glink api/basic-styles package page}.
|
|
1037
|
+
*
|
|
1038
|
+
* This is a "glue" plugin which loads the {@link module:basic-styles/underline/underlineediting~UnderlineEditing} and
|
|
1039
|
+
* {@link module:basic-styles/underline/underlineui~UnderlineUI} plugins.
|
|
1040
|
+
*/
|
|
1041
|
+
var Underline = class extends Plugin {
|
|
1042
|
+
/**
|
|
1043
|
+
* @inheritDoc
|
|
1044
|
+
*/
|
|
1045
|
+
static get requires() {
|
|
1046
|
+
return [UnderlineEditing, UnderlineUI];
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* @inheritDoc
|
|
1050
|
+
*/
|
|
1051
|
+
static get pluginName() {
|
|
1052
|
+
return "Underline";
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* @inheritDoc
|
|
1056
|
+
*/
|
|
1057
|
+
static get isOfficialPlugin() {
|
|
1058
|
+
return true;
|
|
1059
|
+
}
|
|
1060
|
+
};
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
1064
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
1065
|
+
*/
|
|
974
1066
|
|
|
975
1067
|
export { AttributeCommand, Bold, BoldEditing, BoldUI, Code, CodeEditing, CodeUI, Italic, ItalicEditing, ItalicUI, Strikethrough, StrikethroughEditing, StrikethroughUI, Subscript, SubscriptEditing, SubscriptUI, Superscript, SuperscriptEditing, SuperscriptUI, Underline, UnderlineEditing, UnderlineUI, getButtonCreator as _getBasicStylesButtonCreator };
|
|
976
|
-
//# sourceMappingURL=index.js.map
|
|
1068
|
+
//# sourceMappingURL=index.js.map
|