@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/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 '@ckeditor/ckeditor5-core/dist/index.js';
6
- import { ModelDocumentSelection } from '@ckeditor/ckeditor5-engine/dist/index.js';
7
- import { IconBold, IconCode, IconItalic, IconStrikethrough, IconSubscript, IconSuperscript, IconUnderline } from '@ckeditor/ckeditor5-icons/dist/index.js';
8
- import { MenuBarMenuListItemButtonView, ButtonView } from '@ckeditor/ckeditor5-ui/dist/index.js';
9
- import { TwoStepCaretMovement, inlineHighlight } from '@ckeditor/ckeditor5-typing/dist/index.js';
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
- * An extension of the base {@link module:core/command~Command} class, which provides utilities for a command
13
- * that toggles a single attribute on a text or an element.
14
- *
15
- * `AttributeCommand` uses {@link module:engine/model/document~ModelDocument#selection}
16
- * to decide which nodes (if any) should be changed, and applies or removes the attribute from them.
17
- *
18
- * The command checks the {@link module:engine/model/model~Model#schema} to decide if it can be enabled
19
- * for the current selection and to which nodes the attribute can be applied.
20
- */ class AttributeCommand extends Command {
21
- /**
22
- * The attribute that will be set by the command.
23
- */ attributeKey;
24
- /**
25
- * @param attributeKey Attribute that will be set by the command.
26
- */ constructor(editor, attributeKey){
27
- super(editor);
28
- this.attributeKey = attributeKey;
29
- }
30
- /**
31
- * Updates the command's {@link #value} and {@link #isEnabled} based on the current selection.
32
- */ refresh() {
33
- const model = this.editor.model;
34
- const doc = model.document;
35
- this.value = this._getValueFromFirstAllowedNode();
36
- this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, this.attributeKey);
37
- }
38
- /**
39
- * Executes the command – applies the attribute to the selection or removes it from the selection.
40
- *
41
- * If the command is active (`value == true`), it will remove attributes. Otherwise, it will set attributes.
42
- *
43
- * The execution result differs, depending on the {@link module:engine/model/document~ModelDocument#selection}:
44
- *
45
- * * If the selection is on a range, the command applies the attribute to all nodes in that range
46
- * (if they are allowed to have this attribute by the {@link module:engine/model/schema~ModelSchema schema}).
47
- * * If the selection is collapsed in a non-empty node, the command applies the attribute to the
48
- * {@link module:engine/model/document~ModelDocument#selection} itself (note that typed characters copy attributes from the selection).
49
- * * If the selection is collapsed in an empty node, the command applies the attribute to the parent node of the selection (note
50
- * that the selection inherits all attributes from a node if it is in an empty node).
51
- *
52
- * @fires execute
53
- * @param options Command options.
54
- * @param options.forceValue If set, it will force the command behavior. If `true`,
55
- * the command will apply the attribute, otherwise the command will remove the attribute.
56
- * If not set, the command will look for its current value to decide what it should do.
57
- */ execute(options = {}) {
58
- const model = this.editor.model;
59
- const doc = model.document;
60
- const selection = doc.selection;
61
- const value = options.forceValue === undefined ? !this.value : options.forceValue;
62
- model.change((writer)=>{
63
- if (selection.isCollapsed) {
64
- if (value) {
65
- writer.setSelectionAttribute(this.attributeKey, true);
66
- } else {
67
- writer.removeSelectionAttribute(this.attributeKey);
68
- }
69
- } else {
70
- const ranges = model.schema.getValidRanges(selection.getRanges(), this.attributeKey, {
71
- includeEmptyRanges: true
72
- });
73
- for (const range of ranges){
74
- let itemOrRange = range;
75
- let attributeKey = this.attributeKey;
76
- if (range.isCollapsed) {
77
- itemOrRange = range.start.parent;
78
- attributeKey = ModelDocumentSelection._getStoreAttributeKey(this.attributeKey);
79
- }
80
- if (value) {
81
- writer.setAttribute(attributeKey, value, itemOrRange);
82
- } else {
83
- writer.removeAttribute(attributeKey, itemOrRange);
84
- }
85
- }
86
- }
87
- });
88
- }
89
- /**
90
- * Checks the attribute value of the first node in the selection that allows the attribute.
91
- * For the collapsed selection returns the selection attribute.
92
- *
93
- * @returns The attribute value.
94
- */ _getValueFromFirstAllowedNode() {
95
- const model = this.editor.model;
96
- const schema = model.schema;
97
- const selection = model.document.selection;
98
- if (selection.isCollapsed) {
99
- return selection.hasAttribute(this.attributeKey);
100
- }
101
- for (const range of selection.getRanges()){
102
- for (const item of range.getItems()){
103
- if (schema.checkAttribute(item, this.attributeKey)) {
104
- return item.hasAttribute(this.attributeKey);
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
- const BOLD$1 = 'bold';
113
- /**
114
- * The bold editing feature.
115
- *
116
- * It registers the `'bold'` command and introduces the `bold` attribute in the model which renders to the view
117
- * as a `<strong>` element.
118
- */ class BoldEditing extends Plugin {
119
- /**
120
- * @inheritDoc
121
- */ static get pluginName() {
122
- return 'BoldEditing';
123
- }
124
- /**
125
- * @inheritDoc
126
- */ static get isOfficialPlugin() {
127
- return true;
128
- }
129
- /**
130
- * @inheritDoc
131
- */ init() {
132
- const editor = this.editor;
133
- const t = this.editor.t;
134
- // Allow bold attribute on text nodes.
135
- editor.model.schema.extend('$text', {
136
- allowAttributes: BOLD$1
137
- });
138
- editor.model.schema.setAttributeProperties(BOLD$1, {
139
- isFormatting: true,
140
- copyOnEnter: true
141
- });
142
- // Build converter from model to view for data and editing pipelines.
143
- editor.conversion.attributeToElement({
144
- model: BOLD$1,
145
- view: 'strong',
146
- upcastAlso: [
147
- 'b',
148
- (viewElement)=>{
149
- const fontWeight = viewElement.getStyle('font-weight');
150
- if (!fontWeight) {
151
- return null;
152
- }
153
- // Value of the `font-weight` attribute can be defined as a string or a number.
154
- if (fontWeight == 'bold' || Number(fontWeight) >= 600) {
155
- return {
156
- name: true,
157
- styles: [
158
- 'font-weight'
159
- ]
160
- };
161
- }
162
- return null;
163
- }
164
- ]
165
- });
166
- // Create bold command.
167
- editor.commands.add(BOLD$1, new AttributeCommand(editor, BOLD$1));
168
- // Set the Ctrl+B keystroke.
169
- editor.keystrokes.set('CTRL+B', BOLD$1);
170
- // Add the information about the keystroke to the accessibility database.
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
- * Returns a function that creates a (toolbar or menu bar) button for a basic style feature.
184
- *
185
- * @internal
186
- */ function getButtonCreator({ editor, commandName, plugin, icon, label, keystroke }) {
187
- return (ButtonClass)=>{
188
- const command = editor.commands.get(commandName);
189
- const view = new ButtonClass(editor.locale);
190
- view.set({
191
- label,
192
- icon,
193
- keystroke,
194
- isToggleable: true
195
- });
196
- view.bind('isEnabled').to(command, 'isEnabled');
197
- view.bind('isOn').to(command, 'value');
198
- if (view instanceof MenuBarMenuListItemButtonView) {
199
- view.set({
200
- role: 'menuitemcheckbox'
201
- });
202
- } else {
203
- view.set({
204
- tooltip: true
205
- });
206
- }
207
- // Execute the command.
208
- plugin.listenTo(view, 'execute', ()=>{
209
- editor.execute(commandName);
210
- editor.editing.view.focus();
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
- const BOLD = 'bold';
217
- /**
218
- * The bold UI feature. It introduces the Bold button.
219
- */ class BoldUI extends Plugin {
220
- /**
221
- * @inheritDoc
222
- */ static get pluginName() {
223
- return 'BoldUI';
224
- }
225
- /**
226
- * @inheritDoc
227
- */ static get isOfficialPlugin() {
228
- return true;
229
- }
230
- /**
231
- * @inheritDoc
232
- */ init() {
233
- const editor = this.editor;
234
- const t = editor.locale.t;
235
- const createButton = getButtonCreator({
236
- editor,
237
- commandName: BOLD,
238
- plugin: this,
239
- icon: IconBold,
240
- label: t('Bold'),
241
- keystroke: 'CTRL+B'
242
- });
243
- // Add bold button to feature components.
244
- editor.ui.componentFactory.add(BOLD, ()=>createButton(ButtonView));
245
- editor.ui.componentFactory.add('menuBar:' + BOLD, ()=>createButton(MenuBarMenuListItemButtonView));
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
- * 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
- */ class Bold extends Plugin {
258
- /**
259
- * @inheritDoc
260
- */ static get requires() {
261
- return [
262
- BoldEditing,
263
- BoldUI
264
- ];
265
- }
266
- /**
267
- * @inheritDoc
268
- */ static get pluginName() {
269
- return 'Bold';
270
- }
271
- /**
272
- * @inheritDoc
273
- */ static get isOfficialPlugin() {
274
- return true;
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
- const CODE$1 = 'code';
279
- const HIGHLIGHT_CLASS = 'ck-code_selected';
280
- /**
281
- * The code editing feature.
282
- *
283
- * It registers the `'code'` command and introduces the `code` attribute in the model which renders to the view
284
- * as a `<code>` element.
285
- */ class CodeEditing extends Plugin {
286
- /**
287
- * @inheritDoc
288
- */ static get pluginName() {
289
- return 'CodeEditing';
290
- }
291
- /**
292
- * @inheritDoc
293
- */ static get isOfficialPlugin() {
294
- return true;
295
- }
296
- /**
297
- * @inheritDoc
298
- */ static get requires() {
299
- return [
300
- TwoStepCaretMovement
301
- ];
302
- }
303
- /**
304
- * @inheritDoc
305
- */ init() {
306
- const editor = this.editor;
307
- const t = this.editor.t;
308
- // Allow code attribute on text nodes.
309
- editor.model.schema.extend('$text', {
310
- allowAttributes: CODE$1
311
- });
312
- editor.model.schema.setAttributeProperties(CODE$1, {
313
- isFormatting: true,
314
- copyOnEnter: false
315
- });
316
- editor.conversion.attributeToElement({
317
- model: CODE$1,
318
- view: 'code'
319
- });
320
- // Create code command.
321
- editor.commands.add(CODE$1, new AttributeCommand(editor, CODE$1));
322
- // Enable two-step caret movement for `code` attribute.
323
- editor.plugins.get(TwoStepCaretMovement).registerAttribute(CODE$1);
324
- // Setup highlight over selected element.
325
- inlineHighlight(editor, CODE$1, 'code', HIGHLIGHT_CLASS);
326
- // Add the information about the keystroke to the accessibility database.
327
- editor.accessibility.addKeystrokeInfos({
328
- keystrokes: [
329
- {
330
- label: t('Move out of an inline code style'),
331
- keystroke: [
332
- [
333
- 'arrowleft',
334
- 'arrowleft'
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
- const CODE = 'code';
348
- /**
349
- * The code UI feature. It introduces the Code button.
350
- */ class CodeUI extends Plugin {
351
- /**
352
- * @inheritDoc
353
- */ static get pluginName() {
354
- return 'CodeUI';
355
- }
356
- /**
357
- * @inheritDoc
358
- */ static get isOfficialPlugin() {
359
- return true;
360
- }
361
- /**
362
- * @inheritDoc
363
- */ init() {
364
- const editor = this.editor;
365
- const t = editor.locale.t;
366
- const createButton = getButtonCreator({
367
- editor,
368
- commandName: CODE,
369
- plugin: this,
370
- icon: IconCode,
371
- label: t('Code')
372
- });
373
- // Add code button to feature components.
374
- editor.ui.componentFactory.add(CODE, ()=>createButton(ButtonView));
375
- editor.ui.componentFactory.add('menuBar:' + CODE, ()=>createButton(MenuBarMenuListItemButtonView));
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
- * The code feature.
381
- *
382
- * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
383
- * and the {@glink api/basic-styles package page}.
384
- *
385
- * This is a "glue" plugin which loads the {@link module:basic-styles/code/codeediting~CodeEditing code editing feature}
386
- * and {@link module:basic-styles/code/codeui~CodeUI code UI feature}.
387
- */ class Code extends Plugin {
388
- /**
389
- * @inheritDoc
390
- */ static get requires() {
391
- return [
392
- CodeEditing,
393
- CodeUI
394
- ];
395
- }
396
- /**
397
- * @inheritDoc
398
- */ static get pluginName() {
399
- return 'Code';
400
- }
401
- /**
402
- * @inheritDoc
403
- */ static get isOfficialPlugin() {
404
- return true;
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
- const ITALIC$1 = 'italic';
409
- /**
410
- * The italic editing feature.
411
- *
412
- * It registers the `'italic'` command, the <kbd>Ctrl+I</kbd> keystroke and introduces the `italic` attribute in the model
413
- * which renders to the view as an `<i>` element.
414
- */ class ItalicEditing extends Plugin {
415
- /**
416
- * @inheritDoc
417
- */ static get pluginName() {
418
- return 'ItalicEditing';
419
- }
420
- /**
421
- * @inheritDoc
422
- */ static get isOfficialPlugin() {
423
- return true;
424
- }
425
- /**
426
- * @inheritDoc
427
- */ init() {
428
- const editor = this.editor;
429
- const t = this.editor.t;
430
- // Allow italic attribute on text nodes.
431
- editor.model.schema.extend('$text', {
432
- allowAttributes: ITALIC$1
433
- });
434
- editor.model.schema.setAttributeProperties(ITALIC$1, {
435
- isFormatting: true,
436
- copyOnEnter: true
437
- });
438
- editor.conversion.attributeToElement({
439
- model: ITALIC$1,
440
- view: 'i',
441
- upcastAlso: [
442
- 'em',
443
- {
444
- styles: {
445
- 'font-style': 'italic'
446
- }
447
- }
448
- ]
449
- });
450
- // Create italic command.
451
- editor.commands.add(ITALIC$1, new AttributeCommand(editor, ITALIC$1));
452
- // Set the Ctrl+I keystroke.
453
- editor.keystrokes.set('CTRL+I', ITALIC$1);
454
- // Add the information about the keystroke to the accessibility database.
455
- editor.accessibility.addKeystrokeInfos({
456
- keystrokes: [
457
- {
458
- label: t('Italic text'),
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
- const ITALIC = 'italic';
467
- /**
468
- * The italic UI feature. It introduces the Italic button.
469
- */ class ItalicUI extends Plugin {
470
- /**
471
- * @inheritDoc
472
- */ static get pluginName() {
473
- return 'ItalicUI';
474
- }
475
- /**
476
- * @inheritDoc
477
- */ static get isOfficialPlugin() {
478
- return true;
479
- }
480
- /**
481
- * @inheritDoc
482
- */ init() {
483
- const editor = this.editor;
484
- const t = editor.locale.t;
485
- const createButton = getButtonCreator({
486
- editor,
487
- commandName: ITALIC,
488
- plugin: this,
489
- icon: IconItalic,
490
- keystroke: 'CTRL+I',
491
- label: t('Italic')
492
- });
493
- // Add bold button to feature components.
494
- editor.ui.componentFactory.add(ITALIC, ()=>createButton(ButtonView));
495
- editor.ui.componentFactory.add('menuBar:' + ITALIC, ()=>createButton(MenuBarMenuListItemButtonView));
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
- * The italic feature.
501
- *
502
- * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
503
- * and the {@glink api/basic-styles package page}.
504
- *
505
- * This is a "glue" plugin which loads the {@link module:basic-styles/italic/italicediting~ItalicEditing} and
506
- * {@link module:basic-styles/italic/italicui~ItalicUI} plugins.
507
- */ class Italic extends Plugin {
508
- /**
509
- * @inheritDoc
510
- */ static get requires() {
511
- return [
512
- ItalicEditing,
513
- ItalicUI
514
- ];
515
- }
516
- /**
517
- * @inheritDoc
518
- */ static get pluginName() {
519
- return 'Italic';
520
- }
521
- /**
522
- * @inheritDoc
523
- */ static get isOfficialPlugin() {
524
- return true;
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
- const STRIKETHROUGH$1 = 'strikethrough';
529
- /**
530
- * The strikethrough editing feature.
531
- *
532
- * It registers the `'strikethrough'` command, the <kbd>Ctrl+Shift+X</kbd> keystroke and introduces the
533
- * `strikethroughsthrough` attribute in the model which renders to the view
534
- * as a `<s>` element.
535
- */ class StrikethroughEditing extends Plugin {
536
- /**
537
- * @inheritDoc
538
- */ static get pluginName() {
539
- return 'StrikethroughEditing';
540
- }
541
- /**
542
- * @inheritDoc
543
- */ static get isOfficialPlugin() {
544
- return true;
545
- }
546
- /**
547
- * @inheritDoc
548
- */ init() {
549
- const editor = this.editor;
550
- const t = this.editor.t;
551
- // Allow strikethrough attribute on text nodes.
552
- editor.model.schema.extend('$text', {
553
- allowAttributes: STRIKETHROUGH$1
554
- });
555
- editor.model.schema.setAttributeProperties(STRIKETHROUGH$1, {
556
- isFormatting: true,
557
- copyOnEnter: true
558
- });
559
- editor.conversion.attributeToElement({
560
- model: STRIKETHROUGH$1,
561
- view: 's',
562
- upcastAlso: [
563
- 'del',
564
- 'strike',
565
- {
566
- styles: {
567
- 'text-decoration': 'line-through'
568
- }
569
- }
570
- ]
571
- });
572
- // Create strikethrough command.
573
- editor.commands.add(STRIKETHROUGH$1, new AttributeCommand(editor, STRIKETHROUGH$1));
574
- // Set the Ctrl+Shift+X keystroke.
575
- editor.keystrokes.set('CTRL+SHIFT+X', 'strikethrough');
576
- // Add the information about the keystroke to the accessibility database.
577
- editor.accessibility.addKeystrokeInfos({
578
- keystrokes: [
579
- {
580
- label: t('Strikethrough text'),
581
- keystroke: 'CTRL+SHIFT+X'
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
- const STRIKETHROUGH = 'strikethrough';
589
- /**
590
- * The strikethrough UI feature. It introduces the Strikethrough button.
591
- */ class StrikethroughUI extends Plugin {
592
- /**
593
- * @inheritDoc
594
- */ static get pluginName() {
595
- return 'StrikethroughUI';
596
- }
597
- /**
598
- * @inheritDoc
599
- */ static get isOfficialPlugin() {
600
- return true;
601
- }
602
- /**
603
- * @inheritDoc
604
- */ init() {
605
- const editor = this.editor;
606
- const t = editor.locale.t;
607
- const createButton = getButtonCreator({
608
- editor,
609
- commandName: STRIKETHROUGH,
610
- plugin: this,
611
- icon: IconStrikethrough,
612
- keystroke: 'CTRL+SHIFT+X',
613
- label: t('Strikethrough')
614
- });
615
- // Add strikethrough button to feature components.
616
- editor.ui.componentFactory.add(STRIKETHROUGH, ()=>createButton(ButtonView));
617
- editor.ui.componentFactory.add('menuBar:' + STRIKETHROUGH, ()=>createButton(MenuBarMenuListItemButtonView));
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
- * The strikethrough feature.
623
- *
624
- * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
625
- * and the {@glink api/basic-styles package page}.
626
- *
627
- * This is a "glue" plugin which loads the {@link module:basic-styles/strikethrough/strikethroughediting~StrikethroughEditing} and
628
- * {@link module:basic-styles/strikethrough/strikethroughui~StrikethroughUI} plugins.
629
- */ class Strikethrough extends Plugin {
630
- /**
631
- * @inheritDoc
632
- */ static get requires() {
633
- return [
634
- StrikethroughEditing,
635
- StrikethroughUI
636
- ];
637
- }
638
- /**
639
- * @inheritDoc
640
- */ static get pluginName() {
641
- return 'Strikethrough';
642
- }
643
- /**
644
- * @inheritDoc
645
- */ static get isOfficialPlugin() {
646
- return true;
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
- const SUBSCRIPT$1 = 'subscript';
651
- /**
652
- * The subscript editing feature.
653
- *
654
- * It registers the `sub` command and introduces the `sub` attribute in the model which renders to the view
655
- * as a `<sub>` element.
656
- */ class SubscriptEditing extends Plugin {
657
- /**
658
- * @inheritDoc
659
- */ static get pluginName() {
660
- return 'SubscriptEditing';
661
- }
662
- /**
663
- * @inheritDoc
664
- */ static get isOfficialPlugin() {
665
- return true;
666
- }
667
- /**
668
- * @inheritDoc
669
- */ init() {
670
- const editor = this.editor;
671
- // Allow sub attribute on text nodes.
672
- editor.model.schema.extend('$text', {
673
- allowAttributes: SUBSCRIPT$1
674
- });
675
- editor.model.schema.setAttributeProperties(SUBSCRIPT$1, {
676
- isFormatting: true,
677
- copyOnEnter: true
678
- });
679
- // Build converter from model to view for data and editing pipelines.
680
- editor.conversion.attributeToElement({
681
- model: SUBSCRIPT$1,
682
- view: 'sub',
683
- upcastAlso: [
684
- {
685
- styles: {
686
- 'vertical-align': 'sub'
687
- }
688
- }
689
- ]
690
- });
691
- // Create sub command.
692
- editor.commands.add(SUBSCRIPT$1, new AttributeCommand(editor, SUBSCRIPT$1));
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
- const SUBSCRIPT = 'subscript';
697
- /**
698
- * The subscript UI feature. It introduces the Subscript button.
699
- */ class SubscriptUI extends Plugin {
700
- /**
701
- * @inheritDoc
702
- */ static get pluginName() {
703
- return 'SubscriptUI';
704
- }
705
- /**
706
- * @inheritDoc
707
- */ static get isOfficialPlugin() {
708
- return true;
709
- }
710
- /**
711
- * @inheritDoc
712
- */ init() {
713
- const editor = this.editor;
714
- const t = editor.locale.t;
715
- const createButton = getButtonCreator({
716
- editor,
717
- commandName: SUBSCRIPT,
718
- plugin: this,
719
- icon: IconSubscript,
720
- label: t('Subscript')
721
- });
722
- // Add subscript button to feature components.
723
- editor.ui.componentFactory.add(SUBSCRIPT, ()=>createButton(ButtonView));
724
- editor.ui.componentFactory.add('menuBar:' + SUBSCRIPT, ()=>createButton(MenuBarMenuListItemButtonView));
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
- * The subscript feature.
730
- *
731
- * It loads the {@link module:basic-styles/subscript/subscriptediting~SubscriptEditing} and
732
- * {@link module:basic-styles/subscript/subscriptui~SubscriptUI} plugins.
733
- */ class Subscript extends Plugin {
734
- /**
735
- * @inheritDoc
736
- */ static get requires() {
737
- return [
738
- SubscriptEditing,
739
- SubscriptUI
740
- ];
741
- }
742
- /**
743
- * @inheritDoc
744
- */ static get pluginName() {
745
- return 'Subscript';
746
- }
747
- /**
748
- * @inheritDoc
749
- */ static get isOfficialPlugin() {
750
- return true;
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
- const SUPERSCRIPT$1 = 'superscript';
755
- /**
756
- * The superscript editing feature.
757
- *
758
- * It registers the `super` command and introduces the `super` attribute in the model which renders to the view
759
- * as a `<super>` element.
760
- */ class SuperscriptEditing extends Plugin {
761
- /**
762
- * @inheritDoc
763
- */ static get pluginName() {
764
- return 'SuperscriptEditing';
765
- }
766
- /**
767
- * @inheritDoc
768
- */ static get isOfficialPlugin() {
769
- return true;
770
- }
771
- /**
772
- * @inheritDoc
773
- */ init() {
774
- const editor = this.editor;
775
- // Allow super attribute on text nodes.
776
- editor.model.schema.extend('$text', {
777
- allowAttributes: SUPERSCRIPT$1
778
- });
779
- editor.model.schema.setAttributeProperties(SUPERSCRIPT$1, {
780
- isFormatting: true,
781
- copyOnEnter: true
782
- });
783
- // Build converter from model to view for data and editing pipelines.
784
- editor.conversion.attributeToElement({
785
- model: SUPERSCRIPT$1,
786
- view: 'sup',
787
- upcastAlso: [
788
- {
789
- styles: {
790
- 'vertical-align': 'super'
791
- }
792
- }
793
- ]
794
- });
795
- // Create super command.
796
- editor.commands.add(SUPERSCRIPT$1, new AttributeCommand(editor, SUPERSCRIPT$1));
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
- const SUPERSCRIPT = 'superscript';
801
- /**
802
- * The superscript UI feature. It introduces the Superscript button.
803
- */ class SuperscriptUI extends Plugin {
804
- /**
805
- * @inheritDoc
806
- */ static get pluginName() {
807
- return 'SuperscriptUI';
808
- }
809
- /**
810
- * @inheritDoc
811
- */ static get isOfficialPlugin() {
812
- return true;
813
- }
814
- /**
815
- * @inheritDoc
816
- */ init() {
817
- const editor = this.editor;
818
- const t = editor.locale.t;
819
- const createButton = getButtonCreator({
820
- editor,
821
- commandName: SUPERSCRIPT,
822
- plugin: this,
823
- icon: IconSuperscript,
824
- label: t('Superscript')
825
- });
826
- // Add superscript button to feature components.
827
- editor.ui.componentFactory.add(SUPERSCRIPT, ()=>createButton(ButtonView));
828
- editor.ui.componentFactory.add('menuBar:' + SUPERSCRIPT, ()=>createButton(MenuBarMenuListItemButtonView));
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
- * The superscript feature.
834
- *
835
- * It loads the {@link module:basic-styles/superscript/superscriptediting~SuperscriptEditing} and
836
- * {@link module:basic-styles/superscript/superscriptui~SuperscriptUI} plugins.
837
- */ class Superscript extends Plugin {
838
- /**
839
- * @inheritDoc
840
- */ static get requires() {
841
- return [
842
- SuperscriptEditing,
843
- SuperscriptUI
844
- ];
845
- }
846
- /**
847
- * @inheritDoc
848
- */ static get pluginName() {
849
- return 'Superscript';
850
- }
851
- /**
852
- * @inheritDoc
853
- */ static get isOfficialPlugin() {
854
- return true;
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
- const UNDERLINE$1 = 'underline';
859
- /**
860
- * The underline editing feature.
861
- *
862
- * It registers the `'underline'` command, the <kbd>Ctrl+U</kbd> keystroke
863
- * and introduces the `underline` attribute in the model which renders to the view as an `<u>` element.
864
- */ class UnderlineEditing extends Plugin {
865
- /**
866
- * @inheritDoc
867
- */ static get pluginName() {
868
- return 'UnderlineEditing';
869
- }
870
- /**
871
- * @inheritDoc
872
- */ static get isOfficialPlugin() {
873
- return true;
874
- }
875
- /**
876
- * @inheritDoc
877
- */ init() {
878
- const editor = this.editor;
879
- const t = this.editor.t;
880
- // Allow strikethrough attribute on text nodes.
881
- editor.model.schema.extend('$text', {
882
- allowAttributes: UNDERLINE$1
883
- });
884
- editor.model.schema.setAttributeProperties(UNDERLINE$1, {
885
- isFormatting: true,
886
- copyOnEnter: true
887
- });
888
- editor.conversion.attributeToElement({
889
- model: UNDERLINE$1,
890
- view: 'u',
891
- upcastAlso: {
892
- styles: {
893
- 'text-decoration': 'underline'
894
- }
895
- }
896
- });
897
- // Create underline command.
898
- editor.commands.add(UNDERLINE$1, new AttributeCommand(editor, UNDERLINE$1));
899
- // Set the Ctrl+U keystroke.
900
- editor.keystrokes.set('CTRL+U', 'underline');
901
- // Add the information about the keystroke to the accessibility database.
902
- editor.accessibility.addKeystrokeInfos({
903
- keystrokes: [
904
- {
905
- label: t('Underline text'),
906
- keystroke: 'CTRL+U'
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
- const UNDERLINE = 'underline';
914
- /**
915
- * The underline UI feature. It introduces the Underline button.
916
- */ class UnderlineUI extends Plugin {
917
- /**
918
- * @inheritDoc
919
- */ static get pluginName() {
920
- return 'UnderlineUI';
921
- }
922
- /**
923
- * @inheritDoc
924
- */ static get isOfficialPlugin() {
925
- return true;
926
- }
927
- /**
928
- * @inheritDoc
929
- */ init() {
930
- const editor = this.editor;
931
- const t = editor.locale.t;
932
- const createButton = getButtonCreator({
933
- editor,
934
- commandName: UNDERLINE,
935
- plugin: this,
936
- icon: IconUnderline,
937
- label: t('Underline'),
938
- keystroke: 'CTRL+U'
939
- });
940
- // Add bold button to feature components.
941
- editor.ui.componentFactory.add(UNDERLINE, ()=>createButton(ButtonView));
942
- editor.ui.componentFactory.add('menuBar:' + UNDERLINE, ()=>createButton(MenuBarMenuListItemButtonView));
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
- * The underline feature.
948
- *
949
- * For a detailed overview check the {@glink features/basic-styles Basic styles feature} guide
950
- * and the {@glink api/basic-styles package page}.
951
- *
952
- * This is a "glue" plugin which loads the {@link module:basic-styles/underline/underlineediting~UnderlineEditing} and
953
- * {@link module:basic-styles/underline/underlineui~UnderlineUI} plugins.
954
- */ class Underline extends Plugin {
955
- /**
956
- * @inheritDoc
957
- */ static get requires() {
958
- return [
959
- UnderlineEditing,
960
- UnderlineUI
961
- ];
962
- }
963
- /**
964
- * @inheritDoc
965
- */ static get pluginName() {
966
- return 'Underline';
967
- }
968
- /**
969
- * @inheritDoc
970
- */ static get isOfficialPlugin() {
971
- return true;
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