@ckeditor/ckeditor5-code-block 44.1.0 → 44.2.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/LICENSE.md +1 -1
- package/build/code-block.js +1 -1
- package/dist/index-content.css +2 -2
- package/dist/index-editor.css +2 -2
- package/dist/index.css +3 -3
- package/dist/index.css.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/translations/af.d.ts +2 -2
- package/dist/translations/af.js +2 -2
- package/dist/translations/af.umd.js +2 -2
- package/dist/translations/ar.d.ts +2 -2
- package/dist/translations/ar.js +2 -2
- package/dist/translations/ar.umd.js +2 -2
- package/dist/translations/ast.d.ts +2 -2
- package/dist/translations/ast.js +2 -2
- package/dist/translations/ast.umd.js +2 -2
- package/dist/translations/az.d.ts +2 -2
- package/dist/translations/az.js +2 -2
- package/dist/translations/az.umd.js +2 -2
- package/dist/translations/bg.d.ts +2 -2
- package/dist/translations/bg.js +2 -2
- package/dist/translations/bg.umd.js +2 -2
- package/dist/translations/bn.d.ts +2 -2
- package/dist/translations/bn.js +2 -2
- package/dist/translations/bn.umd.js +2 -2
- package/dist/translations/bs.d.ts +2 -2
- package/dist/translations/bs.js +2 -2
- package/dist/translations/bs.umd.js +2 -2
- package/dist/translations/ca.d.ts +2 -2
- package/dist/translations/ca.js +2 -2
- package/dist/translations/ca.umd.js +2 -2
- package/dist/translations/cs.d.ts +2 -2
- package/dist/translations/cs.js +2 -2
- package/dist/translations/cs.umd.js +2 -2
- package/dist/translations/da.d.ts +2 -2
- package/dist/translations/da.js +2 -2
- package/dist/translations/da.umd.js +2 -2
- package/dist/translations/de-ch.d.ts +2 -2
- package/dist/translations/de-ch.js +2 -2
- package/dist/translations/de-ch.umd.js +2 -2
- package/dist/translations/de.d.ts +2 -2
- package/dist/translations/de.js +2 -2
- package/dist/translations/de.umd.js +2 -2
- package/dist/translations/el.d.ts +2 -2
- package/dist/translations/el.js +2 -2
- package/dist/translations/el.umd.js +2 -2
- package/dist/translations/en-au.d.ts +2 -2
- package/dist/translations/en-au.js +2 -2
- package/dist/translations/en-au.umd.js +2 -2
- package/dist/translations/en-gb.d.ts +2 -2
- package/dist/translations/en-gb.js +2 -2
- package/dist/translations/en-gb.umd.js +2 -2
- package/dist/translations/en.d.ts +2 -2
- package/dist/translations/en.js +2 -2
- package/dist/translations/en.umd.js +2 -2
- package/dist/translations/eo.d.ts +2 -2
- package/dist/translations/eo.js +2 -2
- package/dist/translations/eo.umd.js +2 -2
- package/dist/translations/es-co.d.ts +2 -2
- package/dist/translations/es-co.js +2 -2
- package/dist/translations/es-co.umd.js +2 -2
- package/dist/translations/es.d.ts +2 -2
- package/dist/translations/es.js +2 -2
- package/dist/translations/es.umd.js +2 -2
- package/dist/translations/et.d.ts +2 -2
- package/dist/translations/et.js +2 -2
- package/dist/translations/et.umd.js +2 -2
- package/dist/translations/eu.d.ts +2 -2
- package/dist/translations/eu.js +2 -2
- package/dist/translations/eu.umd.js +2 -2
- package/dist/translations/fa.d.ts +2 -2
- package/dist/translations/fa.js +2 -2
- package/dist/translations/fa.umd.js +2 -2
- package/dist/translations/fi.d.ts +2 -2
- package/dist/translations/fi.js +2 -2
- package/dist/translations/fi.umd.js +2 -2
- package/dist/translations/fr.d.ts +2 -2
- package/dist/translations/fr.js +2 -2
- package/dist/translations/fr.umd.js +2 -2
- package/dist/translations/gl.d.ts +2 -2
- package/dist/translations/gl.js +2 -2
- package/dist/translations/gl.umd.js +2 -2
- package/dist/translations/gu.d.ts +2 -2
- package/dist/translations/gu.js +2 -2
- package/dist/translations/gu.umd.js +2 -2
- package/dist/translations/he.d.ts +2 -2
- package/dist/translations/he.js +2 -2
- package/dist/translations/he.umd.js +2 -2
- package/dist/translations/hi.d.ts +2 -2
- package/dist/translations/hi.js +2 -2
- package/dist/translations/hi.umd.js +2 -2
- package/dist/translations/hr.d.ts +2 -2
- package/dist/translations/hr.js +2 -2
- package/dist/translations/hr.umd.js +2 -2
- package/dist/translations/hu.d.ts +2 -2
- package/dist/translations/hu.js +2 -2
- package/dist/translations/hu.umd.js +2 -2
- package/dist/translations/hy.d.ts +2 -2
- package/dist/translations/hy.js +2 -2
- package/dist/translations/hy.umd.js +2 -2
- package/dist/translations/id.d.ts +2 -2
- package/dist/translations/id.js +2 -2
- package/dist/translations/id.umd.js +2 -2
- package/dist/translations/it.d.ts +2 -2
- package/dist/translations/it.js +2 -2
- package/dist/translations/it.umd.js +2 -2
- package/dist/translations/ja.d.ts +2 -2
- package/dist/translations/ja.js +2 -2
- package/dist/translations/ja.umd.js +2 -2
- package/dist/translations/jv.d.ts +2 -2
- package/dist/translations/jv.js +2 -2
- package/dist/translations/jv.umd.js +2 -2
- package/dist/translations/kk.d.ts +2 -2
- package/dist/translations/kk.js +2 -2
- package/dist/translations/kk.umd.js +2 -2
- package/dist/translations/km.d.ts +2 -2
- package/dist/translations/km.js +2 -2
- package/dist/translations/km.umd.js +2 -2
- package/dist/translations/kn.d.ts +2 -2
- package/dist/translations/kn.js +2 -2
- package/dist/translations/kn.umd.js +2 -2
- package/dist/translations/ko.d.ts +2 -2
- package/dist/translations/ko.js +2 -2
- package/dist/translations/ko.umd.js +2 -2
- package/dist/translations/ku.d.ts +2 -2
- package/dist/translations/ku.js +2 -2
- package/dist/translations/ku.umd.js +2 -2
- package/dist/translations/lt.d.ts +2 -2
- package/dist/translations/lt.js +2 -2
- package/dist/translations/lt.umd.js +2 -2
- package/dist/translations/lv.d.ts +2 -2
- package/dist/translations/lv.js +2 -2
- package/dist/translations/lv.umd.js +2 -2
- package/dist/translations/ms.d.ts +2 -2
- package/dist/translations/ms.js +2 -2
- package/dist/translations/ms.umd.js +2 -2
- package/dist/translations/nb.d.ts +2 -2
- package/dist/translations/nb.js +2 -2
- package/dist/translations/nb.umd.js +2 -2
- package/dist/translations/ne.d.ts +2 -2
- package/dist/translations/ne.js +2 -2
- package/dist/translations/ne.umd.js +2 -2
- package/dist/translations/nl.d.ts +2 -2
- package/dist/translations/nl.js +2 -2
- package/dist/translations/nl.umd.js +2 -2
- package/dist/translations/no.d.ts +2 -2
- package/dist/translations/no.js +2 -2
- package/dist/translations/no.umd.js +2 -2
- package/dist/translations/oc.d.ts +2 -2
- package/dist/translations/oc.js +2 -2
- package/dist/translations/oc.umd.js +2 -2
- package/dist/translations/pl.d.ts +2 -2
- package/dist/translations/pl.js +2 -2
- package/dist/translations/pl.umd.js +2 -2
- package/dist/translations/pt-br.d.ts +2 -2
- package/dist/translations/pt-br.js +2 -2
- package/dist/translations/pt-br.umd.js +2 -2
- package/dist/translations/pt.d.ts +2 -2
- package/dist/translations/pt.js +2 -2
- package/dist/translations/pt.umd.js +2 -2
- package/dist/translations/ro.d.ts +2 -2
- package/dist/translations/ro.js +2 -2
- package/dist/translations/ro.umd.js +2 -2
- package/dist/translations/ru.d.ts +2 -2
- package/dist/translations/ru.js +2 -2
- package/dist/translations/ru.umd.js +2 -2
- package/dist/translations/si.d.ts +2 -2
- package/dist/translations/si.js +2 -2
- package/dist/translations/si.umd.js +2 -2
- package/dist/translations/sk.d.ts +2 -2
- package/dist/translations/sk.js +2 -2
- package/dist/translations/sk.umd.js +2 -2
- package/dist/translations/sl.d.ts +2 -2
- package/dist/translations/sl.js +2 -2
- package/dist/translations/sl.umd.js +2 -2
- package/dist/translations/sq.d.ts +2 -2
- package/dist/translations/sq.js +2 -2
- package/dist/translations/sq.umd.js +2 -2
- package/dist/translations/sr-latn.d.ts +2 -2
- package/dist/translations/sr-latn.js +2 -2
- package/dist/translations/sr-latn.umd.js +2 -2
- package/dist/translations/sr.d.ts +2 -2
- package/dist/translations/sr.js +2 -2
- package/dist/translations/sr.umd.js +2 -2
- package/dist/translations/sv.d.ts +2 -2
- package/dist/translations/sv.js +2 -2
- package/dist/translations/sv.umd.js +2 -2
- package/dist/translations/th.d.ts +2 -2
- package/dist/translations/th.js +2 -2
- package/dist/translations/th.umd.js +2 -2
- package/dist/translations/ti.d.ts +2 -2
- package/dist/translations/ti.js +2 -2
- package/dist/translations/ti.umd.js +2 -2
- package/dist/translations/tk.d.ts +2 -2
- package/dist/translations/tk.js +2 -2
- package/dist/translations/tk.umd.js +2 -2
- package/dist/translations/tr.d.ts +2 -2
- package/dist/translations/tr.js +2 -2
- package/dist/translations/tr.umd.js +2 -2
- package/dist/translations/tt.d.ts +2 -2
- package/dist/translations/tt.js +2 -2
- package/dist/translations/tt.umd.js +2 -2
- package/dist/translations/ug.d.ts +2 -2
- package/dist/translations/ug.js +2 -2
- package/dist/translations/ug.umd.js +2 -2
- package/dist/translations/uk.d.ts +2 -2
- package/dist/translations/uk.js +2 -2
- package/dist/translations/uk.umd.js +2 -2
- package/dist/translations/ur.d.ts +2 -2
- package/dist/translations/ur.js +2 -2
- package/dist/translations/ur.umd.js +2 -2
- package/dist/translations/uz.d.ts +2 -2
- package/dist/translations/uz.js +2 -2
- package/dist/translations/uz.umd.js +2 -2
- package/dist/translations/vi.d.ts +2 -2
- package/dist/translations/vi.js +2 -2
- package/dist/translations/vi.umd.js +2 -2
- package/dist/translations/zh-cn.d.ts +2 -2
- package/dist/translations/zh-cn.js +2 -2
- package/dist/translations/zh-cn.umd.js +2 -2
- package/dist/translations/zh.d.ts +2 -2
- package/dist/translations/zh.js +2 -2
- package/dist/translations/zh.umd.js +2 -2
- package/lang/translations/af.po +1 -1
- package/lang/translations/ar.po +1 -1
- package/lang/translations/ast.po +1 -1
- package/lang/translations/az.po +1 -1
- package/lang/translations/bg.po +1 -1
- package/lang/translations/bn.po +1 -1
- package/lang/translations/bs.po +1 -1
- package/lang/translations/ca.po +1 -1
- package/lang/translations/cs.po +1 -1
- package/lang/translations/da.po +1 -1
- package/lang/translations/de-ch.po +1 -1
- package/lang/translations/de.po +1 -1
- package/lang/translations/el.po +1 -1
- package/lang/translations/en-au.po +1 -1
- package/lang/translations/en-gb.po +1 -1
- package/lang/translations/en.po +1 -1
- package/lang/translations/eo.po +1 -1
- package/lang/translations/es-co.po +1 -1
- package/lang/translations/es.po +1 -1
- package/lang/translations/et.po +1 -1
- package/lang/translations/eu.po +1 -1
- package/lang/translations/fa.po +1 -1
- package/lang/translations/fi.po +1 -1
- package/lang/translations/fr.po +1 -1
- package/lang/translations/gl.po +1 -1
- package/lang/translations/gu.po +1 -1
- package/lang/translations/he.po +1 -1
- package/lang/translations/hi.po +1 -1
- package/lang/translations/hr.po +1 -1
- package/lang/translations/hu.po +1 -1
- package/lang/translations/hy.po +1 -1
- package/lang/translations/id.po +1 -1
- package/lang/translations/it.po +1 -1
- package/lang/translations/ja.po +1 -1
- package/lang/translations/jv.po +1 -1
- package/lang/translations/kk.po +1 -1
- package/lang/translations/km.po +1 -1
- package/lang/translations/kn.po +1 -1
- package/lang/translations/ko.po +1 -1
- package/lang/translations/ku.po +1 -1
- package/lang/translations/lt.po +1 -1
- package/lang/translations/lv.po +1 -1
- package/lang/translations/ms.po +1 -1
- package/lang/translations/nb.po +1 -1
- package/lang/translations/ne.po +1 -1
- package/lang/translations/nl.po +1 -1
- package/lang/translations/no.po +1 -1
- package/lang/translations/oc.po +1 -1
- package/lang/translations/pl.po +1 -1
- package/lang/translations/pt-br.po +1 -1
- package/lang/translations/pt.po +1 -1
- package/lang/translations/ro.po +1 -1
- package/lang/translations/ru.po +1 -1
- package/lang/translations/si.po +1 -1
- package/lang/translations/sk.po +1 -1
- package/lang/translations/sl.po +1 -1
- package/lang/translations/sq.po +1 -1
- package/lang/translations/sr-latn.po +1 -1
- package/lang/translations/sr.po +1 -1
- package/lang/translations/sv.po +1 -1
- package/lang/translations/th.po +1 -1
- package/lang/translations/ti.po +1 -1
- package/lang/translations/tk.po +1 -1
- package/lang/translations/tr.po +1 -1
- package/lang/translations/tt.po +1 -1
- package/lang/translations/ug.po +1 -1
- package/lang/translations/uk.po +1 -1
- package/lang/translations/ur.po +1 -1
- package/lang/translations/uz.po +1 -1
- package/lang/translations/vi.po +1 -1
- package/lang/translations/zh-cn.po +1 -1
- package/lang/translations/zh.po +1 -1
- package/package.json +31 -9
- package/src/augmentation.d.ts +1 -1
- package/src/augmentation.js +1 -1
- package/src/codeblock.d.ts +1 -1
- package/src/codeblock.js +1 -1
- package/src/codeblockcommand.d.ts +1 -1
- package/src/codeblockcommand.js +1 -1
- package/src/codeblockconfig.d.ts +1 -1
- package/src/codeblockconfig.js +1 -1
- package/src/codeblockediting.d.ts +1 -1
- package/src/codeblockediting.js +1 -1
- package/src/codeblockui.d.ts +1 -1
- package/src/codeblockui.js +1 -1
- package/src/converters.d.ts +1 -1
- package/src/converters.js +1 -1
- package/src/indentcodeblockcommand.d.ts +1 -1
- package/src/indentcodeblockcommand.js +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/outdentcodeblockcommand.d.ts +1 -1
- package/src/outdentcodeblockcommand.js +1 -1
- package/src/utils.d.ts +1 -1
- package/src/utils.js +1 -1
- package/theme/codeblock.css +1 -1
- package/dist/augmentation.d.ts +0 -29
- package/dist/codeblock.d.ts +0 -37
- package/dist/codeblockcommand.d.ts +0 -64
- package/dist/codeblockconfig.d.ts +0 -150
- package/dist/codeblockediting.d.ts +0 -51
- package/dist/codeblockui.d.ts +0 -37
- package/dist/converters.d.ts +0 -130
- package/dist/indentcodeblockcommand.d.ts +0 -37
- package/dist/index.d.ts +0 -19
- package/dist/outdentcodeblockcommand.d.ts +0 -37
- package/dist/utils.d.ts +0 -181
package/dist/utils.d.ts
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, 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
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module code-block/utils
|
|
11
|
-
*/
|
|
12
|
-
import type { Editor } from 'ckeditor5/src/core.js';
|
|
13
|
-
import type { CodeBlockLanguageDefinition } from './codeblockconfig.js';
|
|
14
|
-
import type { DocumentSelection, Element, Model, Position, Schema, Text, UpcastWriter, ViewDocumentFragment } from 'ckeditor5/src/engine.js';
|
|
15
|
-
import { type LocaleTranslate } from 'ckeditor5/src/utils.js';
|
|
16
|
-
/**
|
|
17
|
-
* Returns code block languages as defined in `config.codeBlock.languages` but processed:
|
|
18
|
-
*
|
|
19
|
-
* * To consider the editor localization, i.e. to display {@link module:code-block/codeblockconfig~CodeBlockLanguageDefinition}
|
|
20
|
-
* in the correct language. There is no way to use {@link module:utils/locale~Locale#t} when the user
|
|
21
|
-
* configuration is defined because the editor does not exist yet.
|
|
22
|
-
* * To make sure each definition has a CSS class associated with it even if not specified
|
|
23
|
-
* in the original configuration.
|
|
24
|
-
*/
|
|
25
|
-
export declare function getNormalizedAndLocalizedLanguageDefinitions(editor: Editor): Array<CodeBlockLanguageDefinition>;
|
|
26
|
-
/**
|
|
27
|
-
* Returns an object associating certain language definition properties with others. For instance:
|
|
28
|
-
*
|
|
29
|
-
* For:
|
|
30
|
-
*
|
|
31
|
-
* ```ts
|
|
32
|
-
* const definitions = {
|
|
33
|
-
* { language: 'php', class: 'language-php', label: 'PHP' },
|
|
34
|
-
* { language: 'javascript', class: 'js', label: 'JavaScript' },
|
|
35
|
-
* };
|
|
36
|
-
*
|
|
37
|
-
* getPropertyAssociation( definitions, 'class', 'language' );
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* returns:
|
|
41
|
-
*
|
|
42
|
-
* ```ts
|
|
43
|
-
* {
|
|
44
|
-
* 'language-php': 'php',
|
|
45
|
-
* 'js': 'javascript'
|
|
46
|
-
* }
|
|
47
|
-
* ```
|
|
48
|
-
*
|
|
49
|
-
* and
|
|
50
|
-
*
|
|
51
|
-
* ```ts
|
|
52
|
-
* getPropertyAssociation( definitions, 'language', 'label' );
|
|
53
|
-
* ```
|
|
54
|
-
*
|
|
55
|
-
* returns:
|
|
56
|
-
*
|
|
57
|
-
* ```ts
|
|
58
|
-
* {
|
|
59
|
-
* 'php': 'PHP',
|
|
60
|
-
* 'javascript': 'JavaScript'
|
|
61
|
-
* }
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
export declare function getPropertyAssociation(languageDefs: Array<CodeBlockLanguageDefinition>, key: keyof CodeBlockLanguageDefinition, value: keyof CodeBlockLanguageDefinition): Record<string, string>;
|
|
65
|
-
/**
|
|
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
|
-
export declare function getLeadingWhiteSpaces(textNode: Text): string;
|
|
70
|
-
/**
|
|
71
|
-
* For plain text containing the code (a snippet), it returns a document fragment containing
|
|
72
|
-
* view text nodes separated by `<br>` elements (in place of new line characters "\n"), for instance:
|
|
73
|
-
*
|
|
74
|
-
* Input:
|
|
75
|
-
*
|
|
76
|
-
* ```ts
|
|
77
|
-
* "foo()\n
|
|
78
|
-
* bar()"
|
|
79
|
-
* ```
|
|
80
|
-
*
|
|
81
|
-
* Output:
|
|
82
|
-
*
|
|
83
|
-
* ```html
|
|
84
|
-
* <DocumentFragment>
|
|
85
|
-
* "foo()"
|
|
86
|
-
* <br/>
|
|
87
|
-
* "bar()"
|
|
88
|
-
* </DocumentFragment>
|
|
89
|
-
* ```
|
|
90
|
-
*
|
|
91
|
-
* @param text The raw code text to be converted.
|
|
92
|
-
*/
|
|
93
|
-
export declare function rawSnippetTextToViewDocumentFragment(writer: UpcastWriter, text: string): ViewDocumentFragment;
|
|
94
|
-
/**
|
|
95
|
-
* Returns an array of all model positions within the selection that represent code block lines.
|
|
96
|
-
*
|
|
97
|
-
* If the selection is collapsed, it returns the exact selection anchor position:
|
|
98
|
-
*
|
|
99
|
-
* ```html
|
|
100
|
-
* <codeBlock>[]foo</codeBlock> -> <codeBlock>^foo</codeBlock>
|
|
101
|
-
* <codeBlock>foo[]bar</codeBlock> -> <codeBlock>foo^bar</codeBlock>
|
|
102
|
-
* ```
|
|
103
|
-
*
|
|
104
|
-
* Otherwise, it returns positions **before** each text node belonging to all code blocks contained by the selection:
|
|
105
|
-
*
|
|
106
|
-
* ```html
|
|
107
|
-
* <codeBlock> <codeBlock>
|
|
108
|
-
* foo[bar ^foobar
|
|
109
|
-
* <softBreak></softBreak> -> <softBreak></softBreak>
|
|
110
|
-
* baz]qux ^bazqux
|
|
111
|
-
* </codeBlock> </codeBlock>
|
|
112
|
-
* ```
|
|
113
|
-
*
|
|
114
|
-
* It also works across other non–code blocks:
|
|
115
|
-
*
|
|
116
|
-
* ```html
|
|
117
|
-
* <codeBlock> <codeBlock>
|
|
118
|
-
* foo[bar ^foobar
|
|
119
|
-
* </codeBlock> </codeBlock>
|
|
120
|
-
* <paragraph>text</paragraph> -> <paragraph>text</paragraph>
|
|
121
|
-
* <codeBlock> <codeBlock>
|
|
122
|
-
* baz]qux ^bazqux
|
|
123
|
-
* </codeBlock> </codeBlock>
|
|
124
|
-
* ```
|
|
125
|
-
*
|
|
126
|
-
* **Note:** The positions are in reverse order so they do not get outdated when iterating over them and
|
|
127
|
-
* the writer inserts or removes elements at the same time.
|
|
128
|
-
*
|
|
129
|
-
* **Note:** The position is located after the leading white spaces in the text node.
|
|
130
|
-
*/
|
|
131
|
-
export declare function getIndentOutdentPositions(model: Model): Array<Position>;
|
|
132
|
-
/**
|
|
133
|
-
* Checks if any of the blocks within the model selection is a code block.
|
|
134
|
-
*/
|
|
135
|
-
export declare function isModelSelectionInCodeBlock(selection: DocumentSelection): boolean;
|
|
136
|
-
/**
|
|
137
|
-
* Checks if an {@link module:engine/model/element~Element Element} can become a code block.
|
|
138
|
-
*
|
|
139
|
-
* @param schema Model's schema.
|
|
140
|
-
* @param element The element to be checked.
|
|
141
|
-
* @returns Check result.
|
|
142
|
-
*/
|
|
143
|
-
export declare function canBeCodeBlock(schema: Schema, element: Element): boolean;
|
|
144
|
-
/**
|
|
145
|
-
* Get the translated message read by the screen reader when you enter or exit an element with your cursor.
|
|
146
|
-
*/
|
|
147
|
-
export declare function getCodeBlockAriaAnnouncement(t: LocaleTranslate, languageDefs: Array<CodeBlockLanguageDefinition>, element: Element, direction: 'enter' | 'leave'): string;
|
|
148
|
-
/**
|
|
149
|
-
* 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
|
|
150
|
-
* beginning of the line (or `null` if there's no text node at the beginning of a given line).
|
|
151
|
-
*
|
|
152
|
-
* Line beings at the start of a code block element and after each `softBreak` element.
|
|
153
|
-
*
|
|
154
|
-
* Note: even though code block doesn't allow inline elements other than `<softBreak>` by default, some features may overwrite this rule,
|
|
155
|
-
* so such inline elements are taken into account.
|
|
156
|
-
*
|
|
157
|
-
* Some examples of expected results:
|
|
158
|
-
*
|
|
159
|
-
* ```
|
|
160
|
-
* <codeBlock>^</codeBlock> -> null
|
|
161
|
-
* <codeBlock>^foobar</codeBlock> -> <codeBlock>[foobar]</codeBlock>
|
|
162
|
-
* <codeBlock>foobar^</codeBlock> -> <codeBlock>[foobar]</codeBlock>
|
|
163
|
-
* <codeBlock>foo^bar</codeBlock> -> <codeBlock>[foobar]</codeBlock>
|
|
164
|
-
* <codeBlock>foo^<softBreak />bar</codeBlock> -> <codeBlock>[foo]<softBreak />bar</codeBlock>
|
|
165
|
-
* <codeBlock>foo<softBreak />bar^</codeBlock> -> <codeBlock>foo<softBreak />[bar]</codeBlock>
|
|
166
|
-
* <codeBlock>foo<softBreak />b^ar</codeBlock> -> <codeBlock>foo<softBreak />[bar]</codeBlock>
|
|
167
|
-
* <codeBlock>foo<softBreak />^bar</codeBlock> -> <codeBlock>foo<softBreak />[bar]</codeBlock>
|
|
168
|
-
* <codeBlock>^<element /></codeBlock> -> null
|
|
169
|
-
* <codeBlock><element />^</codeBlock> -> null
|
|
170
|
-
* <codeBlock>foo^<element /></codeBlock> -> <codeBlock>[foo]<element /></codeBlock>
|
|
171
|
-
* <codeBlock>foo<element />^</codeBlock> -> <codeBlock>[foo]<element /></codeBlock>
|
|
172
|
-
* <codeBlock>foo<element />bar^</codeBlock> -> <codeBlock>[foo]<element />bar</codeBlock>
|
|
173
|
-
* <codeBlock><element />bar^</codeBlock> -> null
|
|
174
|
-
* <codeBlock>foo<softBreak />^<softBreak /></codeBlock> -> null
|
|
175
|
-
* <codeBlock>foo<softBreak />^<element /></codeBlock> -> null
|
|
176
|
-
* <codeBlock>foo<softBreak /><element />^</codeBlock> -> null
|
|
177
|
-
* <codeBlock>foo<softBreak />bar<element />^</codeBlock> -> <codeBlock>foo<softBreak />[bar]<element /></codeBlock>
|
|
178
|
-
* <codeBlock>foo<softBreak /><element />ba^r</codeBlock> -> null
|
|
179
|
-
* ```
|
|
180
|
-
*/
|
|
181
|
-
export declare function getTextNodeAtLineStart(position: Position, model: Model): Text | null;
|