@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.
Files changed (113) hide show
  1. package/build/language.js +1 -1
  2. package/package.json +2 -3
  3. package/src/textpartlanguageui.d.ts +4 -0
  4. package/src/textpartlanguageui.js +84 -34
  5. package/dist/content-index.css +0 -4
  6. package/dist/editor-index.css +0 -4
  7. package/dist/index.css +0 -4
  8. package/dist/translations/ar.d.ts +0 -8
  9. package/dist/translations/ar.js +0 -5
  10. package/dist/translations/bg.d.ts +0 -8
  11. package/dist/translations/bg.js +0 -5
  12. package/dist/translations/bn.d.ts +0 -8
  13. package/dist/translations/bn.js +0 -5
  14. package/dist/translations/ca.d.ts +0 -8
  15. package/dist/translations/ca.js +0 -5
  16. package/dist/translations/cs.d.ts +0 -8
  17. package/dist/translations/cs.js +0 -5
  18. package/dist/translations/da.d.ts +0 -8
  19. package/dist/translations/da.js +0 -5
  20. package/dist/translations/de-ch.d.ts +0 -8
  21. package/dist/translations/de-ch.js +0 -5
  22. package/dist/translations/de.d.ts +0 -8
  23. package/dist/translations/de.js +0 -5
  24. package/dist/translations/el.d.ts +0 -8
  25. package/dist/translations/el.js +0 -5
  26. package/dist/translations/en-au.d.ts +0 -8
  27. package/dist/translations/en-au.js +0 -5
  28. package/dist/translations/en.d.ts +0 -8
  29. package/dist/translations/en.js +0 -5
  30. package/dist/translations/es.d.ts +0 -8
  31. package/dist/translations/es.js +0 -5
  32. package/dist/translations/et.d.ts +0 -8
  33. package/dist/translations/et.js +0 -5
  34. package/dist/translations/fi.d.ts +0 -8
  35. package/dist/translations/fi.js +0 -5
  36. package/dist/translations/fr.d.ts +0 -8
  37. package/dist/translations/fr.js +0 -5
  38. package/dist/translations/gl.d.ts +0 -8
  39. package/dist/translations/gl.js +0 -5
  40. package/dist/translations/he.d.ts +0 -8
  41. package/dist/translations/he.js +0 -5
  42. package/dist/translations/hi.d.ts +0 -8
  43. package/dist/translations/hi.js +0 -5
  44. package/dist/translations/hr.d.ts +0 -8
  45. package/dist/translations/hr.js +0 -5
  46. package/dist/translations/hu.d.ts +0 -8
  47. package/dist/translations/hu.js +0 -5
  48. package/dist/translations/id.d.ts +0 -8
  49. package/dist/translations/id.js +0 -5
  50. package/dist/translations/it.d.ts +0 -8
  51. package/dist/translations/it.js +0 -5
  52. package/dist/translations/ja.d.ts +0 -8
  53. package/dist/translations/ja.js +0 -5
  54. package/dist/translations/jv.d.ts +0 -8
  55. package/dist/translations/jv.js +0 -5
  56. package/dist/translations/ko.d.ts +0 -8
  57. package/dist/translations/ko.js +0 -5
  58. package/dist/translations/lt.d.ts +0 -8
  59. package/dist/translations/lt.js +0 -5
  60. package/dist/translations/lv.d.ts +0 -8
  61. package/dist/translations/lv.js +0 -5
  62. package/dist/translations/ms.d.ts +0 -8
  63. package/dist/translations/ms.js +0 -5
  64. package/dist/translations/nl.d.ts +0 -8
  65. package/dist/translations/nl.js +0 -5
  66. package/dist/translations/no.d.ts +0 -8
  67. package/dist/translations/no.js +0 -5
  68. package/dist/translations/pl.d.ts +0 -8
  69. package/dist/translations/pl.js +0 -5
  70. package/dist/translations/pt-br.d.ts +0 -8
  71. package/dist/translations/pt-br.js +0 -5
  72. package/dist/translations/pt.d.ts +0 -8
  73. package/dist/translations/pt.js +0 -5
  74. package/dist/translations/ro.d.ts +0 -8
  75. package/dist/translations/ro.js +0 -5
  76. package/dist/translations/ru.d.ts +0 -8
  77. package/dist/translations/ru.js +0 -5
  78. package/dist/translations/sk.d.ts +0 -8
  79. package/dist/translations/sk.js +0 -5
  80. package/dist/translations/sr-latn.d.ts +0 -8
  81. package/dist/translations/sr-latn.js +0 -5
  82. package/dist/translations/sr.d.ts +0 -8
  83. package/dist/translations/sr.js +0 -5
  84. package/dist/translations/sv.d.ts +0 -8
  85. package/dist/translations/sv.js +0 -5
  86. package/dist/translations/th.d.ts +0 -8
  87. package/dist/translations/th.js +0 -5
  88. package/dist/translations/tk.d.ts +0 -8
  89. package/dist/translations/tk.js +0 -5
  90. package/dist/translations/tr.d.ts +0 -8
  91. package/dist/translations/tr.js +0 -5
  92. package/dist/translations/tt.d.ts +0 -8
  93. package/dist/translations/tt.js +0 -5
  94. package/dist/translations/ug.d.ts +0 -8
  95. package/dist/translations/ug.js +0 -5
  96. package/dist/translations/uk.d.ts +0 -8
  97. package/dist/translations/uk.js +0 -5
  98. package/dist/translations/ur.d.ts +0 -8
  99. package/dist/translations/ur.js +0 -5
  100. package/dist/translations/vi.d.ts +0 -8
  101. package/dist/translations/vi.js +0 -5
  102. package/dist/translations/zh-cn.d.ts +0 -8
  103. package/dist/translations/zh-cn.js +0 -5
  104. package/dist/translations/zh.d.ts +0 -8
  105. package/dist/translations/zh.js +0 -5
  106. package/dist/types/augmentation.d.ts +0 -51
  107. package/dist/types/index.d.ts +0 -17
  108. package/dist/types/textpartlanguage.d.ts +0 -39
  109. package/dist/types/textpartlanguagecommand.d.ts +0 -74
  110. package/dist/types/textpartlanguageconfig.d.ts +0 -29
  111. package/dist/types/textpartlanguageediting.d.ts +0 -32
  112. package/dist/types/textpartlanguageui.d.ts +0 -27
  113. 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
- }
@@ -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
- };