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