@ckeditor/ckeditor5-code-block 0.0.0-nightly-next-20250303.0 → 0.0.0-nightly-20250304.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-code-block",
3
- "version": "0.0.0-nightly-next-20250303.0",
3
+ "version": "0.0.0-nightly-20250304.0",
4
4
  "description": "Code block feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -13,14 +13,13 @@
13
13
  "type": "module",
14
14
  "main": "src/index.js",
15
15
  "dependencies": {
16
- "@ckeditor/ckeditor5-core": "0.0.0-nightly-next-20250303.0",
17
- "@ckeditor/ckeditor5-clipboard": "0.0.0-nightly-next-20250303.0",
18
- "@ckeditor/ckeditor5-engine": "0.0.0-nightly-next-20250303.0",
19
- "@ckeditor/ckeditor5-enter": "0.0.0-nightly-next-20250303.0",
20
- "@ckeditor/ckeditor5-icons": "0.0.0-nightly-next-20250303.0",
21
- "@ckeditor/ckeditor5-ui": "0.0.0-nightly-next-20250303.0",
22
- "@ckeditor/ckeditor5-utils": "0.0.0-nightly-next-20250303.0",
23
- "ckeditor5": "0.0.0-nightly-next-20250303.0"
16
+ "@ckeditor/ckeditor5-core": "0.0.0-nightly-20250304.0",
17
+ "@ckeditor/ckeditor5-clipboard": "0.0.0-nightly-20250304.0",
18
+ "@ckeditor/ckeditor5-engine": "0.0.0-nightly-20250304.0",
19
+ "@ckeditor/ckeditor5-enter": "0.0.0-nightly-20250304.0",
20
+ "@ckeditor/ckeditor5-ui": "0.0.0-nightly-20250304.0",
21
+ "@ckeditor/ckeditor5-utils": "0.0.0-nightly-20250304.0",
22
+ "ckeditor5": "0.0.0-nightly-20250304.0"
24
23
  },
25
24
  "author": "CKSource (http://cksource.com/)",
26
25
  "license": "SEE LICENSE IN LICENSE.md",
@@ -9,10 +9,6 @@ import { getNormalizedAndLocalizedLanguageDefinitions, canBeCodeBlock } from './
9
9
  * The code block command plugin.
10
10
  */
11
11
  export default class CodeBlockCommand extends Command {
12
- /**
13
- * Contains the last used language.
14
- */
15
- _lastLanguage;
16
12
  /**
17
13
  * @inheritDoc
18
14
  */
@@ -66,7 +62,7 @@ export default class CodeBlockCommand extends Command {
66
62
  _getValue() {
67
63
  const selection = this.editor.model.document.selection;
68
64
  const firstBlock = first(selection.getSelectedBlocks());
69
- const isCodeBlock = !!firstBlock?.is('element', 'codeBlock');
65
+ const isCodeBlock = !!(firstBlock && firstBlock.is('element', 'codeBlock'));
70
66
  return isCodeBlock ? firstBlock.getAttribute('language') : false;
71
67
  }
72
68
  /**
@@ -5,10 +5,9 @@
5
5
  /**
6
6
  * @module code-block/codeblockui
7
7
  */
8
- import { Plugin } from 'ckeditor5/src/core.js';
8
+ import { icons, Plugin } from 'ckeditor5/src/core.js';
9
9
  import { Collection } from 'ckeditor5/src/utils.js';
10
10
  import { ViewModel, SplitButtonView, createDropdown, addListToDropdown, MenuBarMenuListItemButtonView, MenuBarMenuListView, MenuBarMenuView, MenuBarMenuListItemView } from 'ckeditor5/src/ui.js';
11
- import { IconCodeBlock } from 'ckeditor5/src/icons.js';
12
11
  import { getNormalizedAndLocalizedLanguageDefinitions } from './utils.js';
13
12
  import '../theme/codeblock.css';
14
13
  /**
@@ -46,7 +45,7 @@ export default class CodeBlockUI extends Plugin {
46
45
  splitButtonView.set({
47
46
  label: accessibleLabel,
48
47
  tooltip: true,
49
- icon: IconCodeBlock,
48
+ icon: icons.codeBlock,
50
49
  isToggleable: true
51
50
  });
52
51
  splitButtonView.bind('isOn').to(command, 'value', value => !!value);
@@ -76,7 +75,7 @@ export default class CodeBlockUI extends Plugin {
76
75
  menuView.buttonView.set({
77
76
  role: 'menuitem',
78
77
  label: t('Code block'),
79
- icon: IconCodeBlock
78
+ icon: icons.codeBlock
80
79
  });
81
80
  menuView.bind('isEnabled').to(command);
82
81
  const listView = new MenuBarMenuListView(locale);
@@ -11,10 +11,6 @@ import { getIndentOutdentPositions, isModelSelectionInCodeBlock } from './utils.
11
11
  * The code block indentation increase command plugin.
12
12
  */
13
13
  export default class IndentCodeBlockCommand extends Command {
14
- /**
15
- * A sequence of characters added to the line when the command is executed.
16
- */
17
- _indentSequence;
18
14
  constructor(editor) {
19
15
  super(editor);
20
16
  this._indentSequence = editor.config.get('codeBlock.indentSequence');
@@ -8,10 +8,6 @@ import { getLeadingWhiteSpaces, getIndentOutdentPositions, isModelSelectionInCod
8
8
  * The code block indentation decrease command plugin.
9
9
  */
10
10
  export default class OutdentCodeBlockCommand extends Command {
11
- /**
12
- * A sequence of characters removed from the line when the command is executed.
13
- */
14
- _indentSequence;
15
11
  constructor(editor) {
16
12
  super(editor);
17
13
  this._indentSequence = editor.config.get('codeBlock.indentSequence');