@ckeditor/ckeditor5-language 41.3.0-alpha.3 → 41.3.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/build/language.js +1 -1
- package/package.json +2 -3
- package/src/textpartlanguageui.d.ts +4 -0
- package/src/textpartlanguageui.js +84 -34
- package/dist/content-index.css +0 -4
- package/dist/editor-index.css +0 -4
- package/dist/index.css +0 -4
- package/dist/translations/ar.d.ts +0 -8
- package/dist/translations/ar.js +0 -5
- package/dist/translations/bg.d.ts +0 -8
- package/dist/translations/bg.js +0 -5
- package/dist/translations/bn.d.ts +0 -8
- package/dist/translations/bn.js +0 -5
- package/dist/translations/ca.d.ts +0 -8
- package/dist/translations/ca.js +0 -5
- package/dist/translations/cs.d.ts +0 -8
- package/dist/translations/cs.js +0 -5
- package/dist/translations/da.d.ts +0 -8
- package/dist/translations/da.js +0 -5
- package/dist/translations/de-ch.d.ts +0 -8
- package/dist/translations/de-ch.js +0 -5
- package/dist/translations/de.d.ts +0 -8
- package/dist/translations/de.js +0 -5
- package/dist/translations/el.d.ts +0 -8
- package/dist/translations/el.js +0 -5
- package/dist/translations/en-au.d.ts +0 -8
- package/dist/translations/en-au.js +0 -5
- package/dist/translations/en.d.ts +0 -8
- package/dist/translations/en.js +0 -5
- package/dist/translations/es.d.ts +0 -8
- package/dist/translations/es.js +0 -5
- package/dist/translations/et.d.ts +0 -8
- package/dist/translations/et.js +0 -5
- package/dist/translations/fi.d.ts +0 -8
- package/dist/translations/fi.js +0 -5
- package/dist/translations/fr.d.ts +0 -8
- package/dist/translations/fr.js +0 -5
- package/dist/translations/gl.d.ts +0 -8
- package/dist/translations/gl.js +0 -5
- package/dist/translations/he.d.ts +0 -8
- package/dist/translations/he.js +0 -5
- package/dist/translations/hi.d.ts +0 -8
- package/dist/translations/hi.js +0 -5
- package/dist/translations/hr.d.ts +0 -8
- package/dist/translations/hr.js +0 -5
- package/dist/translations/hu.d.ts +0 -8
- package/dist/translations/hu.js +0 -5
- package/dist/translations/id.d.ts +0 -8
- package/dist/translations/id.js +0 -5
- package/dist/translations/it.d.ts +0 -8
- package/dist/translations/it.js +0 -5
- package/dist/translations/ja.d.ts +0 -8
- package/dist/translations/ja.js +0 -5
- package/dist/translations/jv.d.ts +0 -8
- package/dist/translations/jv.js +0 -5
- package/dist/translations/ko.d.ts +0 -8
- package/dist/translations/ko.js +0 -5
- package/dist/translations/lt.d.ts +0 -8
- package/dist/translations/lt.js +0 -5
- package/dist/translations/lv.d.ts +0 -8
- package/dist/translations/lv.js +0 -5
- package/dist/translations/ms.d.ts +0 -8
- package/dist/translations/ms.js +0 -5
- package/dist/translations/nl.d.ts +0 -8
- package/dist/translations/nl.js +0 -5
- package/dist/translations/no.d.ts +0 -8
- package/dist/translations/no.js +0 -5
- package/dist/translations/pl.d.ts +0 -8
- package/dist/translations/pl.js +0 -5
- package/dist/translations/pt-br.d.ts +0 -8
- package/dist/translations/pt-br.js +0 -5
- package/dist/translations/pt.d.ts +0 -8
- package/dist/translations/pt.js +0 -5
- package/dist/translations/ro.d.ts +0 -8
- package/dist/translations/ro.js +0 -5
- package/dist/translations/ru.d.ts +0 -8
- package/dist/translations/ru.js +0 -5
- package/dist/translations/sk.d.ts +0 -8
- package/dist/translations/sk.js +0 -5
- package/dist/translations/sr-latn.d.ts +0 -8
- package/dist/translations/sr-latn.js +0 -5
- package/dist/translations/sr.d.ts +0 -8
- package/dist/translations/sr.js +0 -5
- package/dist/translations/sv.d.ts +0 -8
- package/dist/translations/sv.js +0 -5
- package/dist/translations/th.d.ts +0 -8
- package/dist/translations/th.js +0 -5
- package/dist/translations/tk.d.ts +0 -8
- package/dist/translations/tk.js +0 -5
- package/dist/translations/tr.d.ts +0 -8
- package/dist/translations/tr.js +0 -5
- package/dist/translations/tt.d.ts +0 -8
- package/dist/translations/tt.js +0 -5
- package/dist/translations/ug.d.ts +0 -8
- package/dist/translations/ug.js +0 -5
- package/dist/translations/uk.d.ts +0 -8
- package/dist/translations/uk.js +0 -5
- package/dist/translations/ur.d.ts +0 -8
- package/dist/translations/ur.js +0 -5
- package/dist/translations/vi.d.ts +0 -8
- package/dist/translations/vi.js +0 -5
- package/dist/translations/zh-cn.d.ts +0 -8
- package/dist/translations/zh-cn.js +0 -5
- package/dist/translations/zh.d.ts +0 -8
- package/dist/translations/zh.js +0 -5
- package/dist/types/augmentation.d.ts +0 -51
- package/dist/types/index.d.ts +0 -17
- package/dist/types/textpartlanguage.d.ts +0 -39
- package/dist/types/textpartlanguagecommand.d.ts +0 -74
- package/dist/types/textpartlanguageconfig.d.ts +0 -29
- package/dist/types/textpartlanguageediting.d.ts +0 -32
- package/dist/types/textpartlanguageui.d.ts +0 -27
- package/dist/types/utils.d.ts +0 -44
|
@@ -1,74 +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-oss-license
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module language/textpartlanguagecommand
|
|
11
|
-
*/
|
|
12
|
-
import type { LanguageDirection } from 'ckeditor5/src/utils.js';
|
|
13
|
-
import { Command } from 'ckeditor5/src/core.js';
|
|
14
|
-
/**
|
|
15
|
-
* The text part language command plugin.
|
|
16
|
-
*/
|
|
17
|
-
export default class TextPartLanguageCommand extends Command {
|
|
18
|
-
/**
|
|
19
|
-
* If the selection starts in a language attribute, the value is set to
|
|
20
|
-
* the value of that language in the following format:
|
|
21
|
-
*
|
|
22
|
-
* ```
|
|
23
|
-
* <languageCode>:<textDirection>
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* * `languageCode` - The language code used for the `lang` attribute in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1)
|
|
27
|
-
* format.
|
|
28
|
-
* * `textDirection` - One of the following values: `rtl` or `ltr`, indicating the reading direction of the language.
|
|
29
|
-
*
|
|
30
|
-
* See the {@link module:core/editor/editorconfig~LanguageConfig#textPartLanguage text part language configuration}
|
|
31
|
-
* for more information about language properties.
|
|
32
|
-
*
|
|
33
|
-
* It is set to `false` otherwise.
|
|
34
|
-
*
|
|
35
|
-
* @observable
|
|
36
|
-
* @readonly
|
|
37
|
-
*/
|
|
38
|
-
value: false | string;
|
|
39
|
-
/**
|
|
40
|
-
* @inheritDoc
|
|
41
|
-
*/
|
|
42
|
-
refresh(): void;
|
|
43
|
-
/**
|
|
44
|
-
* Executes the command. Applies the attribute to the selection or removes it from the selection.
|
|
45
|
-
*
|
|
46
|
-
* If `languageCode` is set to `false` or a `null` value, it will remove attributes. Otherwise, it will set
|
|
47
|
-
* the attribute in the `{@link #value value}` format.
|
|
48
|
-
*
|
|
49
|
-
* The execution result differs, depending on the {@link module:engine/model/document~Document#selection}:
|
|
50
|
-
*
|
|
51
|
-
* * If the selection is on a range, the command applies the attribute to all nodes in that range
|
|
52
|
-
* (if they are allowed to have this attribute by the {@link module:engine/model/schema~Schema schema}).
|
|
53
|
-
* * If the selection is collapsed in a non-empty node, the command applies the attribute to the
|
|
54
|
-
* {@link module:engine/model/document~Document#selection} itself (note that typed characters copy attributes from the selection).
|
|
55
|
-
* * If the selection is collapsed in an empty node, the command applies the attribute to the parent node of the selection (note
|
|
56
|
-
* that the selection inherits all attributes from a node if it is in an empty node).
|
|
57
|
-
*
|
|
58
|
-
* @fires execute
|
|
59
|
-
* @param options Command options.
|
|
60
|
-
* @param options.languageCode The language code to be applied to the model.
|
|
61
|
-
* @param options.textDirection The language text direction.
|
|
62
|
-
*/
|
|
63
|
-
execute({ languageCode, textDirection }?: {
|
|
64
|
-
languageCode?: string | false;
|
|
65
|
-
textDirection?: LanguageDirection;
|
|
66
|
-
}): void;
|
|
67
|
-
/**
|
|
68
|
-
* Returns the attribute value of the first node in the selection that allows the attribute.
|
|
69
|
-
* For a collapsed selection it returns the selection attribute.
|
|
70
|
-
*
|
|
71
|
-
* @returns The attribute value.
|
|
72
|
-
*/
|
|
73
|
-
private _getValueFromFirstAllowedNode;
|
|
74
|
-
}
|
|
@@ -1,29 +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-oss-license
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module language/textpartlanguageconfig
|
|
11
|
-
*/
|
|
12
|
-
import type { LanguageDirection } from 'ckeditor5/src/utils.js';
|
|
13
|
-
/**
|
|
14
|
-
* The text part language feature option descriptor.
|
|
15
|
-
*/
|
|
16
|
-
export interface TextPartLanguageOption {
|
|
17
|
-
/**
|
|
18
|
-
* The user-readable title of the option.
|
|
19
|
-
*/
|
|
20
|
-
title: string;
|
|
21
|
-
/**
|
|
22
|
-
* The language code in the ISO 639 format.
|
|
23
|
-
*/
|
|
24
|
-
languageCode: string;
|
|
25
|
-
/**
|
|
26
|
-
* The language text direction. Automatically detected if omitted.
|
|
27
|
-
*/
|
|
28
|
-
textDirection?: LanguageDirection;
|
|
29
|
-
}
|
|
@@ -1,32 +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-oss-license
|
|
8
|
-
*/
|
|
9
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
10
|
-
/**
|
|
11
|
-
* The text part language editing.
|
|
12
|
-
*
|
|
13
|
-
* Introduces the `'textPartLanguage'` command and the `'language'` model element attribute.
|
|
14
|
-
*/
|
|
15
|
-
export default class TextPartLanguageEditing extends Plugin {
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
static get pluginName(): "TextPartLanguageEditing";
|
|
20
|
-
/**
|
|
21
|
-
* @inheritDoc
|
|
22
|
-
*/
|
|
23
|
-
constructor(editor: Editor);
|
|
24
|
-
/**
|
|
25
|
-
* @inheritDoc
|
|
26
|
-
*/
|
|
27
|
-
init(): void;
|
|
28
|
-
/**
|
|
29
|
-
* @private
|
|
30
|
-
*/
|
|
31
|
-
private _defineConverters;
|
|
32
|
-
}
|
|
@@ -1,27 +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-oss-license
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module language/textpartlanguageui
|
|
11
|
-
*/
|
|
12
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
13
|
-
/**
|
|
14
|
-
* The text part language UI plugin.
|
|
15
|
-
*
|
|
16
|
-
* It introduces the `'language'` dropdown.
|
|
17
|
-
*/
|
|
18
|
-
export default class TextPartLanguageUI extends Plugin {
|
|
19
|
-
/**
|
|
20
|
-
* @inheritDoc
|
|
21
|
-
*/
|
|
22
|
-
static get pluginName(): "TextPartLanguageUI";
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
init(): void;
|
|
27
|
-
}
|
package/dist/types/utils.d.ts
DELETED
|
@@ -1,44 +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-oss-license
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module language/utils
|
|
11
|
-
*/
|
|
12
|
-
import { type LanguageDirection } from 'ckeditor5/src/utils.js';
|
|
13
|
-
/**
|
|
14
|
-
* Returns the language attribute value in a human-readable text format:
|
|
15
|
-
*
|
|
16
|
-
* ```
|
|
17
|
-
* <languageCode>:<textDirection>
|
|
18
|
-
* ```
|
|
19
|
-
*
|
|
20
|
-
* * `languageCode` - The language code used for the `lang` attribute in the [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.
|
|
21
|
-
* * `textDirection` - One of the following values: `rtl` or `ltr`, indicating the reading direction of the language.
|
|
22
|
-
*
|
|
23
|
-
* See the {@link module:core/editor/editorconfig~LanguageConfig#textPartLanguage text part language configuration}
|
|
24
|
-
* for more information about language properties.
|
|
25
|
-
*
|
|
26
|
-
* If the `textDirection` argument is omitted, it will be automatically detected based on `languageCode`.
|
|
27
|
-
*
|
|
28
|
-
* @param languageCode The language code in the ISO 639-1 format.
|
|
29
|
-
* @param textDirection The language text direction. Automatically detected if omitted.
|
|
30
|
-
*/
|
|
31
|
-
export declare function stringifyLanguageAttribute(languageCode: string, textDirection?: LanguageDirection): string;
|
|
32
|
-
/**
|
|
33
|
-
* Retrieves language properties converted to attribute value by the
|
|
34
|
-
* {@link module:language/utils~stringifyLanguageAttribute stringifyLanguageAttribute} function.
|
|
35
|
-
*
|
|
36
|
-
* @param str The attribute value.
|
|
37
|
-
* @returns The object with properties:
|
|
38
|
-
* * languageCode - The language code in the ISO 639 format.
|
|
39
|
-
* * textDirection - The language text direction.
|
|
40
|
-
*/
|
|
41
|
-
export declare function parseLanguageAttribute(str: string): {
|
|
42
|
-
languageCode: string;
|
|
43
|
-
textDirection: string;
|
|
44
|
-
};
|