@ckeditor/ckeditor5-code-block 48.8.1-alpha.4 → 49.0.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 +27 -28
- package/dist/converters.d.ts +119 -119
- package/dist/indentcodeblockcommand.d.ts +28 -28
- package/dist/index-content.css +20 -18
- package/dist/index-content.css.map +1 -0
- package/dist/index-editor.css +23 -20
- package/dist/index-editor.css.map +1 -0
- package/dist/index.css +14 -13
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +17 -15
- package/dist/index.js +1141 -1426
- package/dist/index.js.map +1 -1
- package/dist/outdentcodeblockcommand.d.ts +29 -29
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +5 -3
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +5 -3
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +5 -3
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +5 -3
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +5 -3
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +5 -3
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +5 -3
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +5 -3
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +5 -3
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +5 -3
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +5 -3
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +5 -3
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +5 -3
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +5 -3
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +5 -3
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +5 -3
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +5 -3
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +5 -3
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +5 -3
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +5 -3
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +5 -3
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +5 -3
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +5 -3
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +5 -3
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +5 -3
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +5 -3
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +5 -3
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +5 -3
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +5 -3
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +5 -3
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +5 -3
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +5 -3
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +5 -3
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +5 -3
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +5 -3
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +5 -3
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +5 -3
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +5 -3
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +5 -3
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +5 -3
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +5 -3
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +5 -3
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +5 -3
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +5 -3
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +5 -3
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +5 -3
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +5 -3
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +5 -3
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +5 -3
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +5 -3
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +5 -3
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +5 -3
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +5 -3
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +5 -3
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +5 -3
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +5 -3
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +5 -3
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +5 -3
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +5 -3
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +5 -3
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +5 -3
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +5 -3
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +5 -3
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +5 -3
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +5 -3
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +5 -3
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +5 -3
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +5 -3
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +5 -3
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +5 -3
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +5 -3
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +5 -3
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +5 -3
- package/dist/utils.d.ts +174 -174
- package/package.json +8 -8
package/dist/translations/ug.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
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
|
-
export default {"ug":{"dictionary":{"Insert code block":"كود بۆلىكى قىستۇر","Plain text":"ساپ تېكىست","Leaving %0 code snippet":"","Entering %0 code snippet":"","Entering code snippet":"","Leaving code snippet":"","Code block":""}
|
|
5
|
+
export default {"ug":{"dictionary":{"Insert code block":"كود بۆلىكى قىستۇر","Plain text":"ساپ تېكىست","Leaving %0 code snippet":"","Entering %0 code snippet":"","Entering code snippet":"","Leaving code snippet":"","Code block":""}}}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
( e => {
|
|
7
|
-
const { [ 'ug' ]:
|
|
7
|
+
const { [ 'ug' ]: translations } = {"ug":{"dictionary":{"Insert code block":"كود بۆلىكى قىستۇر","Plain text":"ساپ تېكىست","Leaving %0 code snippet":"","Entering %0 code snippet":"","Entering code snippet":"","Leaving code snippet":"","Code block":""}}};
|
|
8
8
|
e[ 'ug' ] ||= { dictionary: {}, getPluralForm: null };
|
|
9
|
-
e[ 'ug' ].dictionary = Object.assign( e[ 'ug' ].dictionary, dictionary );
|
|
10
|
-
|
|
9
|
+
e[ 'ug' ].dictionary = Object.assign( e[ 'ug' ].dictionary, translations.dictionary );
|
|
10
|
+
if ( translations.getPluralForm ) {
|
|
11
|
+
e[ 'ug' ].getPluralForm = translations.getPluralForm;
|
|
12
|
+
}
|
|
11
13
|
} )( window.CKEDITOR_TRANSLATIONS ||= {} );
|
package/dist/translations/uk.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
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
|
-
export default {"uk":{"dictionary":{"Insert code block":"Вставте блок коду","Plain text":"Простий текст","Leaving %0 code snippet":"Вихід з фрагменту коду %0","Entering %0 code snippet":"Вхід у фрагмент коду %0","Entering code snippet":"Вхід у фрагмент коду","Leaving code snippet":"Вихід з фрагменту коду","Code block":"Блок коду"}
|
|
5
|
+
export default {"uk":{"dictionary":{"Insert code block":"Вставте блок коду","Plain text":"Простий текст","Leaving %0 code snippet":"Вихід з фрагменту коду %0","Entering %0 code snippet":"Вхід у фрагмент коду %0","Entering code snippet":"Вхід у фрагмент коду","Leaving code snippet":"Вихід з фрагменту коду","Code block":"Блок коду"}}}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
( e => {
|
|
7
|
-
const { [ 'uk' ]:
|
|
7
|
+
const { [ 'uk' ]: translations } = {"uk":{"dictionary":{"Insert code block":"Вставте блок коду","Plain text":"Простий текст","Leaving %0 code snippet":"Вихід з фрагменту коду %0","Entering %0 code snippet":"Вхід у фрагмент коду %0","Entering code snippet":"Вхід у фрагмент коду","Leaving code snippet":"Вихід з фрагменту коду","Code block":"Блок коду"}}};
|
|
8
8
|
e[ 'uk' ] ||= { dictionary: {}, getPluralForm: null };
|
|
9
|
-
e[ 'uk' ].dictionary = Object.assign( e[ 'uk' ].dictionary, dictionary );
|
|
10
|
-
|
|
9
|
+
e[ 'uk' ].dictionary = Object.assign( e[ 'uk' ].dictionary, translations.dictionary );
|
|
10
|
+
if ( translations.getPluralForm ) {
|
|
11
|
+
e[ 'uk' ].getPluralForm = translations.getPluralForm;
|
|
12
|
+
}
|
|
11
13
|
} )( window.CKEDITOR_TRANSLATIONS ||= {} );
|
package/dist/translations/ur.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
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
|
-
export default {"ur":{"dictionary":{"Insert code block":"کوڈ خانہ نصب کیرں","Plain text":"سادہ متن","Leaving %0 code snippet":"","Entering %0 code snippet":"","Entering code snippet":"","Leaving code snippet":"","Code block":""}
|
|
5
|
+
export default {"ur":{"dictionary":{"Insert code block":"کوڈ خانہ نصب کیرں","Plain text":"سادہ متن","Leaving %0 code snippet":"","Entering %0 code snippet":"","Entering code snippet":"","Leaving code snippet":"","Code block":""}}}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
( e => {
|
|
7
|
-
const { [ 'ur' ]:
|
|
7
|
+
const { [ 'ur' ]: translations } = {"ur":{"dictionary":{"Insert code block":"کوڈ خانہ نصب کیرں","Plain text":"سادہ متن","Leaving %0 code snippet":"","Entering %0 code snippet":"","Entering code snippet":"","Leaving code snippet":"","Code block":""}}};
|
|
8
8
|
e[ 'ur' ] ||= { dictionary: {}, getPluralForm: null };
|
|
9
|
-
e[ 'ur' ].dictionary = Object.assign( e[ 'ur' ].dictionary, dictionary );
|
|
10
|
-
|
|
9
|
+
e[ 'ur' ].dictionary = Object.assign( e[ 'ur' ].dictionary, translations.dictionary );
|
|
10
|
+
if ( translations.getPluralForm ) {
|
|
11
|
+
e[ 'ur' ].getPluralForm = translations.getPluralForm;
|
|
12
|
+
}
|
|
11
13
|
} )( window.CKEDITOR_TRANSLATIONS ||= {} );
|
package/dist/translations/uz.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
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
|
-
export default {"uz":{"dictionary":{"Insert code block":"Kodni kiritish","Plain text":"Oddiy matn","Leaving %0 code snippet":"","Entering %0 code snippet":"","Entering code snippet":"","Leaving code snippet":"","Code block":""}
|
|
5
|
+
export default {"uz":{"dictionary":{"Insert code block":"Kodni kiritish","Plain text":"Oddiy matn","Leaving %0 code snippet":"","Entering %0 code snippet":"","Entering code snippet":"","Leaving code snippet":"","Code block":""}}}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
( e => {
|
|
7
|
-
const { [ 'uz' ]:
|
|
7
|
+
const { [ 'uz' ]: translations } = {"uz":{"dictionary":{"Insert code block":"Kodni kiritish","Plain text":"Oddiy matn","Leaving %0 code snippet":"","Entering %0 code snippet":"","Entering code snippet":"","Leaving code snippet":"","Code block":""}}};
|
|
8
8
|
e[ 'uz' ] ||= { dictionary: {}, getPluralForm: null };
|
|
9
|
-
e[ 'uz' ].dictionary = Object.assign( e[ 'uz' ].dictionary, dictionary );
|
|
10
|
-
|
|
9
|
+
e[ 'uz' ].dictionary = Object.assign( e[ 'uz' ].dictionary, translations.dictionary );
|
|
10
|
+
if ( translations.getPluralForm ) {
|
|
11
|
+
e[ 'uz' ].getPluralForm = translations.getPluralForm;
|
|
12
|
+
}
|
|
11
13
|
} )( window.CKEDITOR_TRANSLATIONS ||= {} );
|
package/dist/translations/vi.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
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
|
-
export default {"vi":{"dictionary":{"Insert code block":"Chèn khối mã","Plain text":"Văn bản thuần","Leaving %0 code snippet":"Đang rời khỏi đoạn mã snippet %0","Entering %0 code snippet":"Đang nhập đoạn mã snippet %0","Entering code snippet":"Đang nhập đoạn mã snippet","Leaving code snippet":"Đang rời khỏi đoạn mã snippet","Code block":"Khối mã"}
|
|
5
|
+
export default {"vi":{"dictionary":{"Insert code block":"Chèn khối mã","Plain text":"Văn bản thuần","Leaving %0 code snippet":"Đang rời khỏi đoạn mã snippet %0","Entering %0 code snippet":"Đang nhập đoạn mã snippet %0","Entering code snippet":"Đang nhập đoạn mã snippet","Leaving code snippet":"Đang rời khỏi đoạn mã snippet","Code block":"Khối mã"}}}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
( e => {
|
|
7
|
-
const { [ 'vi' ]:
|
|
7
|
+
const { [ 'vi' ]: translations } = {"vi":{"dictionary":{"Insert code block":"Chèn khối mã","Plain text":"Văn bản thuần","Leaving %0 code snippet":"Đang rời khỏi đoạn mã snippet %0","Entering %0 code snippet":"Đang nhập đoạn mã snippet %0","Entering code snippet":"Đang nhập đoạn mã snippet","Leaving code snippet":"Đang rời khỏi đoạn mã snippet","Code block":"Khối mã"}}};
|
|
8
8
|
e[ 'vi' ] ||= { dictionary: {}, getPluralForm: null };
|
|
9
|
-
e[ 'vi' ].dictionary = Object.assign( e[ 'vi' ].dictionary, dictionary );
|
|
10
|
-
|
|
9
|
+
e[ 'vi' ].dictionary = Object.assign( e[ 'vi' ].dictionary, translations.dictionary );
|
|
10
|
+
if ( translations.getPluralForm ) {
|
|
11
|
+
e[ 'vi' ].getPluralForm = translations.getPluralForm;
|
|
12
|
+
}
|
|
11
13
|
} )( window.CKEDITOR_TRANSLATIONS ||= {} );
|
|
@@ -2,4 +2,4 @@
|
|
|
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
|
-
export default {"zh-cn":{"dictionary":{"Insert code block":"插入代码块","Plain text":"纯文本","Leaving %0 code snippet":"正在退出 %0 代码片段","Entering %0 code snippet":"正在输入 %0 代码片段","Entering code snippet":"正在输入代码片段","Leaving code snippet":"正在退出代码片段","Code block":"代码块"}
|
|
5
|
+
export default {"zh-cn":{"dictionary":{"Insert code block":"插入代码块","Plain text":"纯文本","Leaving %0 code snippet":"正在退出 %0 代码片段","Entering %0 code snippet":"正在输入 %0 代码片段","Entering code snippet":"正在输入代码片段","Leaving code snippet":"正在退出代码片段","Code block":"代码块"}}}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
( e => {
|
|
7
|
-
const { [ 'zh-cn' ]:
|
|
7
|
+
const { [ 'zh-cn' ]: translations } = {"zh-cn":{"dictionary":{"Insert code block":"插入代码块","Plain text":"纯文本","Leaving %0 code snippet":"正在退出 %0 代码片段","Entering %0 code snippet":"正在输入 %0 代码片段","Entering code snippet":"正在输入代码片段","Leaving code snippet":"正在退出代码片段","Code block":"代码块"}}};
|
|
8
8
|
e[ 'zh-cn' ] ||= { dictionary: {}, getPluralForm: null };
|
|
9
|
-
e[ 'zh-cn' ].dictionary = Object.assign( e[ 'zh-cn' ].dictionary, dictionary );
|
|
10
|
-
|
|
9
|
+
e[ 'zh-cn' ].dictionary = Object.assign( e[ 'zh-cn' ].dictionary, translations.dictionary );
|
|
10
|
+
if ( translations.getPluralForm ) {
|
|
11
|
+
e[ 'zh-cn' ].getPluralForm = translations.getPluralForm;
|
|
12
|
+
}
|
|
11
13
|
} )( window.CKEDITOR_TRANSLATIONS ||= {} );
|
package/dist/translations/zh.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
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
|
-
export default {"zh":{"dictionary":{"Insert code block":"插入程式碼區塊","Plain text":"純文字","Leaving %0 code snippet":"離開 %0 程式碼片段","Entering %0 code snippet":"進入 %0 程式碼片段","Entering code snippet":"進入程式碼片段","Leaving code snippet":"離開程式碼片段","Code block":"程式碼區塊"}
|
|
5
|
+
export default {"zh":{"dictionary":{"Insert code block":"插入程式碼區塊","Plain text":"純文字","Leaving %0 code snippet":"離開 %0 程式碼片段","Entering %0 code snippet":"進入 %0 程式碼片段","Entering code snippet":"進入程式碼片段","Leaving code snippet":"離開程式碼片段","Code block":"程式碼區塊"}}}
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
( e => {
|
|
7
|
-
const { [ 'zh' ]:
|
|
7
|
+
const { [ 'zh' ]: translations } = {"zh":{"dictionary":{"Insert code block":"插入程式碼區塊","Plain text":"純文字","Leaving %0 code snippet":"離開 %0 程式碼片段","Entering %0 code snippet":"進入 %0 程式碼片段","Entering code snippet":"進入程式碼片段","Leaving code snippet":"離開程式碼片段","Code block":"程式碼區塊"}}};
|
|
8
8
|
e[ 'zh' ] ||= { dictionary: {}, getPluralForm: null };
|
|
9
|
-
e[ 'zh' ].dictionary = Object.assign( e[ 'zh' ].dictionary, dictionary );
|
|
10
|
-
|
|
9
|
+
e[ 'zh' ].dictionary = Object.assign( e[ 'zh' ].dictionary, translations.dictionary );
|
|
10
|
+
if ( translations.getPluralForm ) {
|
|
11
|
+
e[ 'zh' ].getPluralForm = translations.getPluralForm;
|
|
12
|
+
}
|
|
11
13
|
} )( window.CKEDITOR_TRANSLATIONS ||= {} );
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,193 +1,193 @@
|
|
|
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 { Editor } from
|
|
9
|
-
import type { CodeBlockLanguageDefinition } from
|
|
10
|
-
import type { ModelDocumentSelection, ModelElement, Model, ModelPosition, ModelSchema, ModelText, ViewUpcastWriter, ViewDocumentFragment } from
|
|
11
|
-
import { type LocaleTranslate } from
|
|
6
|
+
* @module code-block/utils
|
|
7
|
+
*/
|
|
8
|
+
import type { Editor } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import type { CodeBlockLanguageDefinition } from "./codeblockconfig.js";
|
|
10
|
+
import type { ModelDocumentSelection, ModelElement, Model, ModelPosition, ModelSchema, ModelText, ViewUpcastWriter, ViewDocumentFragment } from "@ckeditor/ckeditor5-engine";
|
|
11
|
+
import { type LocaleTranslate } from "@ckeditor/ckeditor5-utils";
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
* Returns code block languages as defined in `config.codeBlock.languages` but processed:
|
|
14
|
+
*
|
|
15
|
+
* * To consider the editor localization, i.e. to display {@link module:code-block/codeblockconfig~CodeBlockLanguageDefinition}
|
|
16
|
+
* in the correct language. There is no way to use {@link module:utils/locale~Locale#t} when the user
|
|
17
|
+
* configuration is defined because the editor does not exist yet.
|
|
18
|
+
* * To make sure each definition has a CSS class associated with it even if not specified
|
|
19
|
+
* in the original configuration.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
23
|
export declare function getNormalizedAndLocalizedLanguageDefinitions(editor: Editor): Array<CodeBlockLanguageDefinition>;
|
|
24
24
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
25
|
+
* Returns an object associating certain language definition properties with others. For instance:
|
|
26
|
+
*
|
|
27
|
+
* For:
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* const definitions = {
|
|
31
|
+
* { language: 'php', class: 'language-php', label: 'PHP' },
|
|
32
|
+
* { language: 'javascript', class: 'js', label: 'JavaScript' },
|
|
33
|
+
* };
|
|
34
|
+
*
|
|
35
|
+
* getPropertyAssociation( definitions, 'class', 'language' );
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* returns:
|
|
39
|
+
*
|
|
40
|
+
* ```ts
|
|
41
|
+
* {
|
|
42
|
+
* 'language-php': 'php',
|
|
43
|
+
* 'js': 'javascript'
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* and
|
|
48
|
+
*
|
|
49
|
+
* ```ts
|
|
50
|
+
* getPropertyAssociation( definitions, 'language', 'label' );
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* returns:
|
|
54
|
+
*
|
|
55
|
+
* ```ts
|
|
56
|
+
* {
|
|
57
|
+
* 'php': 'PHP',
|
|
58
|
+
* 'javascript': 'JavaScript'
|
|
59
|
+
* }
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
64
|
export declare function getPropertyAssociation(languageDefs: Array<CodeBlockLanguageDefinition>, key: keyof CodeBlockLanguageDefinition, value: keyof CodeBlockLanguageDefinition): Record<string, string>;
|
|
65
65
|
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
* For a given model text node, it returns white spaces that precede other characters in that node.
|
|
67
|
+
* This corresponds to the indentation part of the code block line.
|
|
68
|
+
*
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
71
|
export declare function getLeadingWhiteSpaces(textNode: ModelText): string;
|
|
72
72
|
/**
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
73
|
+
* For plain text containing the code (a snippet), it returns a document fragment containing
|
|
74
|
+
* view text nodes separated by `<br>` elements (in place of new line characters "\n"), for instance:
|
|
75
|
+
*
|
|
76
|
+
* Input:
|
|
77
|
+
*
|
|
78
|
+
* ```ts
|
|
79
|
+
* "foo()\n
|
|
80
|
+
* bar()"
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* Output:
|
|
84
|
+
*
|
|
85
|
+
* ```html
|
|
86
|
+
* <DocumentFragment>
|
|
87
|
+
* "foo()"
|
|
88
|
+
* <br/>
|
|
89
|
+
* "bar()"
|
|
90
|
+
* </DocumentFragment>
|
|
91
|
+
* ```
|
|
92
|
+
*
|
|
93
|
+
* @param text The raw code text to be converted.
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
96
96
|
export declare function rawSnippetTextToViewDocumentFragment(writer: ViewUpcastWriter, text: string): ViewDocumentFragment;
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
98
|
+
* Returns an array of all model positions within the selection that represent code block lines.
|
|
99
|
+
*
|
|
100
|
+
* If the selection is collapsed, it returns the exact selection anchor position:
|
|
101
|
+
*
|
|
102
|
+
* ```html
|
|
103
|
+
* <codeBlock>[]foo</codeBlock> -> <codeBlock>^foo</codeBlock>
|
|
104
|
+
* <codeBlock>foo[]bar</codeBlock> -> <codeBlock>foo^bar</codeBlock>
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* Otherwise, it returns positions **before** each text node belonging to all code blocks contained by the selection:
|
|
108
|
+
*
|
|
109
|
+
* ```html
|
|
110
|
+
* <codeBlock> <codeBlock>
|
|
111
|
+
* foo[bar ^foobar
|
|
112
|
+
* <softBreak></softBreak> -> <softBreak></softBreak>
|
|
113
|
+
* baz]qux ^bazqux
|
|
114
|
+
* </codeBlock> </codeBlock>
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* It also works across other non–code blocks:
|
|
118
|
+
*
|
|
119
|
+
* ```html
|
|
120
|
+
* <codeBlock> <codeBlock>
|
|
121
|
+
* foo[bar ^foobar
|
|
122
|
+
* </codeBlock> </codeBlock>
|
|
123
|
+
* <paragraph>text</paragraph> -> <paragraph>text</paragraph>
|
|
124
|
+
* <codeBlock> <codeBlock>
|
|
125
|
+
* baz]qux ^bazqux
|
|
126
|
+
* </codeBlock> </codeBlock>
|
|
127
|
+
* ```
|
|
128
|
+
*
|
|
129
|
+
* **Note:** The positions are in reverse order so they do not get outdated when iterating over them and
|
|
130
|
+
* the writer inserts or removes elements at the same time.
|
|
131
|
+
*
|
|
132
|
+
* **Note:** The position is located after the leading white spaces in the text node.
|
|
133
|
+
*
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
136
|
export declare function getIndentOutdentPositions(model: Model): Array<ModelPosition>;
|
|
137
137
|
/**
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
138
|
+
* Checks if any of the blocks within the model selection is a code block.
|
|
139
|
+
*
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
142
|
export declare function isModelSelectionInCodeBlock(selection: ModelDocumentSelection): boolean;
|
|
143
143
|
/**
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
144
|
+
* Checks if an {@link module:engine/model/element~ModelElement Element} can become a code block.
|
|
145
|
+
*
|
|
146
|
+
* @param schema Model's schema.
|
|
147
|
+
* @param element The element to be checked.
|
|
148
|
+
* @returns Check result.
|
|
149
|
+
* @internal
|
|
150
|
+
*/
|
|
151
151
|
export declare function canBeCodeBlock(schema: ModelSchema, element: ModelElement): boolean;
|
|
152
152
|
/**
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
export declare function getCodeBlockAriaAnnouncement(t: LocaleTranslate, languageDefs: Array<CodeBlockLanguageDefinition>, element: ModelElement, direction:
|
|
153
|
+
* Get the translated message read by the screen reader when you enter or exit an element with your cursor.
|
|
154
|
+
*
|
|
155
|
+
* @internal
|
|
156
|
+
*/
|
|
157
|
+
export declare function getCodeBlockAriaAnnouncement(t: LocaleTranslate, languageDefs: Array<CodeBlockLanguageDefinition>, element: ModelElement, direction: "enter" | "leave"): string;
|
|
158
158
|
/**
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
159
|
+
* For given position, finds the closest position that is at the beginning of a line of code and returns a text node that is at the
|
|
160
|
+
* beginning of the line (or `null` if there's no text node at the beginning of a given line).
|
|
161
|
+
*
|
|
162
|
+
* Line beings at the start of a code block element and after each `softBreak` element.
|
|
163
|
+
*
|
|
164
|
+
* Note: even though code block doesn't allow inline elements other than `<softBreak>` by default, some features may overwrite this rule,
|
|
165
|
+
* so such inline elements are taken into account.
|
|
166
|
+
*
|
|
167
|
+
* Some examples of expected results:
|
|
168
|
+
*
|
|
169
|
+
* ```
|
|
170
|
+
* <codeBlock>^</codeBlock> -> null
|
|
171
|
+
* <codeBlock>^foobar</codeBlock> -> <codeBlock>[foobar]</codeBlock>
|
|
172
|
+
* <codeBlock>foobar^</codeBlock> -> <codeBlock>[foobar]</codeBlock>
|
|
173
|
+
* <codeBlock>foo^bar</codeBlock> -> <codeBlock>[foobar]</codeBlock>
|
|
174
|
+
* <codeBlock>foo^<softBreak />bar</codeBlock> -> <codeBlock>[foo]<softBreak />bar</codeBlock>
|
|
175
|
+
* <codeBlock>foo<softBreak />bar^</codeBlock> -> <codeBlock>foo<softBreak />[bar]</codeBlock>
|
|
176
|
+
* <codeBlock>foo<softBreak />b^ar</codeBlock> -> <codeBlock>foo<softBreak />[bar]</codeBlock>
|
|
177
|
+
* <codeBlock>foo<softBreak />^bar</codeBlock> -> <codeBlock>foo<softBreak />[bar]</codeBlock>
|
|
178
|
+
* <codeBlock>^<element /></codeBlock> -> null
|
|
179
|
+
* <codeBlock><element />^</codeBlock> -> null
|
|
180
|
+
* <codeBlock>foo^<element /></codeBlock> -> <codeBlock>[foo]<element /></codeBlock>
|
|
181
|
+
* <codeBlock>foo<element />^</codeBlock> -> <codeBlock>[foo]<element /></codeBlock>
|
|
182
|
+
* <codeBlock>foo<element />bar^</codeBlock> -> <codeBlock>[foo]<element />bar</codeBlock>
|
|
183
|
+
* <codeBlock><element />bar^</codeBlock> -> null
|
|
184
|
+
* <codeBlock>foo<softBreak />^<softBreak /></codeBlock> -> null
|
|
185
|
+
* <codeBlock>foo<softBreak />^<element /></codeBlock> -> null
|
|
186
|
+
* <codeBlock>foo<softBreak /><element />^</codeBlock> -> null
|
|
187
|
+
* <codeBlock>foo<softBreak />bar<element />^</codeBlock> -> <codeBlock>foo<softBreak />[bar]<element /></codeBlock>
|
|
188
|
+
* <codeBlock>foo<softBreak /><element />ba^r</codeBlock> -> null
|
|
189
|
+
* ```
|
|
190
|
+
*
|
|
191
|
+
* @internal
|
|
192
|
+
*/
|
|
193
193
|
export declare function getTextNodeAtLineStart(position: ModelPosition, model: Model): ModelText | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-code-block",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "49.0.0-alpha.1",
|
|
4
4
|
"description": "Code block feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@ckeditor/ckeditor5-core": "
|
|
30
|
-
"@ckeditor/ckeditor5-clipboard": "
|
|
31
|
-
"@ckeditor/ckeditor5-engine": "
|
|
32
|
-
"@ckeditor/ckeditor5-enter": "
|
|
33
|
-
"@ckeditor/ckeditor5-icons": "
|
|
34
|
-
"@ckeditor/ckeditor5-ui": "
|
|
35
|
-
"@ckeditor/ckeditor5-utils": "
|
|
29
|
+
"@ckeditor/ckeditor5-core": "49.0.0-alpha.1",
|
|
30
|
+
"@ckeditor/ckeditor5-clipboard": "49.0.0-alpha.1",
|
|
31
|
+
"@ckeditor/ckeditor5-engine": "49.0.0-alpha.1",
|
|
32
|
+
"@ckeditor/ckeditor5-enter": "49.0.0-alpha.1",
|
|
33
|
+
"@ckeditor/ckeditor5-icons": "49.0.0-alpha.1",
|
|
34
|
+
"@ckeditor/ckeditor5-ui": "49.0.0-alpha.1",
|
|
35
|
+
"@ckeditor/ckeditor5-utils": "49.0.0-alpha.1"
|
|
36
36
|
},
|
|
37
37
|
"files": [
|
|
38
38
|
"dist",
|