@ckeditor/ckeditor5-code-block 40.0.0 → 40.2.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/CHANGELOG.md CHANGED
@@ -5,7 +5,7 @@ All changes in the package are documented in the main repository. See: https://g
5
5
 
6
6
  Changes for the past releases are available below.
7
7
 
8
- ## [19.0.0](https://github.com/ckeditor/ckeditor5-code-block/compare/v18.0.0...v19.0.0) (2020-04-29)
8
+ ## [19.0.0](https://github.com/ckeditor/ckeditor5-code-block/compare/v18.0.0...v19.0.0) (April 29, 2020)
9
9
 
10
10
  ### Other changes
11
11
 
@@ -13,14 +13,14 @@ Changes for the past releases are available below.
13
13
  * Updated translations. ([5300e22](https://github.com/ckeditor/ckeditor5-code-block/commit/5300e22))
14
14
 
15
15
 
16
- ## [18.0.0](https://github.com/ckeditor/ckeditor5-code-block/compare/v17.0.0...v18.0.0) (2020-03-19)
16
+ ## [18.0.0](https://github.com/ckeditor/ckeditor5-code-block/compare/v17.0.0...v18.0.0) (March 19, 2020)
17
17
 
18
18
  ### Other changes
19
19
 
20
20
  * Updated translations. ([8613554](https://github.com/ckeditor/ckeditor5-code-block/commit/8613554))
21
21
 
22
22
 
23
- ## [17.0.0](https://github.com/ckeditor/ckeditor5-code-block/compare/v16.0.0...v17.0.0) (2020-02-19)
23
+ ## [17.0.0](https://github.com/ckeditor/ckeditor5-code-block/compare/v16.0.0...v17.0.0) (February 19, 2020)
24
24
 
25
25
  ### Bug fixes
26
26
 
@@ -32,6 +32,6 @@ Changes for the past releases are available below.
32
32
  * Updated translations. ([3604224](https://github.com/ckeditor/ckeditor5-code-block/commit/3604224))
33
33
 
34
34
 
35
- ## [16.0.0](https://github.com/ckeditor/ckeditor5-code-block/tree/v16.0.0) (2019-12-04)
35
+ ## [16.0.0](https://github.com/ckeditor/ckeditor5-code-block/tree/v16.0.0) (December 4, 2019)
36
36
 
37
37
  The initial release.
package/LICENSE.md CHANGED
@@ -2,7 +2,7 @@ Software License Agreement
2
2
  ==========================
3
3
 
4
4
  **CKEditor&nbsp;5 code block feature** – https://github.com/ckeditor/ckeditor5-code-block <br>
5
- Copyright (c) 2003-2023, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
5
+ Copyright (c) 20032023, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
6
6
 
7
7
  Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
8
8
 
@@ -13,9 +13,9 @@ Where not otherwise indicated, all CKEditor content is authored by CKSource engi
13
13
 
14
14
  The following libraries are included in CKEditor under the [MIT license](https://opensource.org/licenses/MIT):
15
15
 
16
- * lodash - Copyright (c) JS Foundation and other contributors https://js.foundation/. Based on Underscore.js, copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors http://underscorejs.org/.
16
+ * Lodash - Copyright (c) JS Foundation and other contributors https://js.foundation/. Based on Underscore.js, copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors http://underscorejs.org/.
17
17
 
18
18
  Trademarks
19
19
  ----------
20
20
 
21
- **CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
21
+ **CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks, or service marks of their respective holders.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-code-block",
3
- "version": "40.0.0",
3
+ "version": "40.2.0",
4
4
  "description": "Code block feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,7 +12,7 @@
12
12
  ],
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "ckeditor5": "40.0.0"
15
+ "ckeditor5": "40.2.0"
16
16
  },
17
17
  "author": "CKSource (http://cksource.com/)",
18
18
  "license": "GPL-2.0-or-later",
@@ -1,25 +1,25 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- import type { CodeBlock, CodeBlockCommand, CodeBlockConfig, CodeBlockEditing, CodeBlockUI, IndentCodeBlockCommand, OutdentCodeBlockCommand } from './index';
6
- declare module '@ckeditor/ckeditor5-core' {
7
- interface EditorConfig {
8
- /**
9
- * The configuration of the {@link module:code-block/codeblock~CodeBlock} feature.
10
- *
11
- * Read more in {@link module:code-block/codeblockconfig~CodeBlockConfig}.
12
- */
13
- codeBlock?: CodeBlockConfig;
14
- }
15
- interface PluginsMap {
16
- [CodeBlock.pluginName]: CodeBlock;
17
- [CodeBlockEditing.pluginName]: CodeBlockEditing;
18
- [CodeBlockUI.pluginName]: CodeBlockUI;
19
- }
20
- interface CommandsMap {
21
- codeBlock: CodeBlockCommand;
22
- indentCodeBlock: IndentCodeBlockCommand;
23
- outdentCodeBlock: OutdentCodeBlockCommand;
24
- }
25
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import type { CodeBlock, CodeBlockCommand, CodeBlockConfig, CodeBlockEditing, CodeBlockUI, IndentCodeBlockCommand, OutdentCodeBlockCommand } from './index';
6
+ declare module '@ckeditor/ckeditor5-core' {
7
+ interface EditorConfig {
8
+ /**
9
+ * The configuration of the {@link module:code-block/codeblock~CodeBlock} feature.
10
+ *
11
+ * Read more in {@link module:code-block/codeblockconfig~CodeBlockConfig}.
12
+ */
13
+ codeBlock?: CodeBlockConfig;
14
+ }
15
+ interface PluginsMap {
16
+ [CodeBlock.pluginName]: CodeBlock;
17
+ [CodeBlockEditing.pluginName]: CodeBlockEditing;
18
+ [CodeBlockUI.pluginName]: CodeBlockUI;
19
+ }
20
+ interface CommandsMap {
21
+ codeBlock: CodeBlockCommand;
22
+ indentCodeBlock: IndentCodeBlockCommand;
23
+ outdentCodeBlock: OutdentCodeBlockCommand;
24
+ }
25
+ }
@@ -1,5 +1,5 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- export {};
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export {};
@@ -1,29 +1,29 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module code-block/codeblock
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import CodeBlockEditing from './codeblockediting';
10
- import CodeBlockUI from './codeblockui';
11
- /**
12
- * The code block plugin.
13
- *
14
- * For more information about this feature check the {@glink api/code-block package page} and the
15
- * {@glink features/code-blocks code block} feature guide.
16
- *
17
- * This is a "glue" plugin that loads the {@link module:code-block/codeblockediting~CodeBlockEditing code block editing feature}
18
- * and the {@link module:code-block/codeblockui~CodeBlockUI code block UI feature}.
19
- */
20
- export default class CodeBlock extends Plugin {
21
- /**
22
- * @inheritDoc
23
- */
24
- static get requires(): readonly [typeof CodeBlockEditing, typeof CodeBlockUI];
25
- /**
26
- * @inheritDoc
27
- */
28
- static get pluginName(): "CodeBlock";
29
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module code-block/codeblock
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ import CodeBlockEditing from './codeblockediting';
10
+ import CodeBlockUI from './codeblockui';
11
+ /**
12
+ * The code block plugin.
13
+ *
14
+ * For more information about this feature check the {@glink api/code-block package page} and the
15
+ * {@glink features/code-blocks code block} feature guide.
16
+ *
17
+ * This is a "glue" plugin that loads the {@link module:code-block/codeblockediting~CodeBlockEditing code block editing feature}
18
+ * and the {@link module:code-block/codeblockui~CodeBlockUI code block UI feature}.
19
+ */
20
+ export default class CodeBlock extends Plugin {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get requires(): readonly [typeof CodeBlockEditing, typeof CodeBlockUI];
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ static get pluginName(): "CodeBlock";
29
+ }
package/src/codeblock.js CHANGED
@@ -1,33 +1,33 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module code-block/codeblock
7
- */
8
- import { Plugin } from 'ckeditor5/src/core';
9
- import CodeBlockEditing from './codeblockediting';
10
- import CodeBlockUI from './codeblockui';
11
- /**
12
- * The code block plugin.
13
- *
14
- * For more information about this feature check the {@glink api/code-block package page} and the
15
- * {@glink features/code-blocks code block} feature guide.
16
- *
17
- * This is a "glue" plugin that loads the {@link module:code-block/codeblockediting~CodeBlockEditing code block editing feature}
18
- * and the {@link module:code-block/codeblockui~CodeBlockUI code block UI feature}.
19
- */
20
- export default class CodeBlock extends Plugin {
21
- /**
22
- * @inheritDoc
23
- */
24
- static get requires() {
25
- return [CodeBlockEditing, CodeBlockUI];
26
- }
27
- /**
28
- * @inheritDoc
29
- */
30
- static get pluginName() {
31
- return 'CodeBlock';
32
- }
33
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module code-block/codeblock
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core';
9
+ import CodeBlockEditing from './codeblockediting';
10
+ import CodeBlockUI from './codeblockui';
11
+ /**
12
+ * The code block plugin.
13
+ *
14
+ * For more information about this feature check the {@glink api/code-block package page} and the
15
+ * {@glink features/code-blocks code block} feature guide.
16
+ *
17
+ * This is a "glue" plugin that loads the {@link module:code-block/codeblockediting~CodeBlockEditing code block editing feature}
18
+ * and the {@link module:code-block/codeblockui~CodeBlockUI code block UI feature}.
19
+ */
20
+ export default class CodeBlock extends Plugin {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get requires() {
25
+ return [CodeBlockEditing, CodeBlockUI];
26
+ }
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ static get pluginName() {
31
+ return 'CodeBlock';
32
+ }
33
+ }
@@ -1,60 +1,60 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- import { Command, type Editor } from 'ckeditor5/src/core';
6
- /**
7
- * The code block command plugin.
8
- */
9
- export default class CodeBlockCommand extends Command {
10
- /**
11
- * Contains the last used language.
12
- */
13
- private _lastLanguage;
14
- /**
15
- * Contains language if any is selected, false otherwise.
16
- * @observable
17
- * @readonly
18
- */
19
- value: string | false;
20
- /**
21
- * @inheritDoc
22
- */
23
- constructor(editor: Editor);
24
- /**
25
- * @inheritDoc
26
- */
27
- refresh(): void;
28
- /**
29
- * Executes the command. When the command {@link #value is on}, all topmost code blocks within
30
- * the selection will be removed. If it is off, all selected blocks will be flattened and
31
- * wrapped by a code block.
32
- *
33
- * @fires execute
34
- * @param options Command options.
35
- * @param options.language The code block language.
36
- * @param options.forceValue If set, it will force the command behavior. If `true`, the command will apply a code block,
37
- * otherwise the command will remove the code block. If not set, the command will act basing on its current value.
38
- * @param options.usePreviousLanguageChoice If set on `true` and the `options.language` is not specified, the command
39
- * will apply the previous language (if the command was already executed) when inserting the `codeBlock` element.
40
- */
41
- execute(options?: {
42
- language?: string;
43
- forceValue?: boolean;
44
- usePreviousLanguageChoice?: boolean;
45
- }): void;
46
- /**
47
- * Checks the command's {@link #value}.
48
- *
49
- * @returns The current value.
50
- */
51
- private _getValue;
52
- /**
53
- * Checks whether the command can be enabled in the current context.
54
- *
55
- * @returns Whether the command should be enabled.
56
- */
57
- private _checkEnabled;
58
- private _applyCodeBlock;
59
- private _removeCodeBlock;
60
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import { Command, type Editor } from 'ckeditor5/src/core';
6
+ /**
7
+ * The code block command plugin.
8
+ */
9
+ export default class CodeBlockCommand extends Command {
10
+ /**
11
+ * Contains the last used language.
12
+ */
13
+ private _lastLanguage;
14
+ /**
15
+ * Contains language if any is selected, false otherwise.
16
+ * @observable
17
+ * @readonly
18
+ */
19
+ value: string | false;
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ constructor(editor: Editor);
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ refresh(): void;
28
+ /**
29
+ * Executes the command. When the command {@link #value is on}, all topmost code blocks within
30
+ * the selection will be removed. If it is off, all selected blocks will be flattened and
31
+ * wrapped by a code block.
32
+ *
33
+ * @fires execute
34
+ * @param options Command options.
35
+ * @param options.language The code block language.
36
+ * @param options.forceValue If set, it will force the command behavior. If `true`, the command will apply a code block,
37
+ * otherwise the command will remove the code block. If not set, the command will act basing on its current value.
38
+ * @param options.usePreviousLanguageChoice If set on `true` and the `options.language` is not specified, the command
39
+ * will apply the previous language (if the command was already executed) when inserting the `codeBlock` element.
40
+ */
41
+ execute(options?: {
42
+ language?: string;
43
+ forceValue?: boolean;
44
+ usePreviousLanguageChoice?: boolean;
45
+ }): void;
46
+ /**
47
+ * Checks the command's {@link #value}.
48
+ *
49
+ * @returns The current value.
50
+ */
51
+ private _getValue;
52
+ /**
53
+ * Checks whether the command can be enabled in the current context.
54
+ *
55
+ * @returns Whether the command should be enabled.
56
+ */
57
+ private _checkEnabled;
58
+ private _applyCodeBlock;
59
+ private _removeCodeBlock;
60
+ }