@ckeditor/ckeditor5-code-block 48.2.0 → 48.3.0-alpha.1
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/augmentation.d.ts +23 -23
- package/dist/codeblock.d.ts +28 -28
- package/dist/codeblockcommand.d.ts +56 -56
- package/dist/codeblockconfig.d.ts +142 -142
- package/dist/codeblockediting.d.ts +42 -42
- package/dist/codeblockui.d.ts +28 -28
- package/dist/converters.d.ts +119 -119
- package/dist/indentcodeblockcommand.d.ts +28 -28
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +15 -15
- package/dist/index.js +1140 -1426
- package/dist/index.js.map +1 -1
- package/dist/outdentcodeblockcommand.d.ts +29 -29
- package/dist/utils.d.ts +174 -174
- package/package.json +8 -8
package/dist/codeblockui.d.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin } from
|
|
9
|
-
import
|
|
6
|
+
* @module code-block/codeblockui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import "../theme/codeblock.css";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
* The code block UI plugin.
|
|
12
|
+
*
|
|
13
|
+
* Introduces the `'codeBlock'` dropdown.
|
|
14
|
+
*/
|
|
15
15
|
export declare class CodeBlockUI extends Plugin {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
static get pluginName(): "CodeBlockUI";
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
static override get isOfficialPlugin(): true;
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
init(): void;
|
|
28
|
+
/**
|
|
29
|
+
* A helper returning a collection of the `codeBlock` dropdown items representing languages
|
|
30
|
+
* available for the user to choose from.
|
|
31
|
+
*/
|
|
32
|
+
private _getLanguageListItemDefinitions;
|
|
33
33
|
}
|
package/dist/converters.d.ts
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import type { GetCallback } from
|
|
9
|
-
import type { DowncastInsertEvent, Model, UpcastElementEvent, UpcastTextEvent, EditingView } from
|
|
10
|
-
import type { CodeBlockLanguageDefinition } from
|
|
6
|
+
* @module code-block/converters
|
|
7
|
+
*/
|
|
8
|
+
import type { GetCallback } from "@ckeditor/ckeditor5-utils";
|
|
9
|
+
import type { DowncastInsertEvent, Model, UpcastElementEvent, UpcastTextEvent, EditingView } from "@ckeditor/ckeditor5-engine";
|
|
10
|
+
import type { CodeBlockLanguageDefinition } from "./codeblockconfig.js";
|
|
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
|
-
|
|
12
|
+
* A model-to-view (both editing and data) converter for the `codeBlock` element.
|
|
13
|
+
*
|
|
14
|
+
* Sample input:
|
|
15
|
+
*
|
|
16
|
+
* ```html
|
|
17
|
+
* <codeBlock language="javascript">foo();<softBreak></softBreak>bar();</codeBlock>
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* Sample output (editing):
|
|
21
|
+
*
|
|
22
|
+
* ```html
|
|
23
|
+
* <pre data-language="JavaScript"><code class="language-javascript">foo();<br />bar();</code></pre>
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Sample output (data, see {@link module:code-block/converters~modelToDataViewSoftBreakInsertion}):
|
|
27
|
+
*
|
|
28
|
+
* ```html
|
|
29
|
+
* <pre><code class="language-javascript">foo();\nbar();</code></pre>
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param languageDefs The normalized language configuration passed to the feature.
|
|
33
|
+
* @param useLabels When `true`, the `<pre>` element will get a `data-language` attribute with a
|
|
34
|
+
* human–readable label of the language. Used only in the editing.
|
|
35
|
+
* @returns Returns a conversion callback.
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
38
|
export declare function modelToViewCodeBlockInsertion(model: Model, languageDefs: Array<CodeBlockLanguageDefinition>, useLabels?: boolean): GetCallback<DowncastInsertEvent>;
|
|
39
39
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
40
|
+
* A model-to-data view converter for the new line (`softBreak`) separator.
|
|
41
|
+
*
|
|
42
|
+
* Sample input:
|
|
43
|
+
*
|
|
44
|
+
* ```html
|
|
45
|
+
* <codeBlock ...>foo();<softBreak></softBreak>bar();</codeBlock>
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* Sample output:
|
|
49
|
+
*
|
|
50
|
+
* ```html
|
|
51
|
+
* <pre><code ...>foo();\nbar();</code></pre>
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @returns Returns a conversion callback.
|
|
55
|
+
* @internal
|
|
56
|
+
*/
|
|
57
57
|
export declare function modelToDataViewSoftBreakInsertion(model: Model): GetCallback<DowncastInsertEvent>;
|
|
58
58
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
59
|
+
* A view-to-model converter for `<pre>` with the `<code>` HTML.
|
|
60
|
+
*
|
|
61
|
+
* Sample input:
|
|
62
|
+
*
|
|
63
|
+
* ```html
|
|
64
|
+
* <pre><code class="language-javascript">foo();bar();</code></pre>
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* Sample output:
|
|
68
|
+
*
|
|
69
|
+
* ```html
|
|
70
|
+
* <codeBlock language="javascript">foo();bar();</codeBlock>
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @param languageDefs The normalized language configuration passed to the feature.
|
|
74
|
+
* @returns Returns a conversion callback.
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
77
|
export declare function dataViewToModelCodeBlockInsertion(editingView: EditingView, languageDefs: Array<CodeBlockLanguageDefinition>): GetCallback<UpcastElementEvent>;
|
|
78
78
|
/**
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
79
|
+
* A view-to-model converter for new line characters in `<pre>`.
|
|
80
|
+
*
|
|
81
|
+
* Sample input:
|
|
82
|
+
*
|
|
83
|
+
* ```html
|
|
84
|
+
* <pre><code class="language-javascript">foo();\nbar();</code></pre>
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* Sample output:
|
|
88
|
+
*
|
|
89
|
+
* ```html
|
|
90
|
+
* <codeBlock language="javascript">foo();<softBreak></softBreak>bar();</codeBlock>
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @returns {Function} Returns a conversion callback.
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
96
|
export declare function dataViewToModelTextNewlinesInsertion(): GetCallback<UpcastTextEvent>;
|
|
97
97
|
/**
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
98
|
+
* A view-to-model converter that handles orphan text nodes (white spaces, new lines, etc.)
|
|
99
|
+
* that surround `<code>` inside `<pre>`.
|
|
100
|
+
*
|
|
101
|
+
* Sample input:
|
|
102
|
+
*
|
|
103
|
+
* ```html
|
|
104
|
+
* // White spaces
|
|
105
|
+
* <pre> <code>foo()</code> </pre>
|
|
106
|
+
*
|
|
107
|
+
* // White spaces
|
|
108
|
+
* <pre> <code>foo()</code> </pre>
|
|
109
|
+
*
|
|
110
|
+
* // White spaces
|
|
111
|
+
* <pre> <code>foo()</code> </pre>
|
|
112
|
+
*
|
|
113
|
+
* // New lines
|
|
114
|
+
* <pre>
|
|
115
|
+
* <code>foo()</code>
|
|
116
|
+
* </pre>
|
|
117
|
+
*
|
|
118
|
+
* // Redundant text
|
|
119
|
+
* <pre>ABC<code>foo()</code>DEF</pre>
|
|
120
|
+
* ```
|
|
121
|
+
*
|
|
122
|
+
* Unified output for each case:
|
|
123
|
+
*
|
|
124
|
+
* ```html
|
|
125
|
+
* <codeBlock language="plaintext">foo()</codeBlock>
|
|
126
|
+
* ```
|
|
127
|
+
*
|
|
128
|
+
* @returns Returns a conversion callback.
|
|
129
|
+
* @internal
|
|
130
|
+
*/
|
|
131
131
|
export declare function dataViewToModelOrphanNodeConsumer(): GetCallback<UpcastElementEvent>;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { Command, type Editor } from
|
|
6
|
+
* @module code-block/indentcodeblockcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from "@ckeditor/ckeditor5-core";
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* The code block indentation increase command plugin.
|
|
11
|
+
*/
|
|
12
12
|
export declare class IndentCodeBlockCommand extends Command {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
/**
|
|
14
|
+
* A sequence of characters added to the line when the command is executed.
|
|
15
|
+
*/
|
|
16
|
+
private _indentSequence;
|
|
17
|
+
constructor(editor: Editor);
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
override refresh(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Executes the command. When the command {@link #isEnabled is enabled}, the indentation of the
|
|
24
|
+
* code lines in the selection will be increased.
|
|
25
|
+
*
|
|
26
|
+
* @fires execute
|
|
27
|
+
*/
|
|
28
|
+
override execute(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Checks whether the command can be enabled in the current context.
|
|
31
|
+
*/
|
|
32
|
+
private _checkEnabled;
|
|
33
33
|
}
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../theme/codeblock.css","index.css"],"names":[],"mappings":";;;;AAKA,CAAA,IAAA,CAAA;ACJA,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM;AACjD;;ADOA,CAAA,EAAA,CAAA,EAAA,CAAA,gBAAA,CAAA,GAAA,CAAA,IAAA,CAAA,QAAA,CAAA,CAAA,KAAA,CAAA;ACJA,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC9B,CAAC,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC;AACzD,CAAC,CAA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,KAAK,CAAC,CAAC,MAAM;AAC3B,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG;AACpB,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK;AAClB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAChB,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG;AACd,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM;AACpB;;ADmBC,CAAA,EAAA,CAAA,OAAA,CAAA,GAAA,CAAA,IAAA,CAAA;AChBD,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK;AACnB,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AACZ;;ADoBA,CAAA,EAAA,CAAA,EAAA,CAAA,gBAAA,CAAA,GAAA,CAAA;ACjBA,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ;AACpB;;AAEA,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC","file":"index.css.map","sourcesContent":["/*\n * Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n:root {\n\t--ck-color-code-block-label-background: hsl(0, 0%, 46%);\n}\n\n.ck.ck-editor__editable pre[data-language]::after {\n\tcontent: attr(data-language);\n\tposition: absolute;\n\ttop: -1px;\n\tright: 10px;\n\tbackground: var(--ck-color-code-block-label-background);\n\n\tfont-size: 10px;\n\tfont-family: var(--ck-font-face);\n\tline-height: 16px;\n\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-medium);\n\tcolor: hsl(0, 0%, 100%);\n\twhite-space: nowrap;\n}\n\n.ck.ck-code-block-dropdown .ck-dropdown__panel {\n\t/* There could be dozens of languages available. Use scroll to prevent a 10e6px dropdown. */\n\tmax-height: 250px;\n\toverflow-y: auto;\n\toverflow-x: hidden;\n}\n\n.ck-content pre {\n\tpadding: 1em;\n\tcolor: hsl(0, 0%, 20.8%);\n\tbackground: hsla(0, 0%, 78%, 0.3);\n\tborder: 1px solid hsl(0, 0%, 77%);\n\tborder-radius: 2px;\n\n\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\n\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\n\tmargin: 0.9em 0;\n\n\t/* Code block are language direction–agnostic. */\n\ttext-align: left;\n\tdirection: ltr;\n\n\ttab-size: 4;\n\twhite-space: pre-wrap;\n\n\t/* Don't inherit the style, e.g. when in a block quote. */\n\tfont-style: normal;\n\n\t/* Don't let the code be squashed e.g. when in a table cell. */\n\tmin-width: 200px;\n\n\t& code {\n\t\tbackground: unset;\n\t\tpadding: 0;\n\t\tborder-radius: 0;\n\t}\n}\n\n.ck.ck-editor__editable pre {\n\tposition: relative;\n}\n",":root {\n --ck-color-code-block-label-background: #757575;\n}\n\n.ck.ck-editor__editable pre[data-language]:after {\n content: attr(data-language);\n background: var(--ck-color-code-block-label-background);\n font-size: 10px;\n font-family: var(--ck-font-face);\n padding: var(--ck-spacing-tiny) var(--ck-spacing-medium);\n color: #fff;\n white-space: nowrap;\n line-height: 16px;\n position: absolute;\n top: -1px;\n right: 10px;\n}\n\n.ck.ck-code-block-dropdown .ck-dropdown__panel {\n max-height: 250px;\n overflow: hidden auto;\n}\n\n.ck-content pre {\n color: #353535;\n text-align: left;\n tab-size: 4;\n white-space: pre-wrap;\n direction: ltr;\n background: #c7c7c74d;\n border: 1px solid #c4c4c4;\n border-radius: 2px;\n min-width: 200px;\n margin: .9em 0;\n padding: 1em;\n font-style: normal;\n}\n\n.ck-content pre code {\n background: unset;\n border-radius: 0;\n padding: 0;\n}\n\n.ck.ck-editor__editable pre {\n position: relative;\n}\n\n/*# sourceMappingURL=index.css.map */"]}
|
|
1
|
+
{"version":3,"sources":["../theme/codeblock.css","index.css"],"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right (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n:root {\n\t--ck-color-code-block-label-background: hsl(0, 0%, 46%);\n}\n\n.ck.ck-editor__editable pre[data-language]::after {\n\tcontent: attr(data-language);\n\tposition: absolute;\n\ttop: -1px;\n\tright: 10px;\n\tbackground: var(--ck-color-code-block-label-background);\n\n\tfont-size: 10px;\n\tfont-family: var(--ck-font-face);\n\tline-height: 16px;\n\tpadding: var(--ck-spacing-tiny) var(--ck-spacing-medium);\n\tcolor: hsl(0, 0%, 100%);\n\twhite-space: nowrap;\n}\n\n.ck.ck-code-block-dropdown .ck-dropdown__panel {\n\t/* There could be dozens of languages available. Use scroll to prevent a 10e6px dropdown. */\n\tmax-height: 250px;\n\toverflow-y: auto;\n\toverflow-x: hidden;\n}\n\n.ck-content pre {\n\tpadding: 1em;\n\tcolor: hsl(0, 0%, 20.8%);\n\tbackground: hsla(0, 0%, 78%, 0.3);\n\tborder: 1px solid hsl(0, 0%, 77%);\n\tborder-radius: 2px;\n\n\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\n\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\n\tmargin: 0.9em 0;\n\n\t/* Code block are language direction–agnostic. */\n\ttext-align: left;\n\tdirection: ltr;\n\n\ttab-size: 4;\n\twhite-space: pre-wrap;\n\n\t/* Don't inherit the style, e.g. when in a block quote. */\n\tfont-style: normal;\n\n\t/* Don't let the code be squashed e.g. when in a table cell. */\n\tmin-width: 200px;\n\n\t& code {\n\t\tbackground: unset;\n\t\tpadding: 0;\n\t\tborder-radius: 0;\n\t}\n}\n\n.ck.ck-editor__editable pre {\n\tposition: relative;\n}\n",":root {\n --ck-color-code-block-label-background: #757575;\n}\n\n.ck.ck-editor__editable pre[data-language]:after {\n content: attr(data-language);\n background: var(--ck-color-code-block-label-background);\n font-size: 10px;\n font-family: var(--ck-font-face);\n padding: var(--ck-spacing-tiny) var(--ck-spacing-medium);\n color: #fff;\n white-space: nowrap;\n line-height: 16px;\n position: absolute;\n top: -1px;\n right: 10px;\n}\n\n.ck.ck-code-block-dropdown .ck-dropdown__panel {\n max-height: 250px;\n overflow: hidden auto;\n}\n\n.ck-content pre {\n color: #353535;\n text-align: left;\n tab-size: 4;\n white-space: pre-wrap;\n direction: ltr;\n background: #c7c7c74d;\n border: 1px solid #c4c4c4;\n border-radius: 2px;\n min-width: 200px;\n margin: .9em 0;\n padding: 1em;\n font-style: normal;\n}\n\n.ck-content pre code {\n background: unset;\n border-radius: 0;\n padding: 0;\n}\n\n.ck.ck-editor__editable pre {\n position: relative;\n}\n\n/*# sourceMappingURL=index.css.map */"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export { CodeBlock } from
|
|
9
|
-
export { CodeBlockEditing } from
|
|
10
|
-
export { CodeBlockUI } from
|
|
11
|
-
export { CodeBlockCommand } from
|
|
12
|
-
export { IndentCodeBlockCommand } from
|
|
13
|
-
export { OutdentCodeBlockCommand } from
|
|
14
|
-
export type { CodeBlockConfig, CodeBlockLanguageDefinition } from
|
|
15
|
-
export { modelToViewCodeBlockInsertion as _modelToViewCodeBlockInsertion, modelToDataViewSoftBreakInsertion as _modelToDataViewCodeBlockSoftBreakInsertion, dataViewToModelCodeBlockInsertion as _dataViewToModelCodeBlockInsertion, dataViewToModelTextNewlinesInsertion as _dataViewToModelCodeBlockTextNewlinesInsertion, dataViewToModelOrphanNodeConsumer as _dataViewToModelCodeBlockOrphanNodeConsumer } from
|
|
16
|
-
export { getNormalizedAndLocalizedLanguageDefinitions as _getNormalizedAndLocalizedCodeBlockLanguageDefinitions, getPropertyAssociation as _getCodeBlockPropertyAssociation, getLeadingWhiteSpaces as _getCodeBlockLeadingWhiteSpaces, rawSnippetTextToViewDocumentFragment as _rawCodeBlockSnippetTextToViewDocumentFragment, getIndentOutdentPositions as _getCodeBlockIndentOutdentPositions, isModelSelectionInCodeBlock as _isModelSelectionInCodeBlock, canBeCodeBlock as _canBeCodeBlock, getCodeBlockAriaAnnouncement as _getCodeBlockAriaAnnouncement, getTextNodeAtLineStart as _getCodeBlockTextNodeAtLineStart } from
|
|
17
|
-
import
|
|
6
|
+
* @module code-block
|
|
7
|
+
*/
|
|
8
|
+
export { CodeBlock } from "./codeblock.js";
|
|
9
|
+
export { CodeBlockEditing } from "./codeblockediting.js";
|
|
10
|
+
export { CodeBlockUI } from "./codeblockui.js";
|
|
11
|
+
export { CodeBlockCommand } from "./codeblockcommand.js";
|
|
12
|
+
export { IndentCodeBlockCommand } from "./indentcodeblockcommand.js";
|
|
13
|
+
export { OutdentCodeBlockCommand } from "./outdentcodeblockcommand.js";
|
|
14
|
+
export type { CodeBlockConfig, CodeBlockLanguageDefinition } from "./codeblockconfig.js";
|
|
15
|
+
export { modelToViewCodeBlockInsertion as _modelToViewCodeBlockInsertion, modelToDataViewSoftBreakInsertion as _modelToDataViewCodeBlockSoftBreakInsertion, dataViewToModelCodeBlockInsertion as _dataViewToModelCodeBlockInsertion, dataViewToModelTextNewlinesInsertion as _dataViewToModelCodeBlockTextNewlinesInsertion, dataViewToModelOrphanNodeConsumer as _dataViewToModelCodeBlockOrphanNodeConsumer } from "./converters.js";
|
|
16
|
+
export { getNormalizedAndLocalizedLanguageDefinitions as _getNormalizedAndLocalizedCodeBlockLanguageDefinitions, getPropertyAssociation as _getCodeBlockPropertyAssociation, getLeadingWhiteSpaces as _getCodeBlockLeadingWhiteSpaces, rawSnippetTextToViewDocumentFragment as _rawCodeBlockSnippetTextToViewDocumentFragment, getIndentOutdentPositions as _getCodeBlockIndentOutdentPositions, isModelSelectionInCodeBlock as _isModelSelectionInCodeBlock, canBeCodeBlock as _canBeCodeBlock, getCodeBlockAriaAnnouncement as _getCodeBlockAriaAnnouncement, getTextNodeAtLineStart as _getCodeBlockTextNodeAtLineStart } from "./utils.js";
|
|
17
|
+
import "./augmentation.js";
|