@ckeditor/ckeditor5-special-characters 36.0.1 → 37.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/build/special-characters.js +1 -1
- package/package.json +20 -15
- package/src/augmentation.d.ts +24 -0
- package/src/augmentation.js +5 -0
- package/src/index.d.ts +16 -0
- package/src/index.js +1 -2
- package/src/specialcharacters.d.ts +95 -0
- package/src/specialcharacters.js +181 -330
- package/src/specialcharactersarrows.d.ts +30 -0
- package/src/specialcharactersarrows.js +46 -50
- package/src/specialcharactersconfig.d.ts +51 -0
- package/src/specialcharactersconfig.js +5 -0
- package/src/specialcharacterscurrency.d.ts +30 -0
- package/src/specialcharacterscurrency.js +60 -64
- package/src/specialcharactersessentials.d.ts +30 -0
- package/src/specialcharactersessentials.js +26 -24
- package/src/specialcharacterslatin.d.ts +30 -0
- package/src/specialcharacterslatin.js +152 -156
- package/src/specialcharactersmathematical.d.ts +30 -0
- package/src/specialcharactersmathematical.js +68 -72
- package/src/specialcharacterstext.d.ts +30 -0
- package/src/specialcharacterstext.js +51 -55
- package/src/ui/charactergridview.d.ts +94 -0
- package/src/ui/charactergridview.js +113 -186
- package/src/ui/characterinfoview.d.ts +35 -0
- package/src/ui/characterinfoview.js +58 -98
- package/src/ui/specialcharactersnavigationview.d.ts +59 -0
- package/src/ui/specialcharactersnavigationview.js +74 -121
- package/src/ui/specialcharactersview.d.ts +65 -0
- package/src/ui/specialcharactersview.js +60 -125
|
@@ -2,142 +2,77 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* @module special-characters/ui/specialcharactersview
|
|
8
7
|
*/
|
|
9
|
-
|
|
10
8
|
import { View, FocusCycler } from 'ckeditor5/src/ui';
|
|
11
9
|
import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils';
|
|
12
|
-
|
|
13
10
|
/**
|
|
14
11
|
* A view that glues pieces of the special characters dropdown panel together:
|
|
15
12
|
*
|
|
16
13
|
* * the navigation view (allows selecting the category),
|
|
17
14
|
* * the grid view (displays characters as a grid),
|
|
18
15
|
* * and the info view (displays detailed info about a specific character).
|
|
19
|
-
*
|
|
20
|
-
* @extends module:ui/view~View
|
|
21
16
|
*/
|
|
22
17
|
export default class SpecialCharactersView extends View {
|
|
23
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
* An instance of the `CharacterGridView`.
|
|
84
|
-
*
|
|
85
|
-
* @member {module:special-characters/ui/charactergridview~CharacterGridView}
|
|
86
|
-
*/
|
|
87
|
-
this.gridView = gridView;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* An instance of the `CharacterInfoView`.
|
|
91
|
-
*
|
|
92
|
-
* @member {module:special-characters/ui/characterinfoview~CharacterInfoView}
|
|
93
|
-
*/
|
|
94
|
-
this.infoView = infoView;
|
|
95
|
-
|
|
96
|
-
this.setTemplate( {
|
|
97
|
-
tag: 'div',
|
|
98
|
-
children: [
|
|
99
|
-
this.navigationView,
|
|
100
|
-
this.gridView,
|
|
101
|
-
this.infoView
|
|
102
|
-
],
|
|
103
|
-
attributes: {
|
|
104
|
-
// Avoid focus loss when the user clicks the area of the grid that is not a button.
|
|
105
|
-
// https://github.com/ckeditor/ckeditor5/pull/12319#issuecomment-1231779819
|
|
106
|
-
tabindex: '-1'
|
|
107
|
-
}
|
|
108
|
-
} );
|
|
109
|
-
|
|
110
|
-
this.items.add( this.navigationView.groupDropdownView.buttonView );
|
|
111
|
-
this.items.add( this.gridView );
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* @inheritDoc
|
|
116
|
-
*/
|
|
117
|
-
render() {
|
|
118
|
-
super.render();
|
|
119
|
-
|
|
120
|
-
this.focusTracker.add( this.navigationView.groupDropdownView.buttonView.element );
|
|
121
|
-
this.focusTracker.add( this.gridView.element );
|
|
122
|
-
|
|
123
|
-
// Start listening for the keystrokes coming from #element.
|
|
124
|
-
this.keystrokes.listenTo( this.element );
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* @inheritDoc
|
|
129
|
-
*/
|
|
130
|
-
destroy() {
|
|
131
|
-
super.destroy();
|
|
132
|
-
|
|
133
|
-
this.focusTracker.destroy();
|
|
134
|
-
this.keystrokes.destroy();
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Focuses the first focusable in {@link #items}.
|
|
139
|
-
*/
|
|
140
|
-
focus() {
|
|
141
|
-
this.navigationView.focus();
|
|
142
|
-
}
|
|
18
|
+
/**
|
|
19
|
+
* Creates an instance of the `SpecialCharactersView`.
|
|
20
|
+
*/
|
|
21
|
+
constructor(locale, navigationView, gridView, infoView) {
|
|
22
|
+
super(locale);
|
|
23
|
+
this.navigationView = navigationView;
|
|
24
|
+
this.gridView = gridView;
|
|
25
|
+
this.infoView = infoView;
|
|
26
|
+
this.items = this.createCollection();
|
|
27
|
+
this.focusTracker = new FocusTracker();
|
|
28
|
+
this.keystrokes = new KeystrokeHandler();
|
|
29
|
+
this._focusCycler = new FocusCycler({
|
|
30
|
+
focusables: this.items,
|
|
31
|
+
focusTracker: this.focusTracker,
|
|
32
|
+
keystrokeHandler: this.keystrokes,
|
|
33
|
+
actions: {
|
|
34
|
+
focusPrevious: 'shift + tab',
|
|
35
|
+
focusNext: 'tab'
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
this.setTemplate({
|
|
39
|
+
tag: 'div',
|
|
40
|
+
children: [
|
|
41
|
+
this.navigationView,
|
|
42
|
+
this.gridView,
|
|
43
|
+
this.infoView
|
|
44
|
+
],
|
|
45
|
+
attributes: {
|
|
46
|
+
// Avoid focus loss when the user clicks the area of the grid that is not a button.
|
|
47
|
+
// https://github.com/ckeditor/ckeditor5/pull/12319#issuecomment-1231779819
|
|
48
|
+
tabindex: '-1'
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
this.items.add(this.navigationView.groupDropdownView.buttonView);
|
|
52
|
+
this.items.add(this.gridView);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @inheritDoc
|
|
56
|
+
*/
|
|
57
|
+
render() {
|
|
58
|
+
super.render();
|
|
59
|
+
this.focusTracker.add(this.navigationView.groupDropdownView.buttonView.element);
|
|
60
|
+
this.focusTracker.add(this.gridView.element);
|
|
61
|
+
// Start listening for the keystrokes coming from #element.
|
|
62
|
+
this.keystrokes.listenTo(this.element);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @inheritDoc
|
|
66
|
+
*/
|
|
67
|
+
destroy() {
|
|
68
|
+
super.destroy();
|
|
69
|
+
this.focusTracker.destroy();
|
|
70
|
+
this.keystrokes.destroy();
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Focuses the first focusable in {@link #items}.
|
|
74
|
+
*/
|
|
75
|
+
focus() {
|
|
76
|
+
this.navigationView.focus();
|
|
77
|
+
}
|
|
143
78
|
}
|