@ckeditor/ckeditor5-special-characters 0.0.0-nightly-20240610.0 → 0.0.0-nightly-20240612.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 (70) hide show
  1. package/build/special-characters.js +2 -2
  2. package/build/translations/ar.js +1 -1
  3. package/build/translations/az.js +1 -1
  4. package/build/translations/bg.js +1 -1
  5. package/build/translations/bn.js +1 -1
  6. package/build/translations/ca.js +1 -1
  7. package/build/translations/cs.js +1 -1
  8. package/build/translations/da.js +1 -1
  9. package/build/translations/de.js +1 -1
  10. package/build/translations/el.js +1 -1
  11. package/build/translations/en-au.js +1 -1
  12. package/build/translations/es.js +1 -1
  13. package/build/translations/et.js +1 -1
  14. package/build/translations/fa.js +1 -1
  15. package/build/translations/fi.js +1 -1
  16. package/build/translations/fr.js +1 -1
  17. package/build/translations/gl.js +1 -1
  18. package/build/translations/he.js +1 -1
  19. package/build/translations/hi.js +1 -1
  20. package/build/translations/hr.js +1 -1
  21. package/build/translations/hu.js +1 -1
  22. package/build/translations/id.js +1 -1
  23. package/build/translations/it.js +1 -1
  24. package/build/translations/ja.js +1 -1
  25. package/build/translations/ko.js +1 -1
  26. package/build/translations/lt.js +1 -1
  27. package/build/translations/lv.js +1 -1
  28. package/build/translations/ms.js +1 -1
  29. package/build/translations/nl.js +1 -1
  30. package/build/translations/no.js +1 -1
  31. package/build/translations/pl.js +1 -1
  32. package/build/translations/pt-br.js +1 -1
  33. package/build/translations/pt.js +1 -1
  34. package/build/translations/ro.js +1 -1
  35. package/build/translations/ru.js +1 -1
  36. package/build/translations/sk.js +1 -1
  37. package/build/translations/sq.js +1 -1
  38. package/build/translations/sr-latn.js +1 -1
  39. package/build/translations/sr.js +1 -1
  40. package/build/translations/sv.js +1 -1
  41. package/build/translations/th.js +1 -1
  42. package/build/translations/ti.js +1 -1
  43. package/build/translations/tk.js +1 -1
  44. package/build/translations/tr.js +1 -1
  45. package/build/translations/uk.js +1 -1
  46. package/build/translations/ur.js +1 -1
  47. package/build/translations/uz.js +1 -1
  48. package/build/translations/vi.js +1 -1
  49. package/build/translations/zh-cn.js +1 -1
  50. package/build/translations/zh.js +1 -1
  51. package/dist/index-editor.css +55 -0
  52. package/dist/index.css +96 -0
  53. package/dist/index.css.map +1 -1
  54. package/dist/index.js +154 -137
  55. package/dist/index.js.map +1 -1
  56. package/dist/types/specialcharacters.d.ts +8 -2
  57. package/dist/types/ui/specialcharacterscategoriesview.d.ts +45 -0
  58. package/dist/types/ui/specialcharactersview.d.ts +4 -4
  59. package/lang/contexts.json +2 -2
  60. package/package.json +3 -2
  61. package/src/specialcharacters.d.ts +8 -2
  62. package/src/specialcharacters.js +60 -38
  63. package/src/ui/specialcharacterscategoriesview.d.ts +41 -0
  64. package/src/ui/specialcharacterscategoriesview.js +93 -0
  65. package/src/ui/specialcharactersview.d.ts +4 -4
  66. package/src/ui/specialcharactersview.js +6 -6
  67. package/theme/specialcharacters.css +81 -0
  68. package/dist/types/ui/specialcharactersnavigationview.d.ts +0 -63
  69. package/src/ui/specialcharactersnavigationview.d.ts +0 -59
  70. package/src/ui/specialcharactersnavigationview.js +0 -95
@@ -1,63 +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 special-characters/ui/specialcharactersnavigationview
11
- */
12
- import { type Locale } from 'ckeditor5/src/utils.js';
13
- import { FormHeaderView, type DropdownView } from 'ckeditor5/src/ui.js';
14
- /**
15
- * A class representing the navigation part of the special characters UI. It is responsible
16
- * for describing the feature and allowing the user to select a particular character group.
17
- */
18
- export default class SpecialCharactersNavigationView extends FormHeaderView {
19
- /**
20
- * A dropdown that allows selecting a group of special characters to be displayed.
21
- */
22
- groupDropdownView: GroupDropdownView;
23
- /**
24
- * Creates an instance of the {@link module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}
25
- * class.
26
- *
27
- * @param locale The localization services instance.
28
- * @param groupNames The names of the character groups and their displayed labels.
29
- */
30
- constructor(locale: Locale, groupNames: GroupNames);
31
- /**
32
- * Returns the name of the character group currently selected in the {@link #groupDropdownView}.
33
- */
34
- get currentGroupName(): string;
35
- /**
36
- * Focuses the character categories dropdown.
37
- */
38
- focus(): void;
39
- /**
40
- * Returns a dropdown that allows selecting character groups.
41
- *
42
- * @param groupNames The names of the character groups and their displayed labels.
43
- */
44
- private _createGroupDropdown;
45
- /**
46
- * Returns list item definitions to be used in the character group dropdown
47
- * representing specific character groups.
48
- *
49
- * @param dropdown Dropdown view element
50
- * @param groupNames The names of the character groups and their displayed labels.
51
- */
52
- private _getCharacterGroupListItemDefinitions;
53
- }
54
- /**
55
- * The names of the character groups and their displayed labels.
56
- */
57
- export type GroupNames = Map<string, string>;
58
- /**
59
- * `DropdownView` with additional field for the name of the currectly selected character group.
60
- */
61
- export type GroupDropdownView = DropdownView & {
62
- value: string;
63
- };
@@ -1,59 +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
- * @module special-characters/ui/specialcharactersnavigationview
7
- */
8
- import { type Locale } from 'ckeditor5/src/utils.js';
9
- import { FormHeaderView, type DropdownView } from 'ckeditor5/src/ui.js';
10
- /**
11
- * A class representing the navigation part of the special characters UI. It is responsible
12
- * for describing the feature and allowing the user to select a particular character group.
13
- */
14
- export default class SpecialCharactersNavigationView extends FormHeaderView {
15
- /**
16
- * A dropdown that allows selecting a group of special characters to be displayed.
17
- */
18
- groupDropdownView: GroupDropdownView;
19
- /**
20
- * Creates an instance of the {@link module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}
21
- * class.
22
- *
23
- * @param locale The localization services instance.
24
- * @param groupNames The names of the character groups and their displayed labels.
25
- */
26
- constructor(locale: Locale, groupNames: GroupNames);
27
- /**
28
- * Returns the name of the character group currently selected in the {@link #groupDropdownView}.
29
- */
30
- get currentGroupName(): string;
31
- /**
32
- * Focuses the character categories dropdown.
33
- */
34
- focus(): void;
35
- /**
36
- * Returns a dropdown that allows selecting character groups.
37
- *
38
- * @param groupNames The names of the character groups and their displayed labels.
39
- */
40
- private _createGroupDropdown;
41
- /**
42
- * Returns list item definitions to be used in the character group dropdown
43
- * representing specific character groups.
44
- *
45
- * @param dropdown Dropdown view element
46
- * @param groupNames The names of the character groups and their displayed labels.
47
- */
48
- private _getCharacterGroupListItemDefinitions;
49
- }
50
- /**
51
- * The names of the character groups and their displayed labels.
52
- */
53
- export type GroupNames = Map<string, string>;
54
- /**
55
- * `DropdownView` with additional field for the name of the currectly selected character group.
56
- */
57
- export type GroupDropdownView = DropdownView & {
58
- value: string;
59
- };
@@ -1,95 +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
- * @module special-characters/ui/specialcharactersnavigationview
7
- */
8
- import { Collection } from 'ckeditor5/src/utils.js';
9
- import { addListToDropdown, createDropdown, ViewModel, FormHeaderView } from 'ckeditor5/src/ui.js';
10
- /**
11
- * A class representing the navigation part of the special characters UI. It is responsible
12
- * for describing the feature and allowing the user to select a particular character group.
13
- */
14
- export default class SpecialCharactersNavigationView extends FormHeaderView {
15
- /**
16
- * Creates an instance of the {@link module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}
17
- * class.
18
- *
19
- * @param locale The localization services instance.
20
- * @param groupNames The names of the character groups and their displayed labels.
21
- */
22
- constructor(locale, groupNames) {
23
- super(locale);
24
- const t = locale.t;
25
- this.set('class', 'ck-special-characters-navigation');
26
- this.groupDropdownView = this._createGroupDropdown(groupNames);
27
- this.groupDropdownView.panelPosition = locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw';
28
- this.label = t('Special characters');
29
- this.children.add(this.groupDropdownView);
30
- }
31
- /**
32
- * Returns the name of the character group currently selected in the {@link #groupDropdownView}.
33
- */
34
- get currentGroupName() {
35
- return this.groupDropdownView.value;
36
- }
37
- /**
38
- * Focuses the character categories dropdown.
39
- */
40
- focus() {
41
- this.groupDropdownView.focus();
42
- }
43
- /**
44
- * Returns a dropdown that allows selecting character groups.
45
- *
46
- * @param groupNames The names of the character groups and their displayed labels.
47
- */
48
- _createGroupDropdown(groupNames) {
49
- const locale = this.locale;
50
- const t = locale.t;
51
- const dropdown = createDropdown(locale);
52
- const groupDefinitions = this._getCharacterGroupListItemDefinitions(dropdown, groupNames);
53
- const accessibleLabel = t('Character categories');
54
- dropdown.set('value', groupDefinitions.first.model.name);
55
- dropdown.buttonView.bind('label').to(dropdown, 'value', value => groupNames.get(value));
56
- dropdown.buttonView.set({
57
- isOn: false,
58
- withText: true,
59
- tooltip: accessibleLabel,
60
- class: ['ck-dropdown__button_label-width_auto'],
61
- ariaLabel: accessibleLabel,
62
- ariaLabelledBy: undefined
63
- });
64
- dropdown.on('execute', evt => {
65
- dropdown.value = evt.source.name;
66
- });
67
- dropdown.delegate('execute').to(this);
68
- addListToDropdown(dropdown, groupDefinitions, {
69
- ariaLabel: accessibleLabel,
70
- role: 'menu'
71
- });
72
- return dropdown;
73
- }
74
- /**
75
- * Returns list item definitions to be used in the character group dropdown
76
- * representing specific character groups.
77
- *
78
- * @param dropdown Dropdown view element
79
- * @param groupNames The names of the character groups and their displayed labels.
80
- */
81
- _getCharacterGroupListItemDefinitions(dropdown, groupNames) {
82
- const groupDefs = new Collection();
83
- for (const [name, label] of groupNames) {
84
- const model = new ViewModel({
85
- name,
86
- label,
87
- withText: true,
88
- role: 'menuitemradio'
89
- });
90
- model.bind('isOn').to(dropdown, 'value', value => value === model.name);
91
- groupDefs.add({ type: 'button', model });
92
- }
93
- return groupDefs;
94
- }
95
- }