@ckeditor/ckeditor5-special-characters 34.2.0 → 35.1.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/CHANGELOG.md +30 -0
- package/build/special-characters.js +1 -1
- package/build/translations/ar.js +1 -0
- package/build/translations/bg.js +1 -0
- package/build/translations/bn.js +1 -0
- package/build/translations/ca.js +1 -0
- package/build/translations/da.js +1 -0
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/fi.js +1 -0
- package/build/translations/he.js +1 -0
- package/build/translations/hu.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/lt.js +1 -0
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -0
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -0
- package/build/translations/pl.js +1 -1
- package/build/translations/pt.js +1 -0
- package/build/translations/ro.js +1 -0
- package/build/translations/ru.js +1 -1
- package/build/translations/sv.js +1 -0
- package/build/translations/th.js +1 -0
- package/build/translations/uk.js +1 -0
- package/build/translations/ur.js +1 -0
- package/build/translations/vi.js +1 -0
- package/build/translations/zh.js +1 -1
- package/lang/translations/ar.po +1039 -0
- package/lang/translations/bg.po +1041 -0
- package/lang/translations/bn.po +1037 -0
- package/lang/translations/ca.po +1037 -0
- package/lang/translations/da.po +1037 -0
- package/lang/translations/es.po +220 -220
- package/lang/translations/et.po +250 -250
- package/lang/translations/fi.po +1037 -0
- package/lang/translations/he.po +1037 -0
- package/lang/translations/hu.po +233 -233
- package/lang/translations/id.po +205 -205
- package/lang/translations/ja.po +254 -254
- package/lang/translations/ko.po +254 -254
- package/lang/translations/lt.po +1037 -0
- package/lang/translations/lv.po +254 -254
- package/lang/translations/ms.po +1037 -0
- package/lang/translations/nl.po +138 -136
- package/lang/translations/no.po +1039 -0
- package/lang/translations/pl.po +220 -220
- package/lang/translations/pt.po +1037 -0
- package/lang/translations/ro.po +1037 -0
- package/lang/translations/ru.po +253 -253
- package/lang/translations/sv.po +1037 -0
- package/lang/translations/th.po +1037 -0
- package/lang/translations/uk.po +1037 -0
- package/lang/translations/ur.po +1037 -0
- package/lang/translations/vi.po +1037 -0
- package/lang/translations/zh.po +242 -242
- package/package.json +13 -12
- package/src/specialcharacters.js +9 -3
- package/src/ui/charactergridview.js +72 -1
- package/src/ui/specialcharactersnavigationview.js +7 -0
- package/src/ui/specialcharactersview.js +138 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-special-characters",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "35.1.0",
|
|
4
4
|
"description": "Special characters feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -12,19 +12,19 @@
|
|
|
12
12
|
],
|
|
13
13
|
"main": "src/index.js",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"ckeditor5": "^
|
|
15
|
+
"ckeditor5": "^35.1.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@ckeditor/ckeditor5-cloud-services": "^
|
|
19
|
-
"@ckeditor/ckeditor5-core": "^
|
|
18
|
+
"@ckeditor/ckeditor5-cloud-services": "^35.1.0",
|
|
19
|
+
"@ckeditor/ckeditor5-core": "^35.1.0",
|
|
20
20
|
"@ckeditor/ckeditor5-dev-utils": "^30.0.0",
|
|
21
|
-
"@ckeditor/ckeditor5-easy-image": "^
|
|
22
|
-
"@ckeditor/ckeditor5-editor-classic": "^
|
|
23
|
-
"@ckeditor/ckeditor5-image": "^
|
|
24
|
-
"@ckeditor/ckeditor5-theme-lark": "^
|
|
25
|
-
"@ckeditor/ckeditor5-typing": "^
|
|
26
|
-
"@ckeditor/ckeditor5-ui": "^
|
|
27
|
-
"@ckeditor/ckeditor5-utils": "^
|
|
21
|
+
"@ckeditor/ckeditor5-easy-image": "^35.1.0",
|
|
22
|
+
"@ckeditor/ckeditor5-editor-classic": "^35.1.0",
|
|
23
|
+
"@ckeditor/ckeditor5-image": "^35.1.0",
|
|
24
|
+
"@ckeditor/ckeditor5-theme-lark": "^35.1.0",
|
|
25
|
+
"@ckeditor/ckeditor5-typing": "^35.1.0",
|
|
26
|
+
"@ckeditor/ckeditor5-ui": "^35.1.0",
|
|
27
|
+
"@ckeditor/ckeditor5-utils": "^35.1.0",
|
|
28
28
|
"webpack": "^5.58.1",
|
|
29
29
|
"webpack-cli": "^4.9.0"
|
|
30
30
|
},
|
|
@@ -46,7 +46,8 @@
|
|
|
46
46
|
"src",
|
|
47
47
|
"theme",
|
|
48
48
|
"build",
|
|
49
|
-
"ckeditor5-metadata.json"
|
|
49
|
+
"ckeditor5-metadata.json",
|
|
50
|
+
"CHANGELOG.md"
|
|
50
51
|
],
|
|
51
52
|
"scripts": {
|
|
52
53
|
"dll:build": "webpack"
|
package/src/specialcharacters.js
CHANGED
|
@@ -14,6 +14,7 @@ import { CKEditorError } from 'ckeditor5/src/utils';
|
|
|
14
14
|
import SpecialCharactersNavigationView from './ui/specialcharactersnavigationview';
|
|
15
15
|
import CharacterGridView from './ui/charactergridview';
|
|
16
16
|
import CharacterInfoView from './ui/characterinfoview';
|
|
17
|
+
import SpecialCharactersView from './ui/specialcharactersview';
|
|
17
18
|
|
|
18
19
|
import specialCharactersIcon from '../theme/icons/specialcharacters.svg';
|
|
19
20
|
import '../theme/specialcharacters.css';
|
|
@@ -97,9 +98,14 @@ export default class SpecialCharacters extends Plugin {
|
|
|
97
98
|
if ( !dropdownPanelContent ) {
|
|
98
99
|
dropdownPanelContent = this._createDropdownPanelContent( locale, dropdownView );
|
|
99
100
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
const specialCharactersView = new SpecialCharactersView(
|
|
102
|
+
locale,
|
|
103
|
+
dropdownPanelContent.navigationView,
|
|
104
|
+
dropdownPanelContent.gridView,
|
|
105
|
+
dropdownPanelContent.infoView
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
dropdownView.panelView.children.add( specialCharactersView );
|
|
103
109
|
}
|
|
104
110
|
|
|
105
111
|
dropdownPanelContent.infoView.set( {
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
* @module special-characters/ui/charactergridview
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { View, ButtonView } from 'ckeditor5/src/ui';
|
|
10
|
+
import { View, ButtonView, addKeyboardHandlingForGrid } from 'ckeditor5/src/ui';
|
|
11
|
+
|
|
12
|
+
import { KeystrokeHandler, FocusTracker, global } from 'ckeditor5/src/utils';
|
|
11
13
|
|
|
12
14
|
import '../../theme/charactergrid.css';
|
|
13
15
|
|
|
@@ -56,6 +58,33 @@ export default class CharacterGridView extends View {
|
|
|
56
58
|
}
|
|
57
59
|
} );
|
|
58
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Tracks information about the DOM focus in the grid.
|
|
63
|
+
*
|
|
64
|
+
* @readonly
|
|
65
|
+
* @member {module:utils/focustracker~FocusTracker}
|
|
66
|
+
*/
|
|
67
|
+
this.focusTracker = new FocusTracker();
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
71
|
+
*
|
|
72
|
+
* @readonly
|
|
73
|
+
* @member {module:utils/keystrokehandler~KeystrokeHandler}
|
|
74
|
+
*/
|
|
75
|
+
this.keystrokes = new KeystrokeHandler();
|
|
76
|
+
|
|
77
|
+
addKeyboardHandlingForGrid( {
|
|
78
|
+
keystrokeHandler: this.keystrokes,
|
|
79
|
+
focusTracker: this.focusTracker,
|
|
80
|
+
gridItems: this.tiles,
|
|
81
|
+
numberOfColumns: () => global.window
|
|
82
|
+
.getComputedStyle( this.element.firstChild ) // Responsive .ck-character-grid__tiles
|
|
83
|
+
.getPropertyValue( 'grid-template-columns' )
|
|
84
|
+
.split( ' ' )
|
|
85
|
+
.length
|
|
86
|
+
} );
|
|
87
|
+
|
|
59
88
|
/**
|
|
60
89
|
* Fired when any of {@link #tiles grid tiles} is clicked.
|
|
61
90
|
*
|
|
@@ -113,4 +142,46 @@ export default class CharacterGridView extends View {
|
|
|
113
142
|
|
|
114
143
|
return tile;
|
|
115
144
|
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* @inheritDoc
|
|
148
|
+
*/
|
|
149
|
+
render() {
|
|
150
|
+
super.render();
|
|
151
|
+
|
|
152
|
+
for ( const item of this.tiles ) {
|
|
153
|
+
this.focusTracker.add( item.element );
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
this.tiles.on( 'change', ( eventInfo, { added, removed } ) => {
|
|
157
|
+
if ( added.length > 0 ) {
|
|
158
|
+
for ( const item of added ) {
|
|
159
|
+
this.focusTracker.add( item.element );
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
if ( removed.length > 0 ) {
|
|
163
|
+
for ( const item of removed ) {
|
|
164
|
+
this.focusTracker.remove( item.element );
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
} );
|
|
168
|
+
|
|
169
|
+
this.keystrokes.listenTo( this.element );
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @inheritDoc
|
|
174
|
+
*/
|
|
175
|
+
destroy() {
|
|
176
|
+
super.destroy();
|
|
177
|
+
|
|
178
|
+
this.keystrokes.destroy();
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Focuses the first focusable in {@link #tiles}.
|
|
183
|
+
*/
|
|
184
|
+
focus() {
|
|
185
|
+
this.tiles.get( 0 ).focus();
|
|
186
|
+
}
|
|
116
187
|
}
|
|
@@ -59,6 +59,13 @@ export default class SpecialCharactersNavigationView extends FormHeaderView {
|
|
|
59
59
|
return this.groupDropdownView.value;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Focuses the character categories dropdown.
|
|
64
|
+
*/
|
|
65
|
+
focus() {
|
|
66
|
+
this.groupDropdownView.focus();
|
|
67
|
+
}
|
|
68
|
+
|
|
62
69
|
/**
|
|
63
70
|
* Returns a dropdown that allows selecting character groups.
|
|
64
71
|
*
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2022, 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
|
+
/**
|
|
7
|
+
* @module special-characters/ui/specialcharactersview
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { View, FocusCycler } from 'ckeditor5/src/ui';
|
|
11
|
+
import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A view that glues pieces of the special characters dropdown panel together:
|
|
15
|
+
*
|
|
16
|
+
* * the navigation view (allows selecting the category),
|
|
17
|
+
* * the grid view (displays characters as a grid),
|
|
18
|
+
* * and the info view (displays detailed info about a specific character).
|
|
19
|
+
*
|
|
20
|
+
* @extends module:ui/view~View
|
|
21
|
+
*/
|
|
22
|
+
export default class SpecialCharactersView extends View {
|
|
23
|
+
/**
|
|
24
|
+
* Creates an instance of the `SpecialCharactersView`.
|
|
25
|
+
*
|
|
26
|
+
* @param {module:utils/locale~Locale} locale The localization services instance.
|
|
27
|
+
* @param {module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView} navigationView
|
|
28
|
+
* @param {module:special-characters/ui/charactergridview~CharacterGridView} gridView
|
|
29
|
+
* @param {module:special-characters/ui/characterinfoview~CharacterInfoView} infoView
|
|
30
|
+
*/
|
|
31
|
+
constructor( locale, navigationView, gridView, infoView ) {
|
|
32
|
+
super( locale );
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A collection of the focusable children of the view.
|
|
36
|
+
*
|
|
37
|
+
* @readonly
|
|
38
|
+
* @member {module:ui/viewcollection~ViewCollection}
|
|
39
|
+
*/
|
|
40
|
+
this.items = this.createCollection();
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Tracks information about the DOM focus in the view.
|
|
44
|
+
*
|
|
45
|
+
* @readonly
|
|
46
|
+
* @member {module:utils/focustracker~FocusTracker}
|
|
47
|
+
*/
|
|
48
|
+
this.focusTracker = new FocusTracker();
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
52
|
+
*
|
|
53
|
+
* @readonly
|
|
54
|
+
* @member {module:utils/keystrokehandler~KeystrokeHandler}
|
|
55
|
+
*/
|
|
56
|
+
this.keystrokes = new KeystrokeHandler();
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Helps cycling over focusable {@link #items} in the view.
|
|
60
|
+
*
|
|
61
|
+
* @readonly
|
|
62
|
+
* @protected
|
|
63
|
+
* @member {module:ui/focuscycler~FocusCycler}
|
|
64
|
+
*/
|
|
65
|
+
this._focusCycler = new FocusCycler( {
|
|
66
|
+
focusables: this.items,
|
|
67
|
+
focusTracker: this.focusTracker,
|
|
68
|
+
keystrokeHandler: this.keystrokes,
|
|
69
|
+
actions: {
|
|
70
|
+
focusPrevious: 'shift + tab',
|
|
71
|
+
focusNext: 'tab'
|
|
72
|
+
}
|
|
73
|
+
} );
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* An instance of the `SpecialCharactersNavigationView`.
|
|
77
|
+
*
|
|
78
|
+
* @member {module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}
|
|
79
|
+
*/
|
|
80
|
+
this.navigationView = navigationView;
|
|
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
|
+
} );
|
|
104
|
+
|
|
105
|
+
this.items.add( this.navigationView.groupDropdownView.buttonView );
|
|
106
|
+
this.items.add( this.gridView );
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @inheritDoc
|
|
111
|
+
*/
|
|
112
|
+
render() {
|
|
113
|
+
super.render();
|
|
114
|
+
|
|
115
|
+
this.focusTracker.add( this.navigationView.groupDropdownView.buttonView.element );
|
|
116
|
+
this.focusTracker.add( this.gridView.element );
|
|
117
|
+
|
|
118
|
+
// Start listening for the keystrokes coming from #element.
|
|
119
|
+
this.keystrokes.listenTo( this.element );
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @inheritDoc
|
|
124
|
+
*/
|
|
125
|
+
destroy() {
|
|
126
|
+
super.destroy();
|
|
127
|
+
|
|
128
|
+
this.focusTracker.destroy();
|
|
129
|
+
this.keystrokes.destroy();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Focuses the first focusable in {@link #items}.
|
|
134
|
+
*/
|
|
135
|
+
focus() {
|
|
136
|
+
this.navigationView.focus();
|
|
137
|
+
}
|
|
138
|
+
}
|