@ckeditor/ckeditor5-special-characters 30.0.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/LICENSE.md +17 -0
- package/README.md +21 -0
- package/build/special-characters.js +5 -0
- package/build/translations/cs.js +1 -0
- package/build/translations/de.js +1 -0
- package/build/translations/en-au.js +1 -0
- package/build/translations/es.js +1 -0
- package/build/translations/et.js +1 -0
- package/build/translations/fa.js +1 -0
- package/build/translations/fr.js +1 -0
- package/build/translations/gl.js +1 -0
- package/build/translations/hi.js +1 -0
- package/build/translations/hu.js +1 -0
- package/build/translations/it.js +1 -0
- package/build/translations/ja.js +1 -0
- package/build/translations/ko.js +1 -0
- package/build/translations/pl.js +1 -0
- package/build/translations/pt-br.js +1 -0
- package/build/translations/ru.js +1 -0
- package/build/translations/sk.js +1 -0
- package/build/translations/sr-latn.js +1 -0
- package/build/translations/sr.js +1 -0
- package/build/translations/tk.js +1 -0
- package/build/translations/tr.js +1 -0
- package/build/translations/zh-cn.js +1 -0
- package/build/translations/zh.js +1 -0
- package/ckeditor5-metadata.json +78 -0
- package/lang/contexts.json +257 -0
- package/lang/translations/cs.po +1037 -0
- package/lang/translations/de.po +1037 -0
- package/lang/translations/en-au.po +1037 -0
- package/lang/translations/en.po +1037 -0
- package/lang/translations/es.po +1037 -0
- package/lang/translations/et.po +1037 -0
- package/lang/translations/fa.po +1037 -0
- package/lang/translations/fr.po +1037 -0
- package/lang/translations/gl.po +1037 -0
- package/lang/translations/hi.po +1037 -0
- package/lang/translations/hu.po +1037 -0
- package/lang/translations/it.po +1037 -0
- package/lang/translations/ja.po +1037 -0
- package/lang/translations/ko.po +1037 -0
- package/lang/translations/pl.po +1037 -0
- package/lang/translations/pt-br.po +1037 -0
- package/lang/translations/ru.po +1037 -0
- package/lang/translations/sk.po +1037 -0
- package/lang/translations/sr-latn.po +1037 -0
- package/lang/translations/sr.po +1037 -0
- package/lang/translations/tk.po +1037 -0
- package/lang/translations/tr.po +1037 -0
- package/lang/translations/zh-cn.po +1037 -0
- package/lang/translations/zh.po +1037 -0
- package/package.json +54 -0
- package/src/index.js +16 -0
- package/src/specialcharacters.js +254 -0
- package/src/specialcharactersarrows.js +60 -0
- package/src/specialcharacterscurrency.js +78 -0
- package/src/specialcharactersessentials.js +43 -0
- package/src/specialcharacterslatin.js +170 -0
- package/src/specialcharactersmathematical.js +86 -0
- package/src/specialcharacterstext.js +69 -0
- package/src/ui/charactergridview.js +116 -0
- package/src/ui/characterinfoview.js +111 -0
- package/src/ui/specialcharactersnavigationview.js +127 -0
- package/theme/charactergrid.css +12 -0
- package/theme/characterinfo.css +9 -0
- package/theme/icons/specialcharacters.svg +1 -0
- package/theme/specialcharacters.css +10 -0
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ckeditor/ckeditor5-special-characters",
|
|
3
|
+
"version": "30.0.0",
|
|
4
|
+
"description": "Special characters feature for CKEditor 5.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ckeditor",
|
|
7
|
+
"ckeditor5",
|
|
8
|
+
"ckeditor 5",
|
|
9
|
+
"ckeditor5-feature",
|
|
10
|
+
"ckeditor5-plugin",
|
|
11
|
+
"ckeditor5-dll"
|
|
12
|
+
],
|
|
13
|
+
"main": "src/index.js",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"ckeditor5": "^30.0.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@ckeditor/ckeditor5-cloud-services": "^30.0.0",
|
|
19
|
+
"@ckeditor/ckeditor5-core": "^30.0.0",
|
|
20
|
+
"@ckeditor/ckeditor5-dev-utils": "^25.4.0",
|
|
21
|
+
"@ckeditor/ckeditor5-easy-image": "^30.0.0",
|
|
22
|
+
"@ckeditor/ckeditor5-editor-classic": "^30.0.0",
|
|
23
|
+
"@ckeditor/ckeditor5-image": "^30.0.0",
|
|
24
|
+
"@ckeditor/ckeditor5-theme-lark": "^30.0.0",
|
|
25
|
+
"@ckeditor/ckeditor5-typing": "^30.0.0",
|
|
26
|
+
"@ckeditor/ckeditor5-ui": "^30.0.0",
|
|
27
|
+
"@ckeditor/ckeditor5-utils": "^30.0.0",
|
|
28
|
+
"webpack": "^4.43.0",
|
|
29
|
+
"webpack-cli": "^3.3.11"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=12.0.0",
|
|
33
|
+
"npm": ">=5.7.1"
|
|
34
|
+
},
|
|
35
|
+
"author": "CKSource (http://cksource.com/)",
|
|
36
|
+
"license": "GPL-2.0-or-later",
|
|
37
|
+
"homepage": "https://ckeditor.com",
|
|
38
|
+
"bugs": "https://github.com/ckeditor/ckeditor5/issues",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/ckeditor/ckeditor5.git",
|
|
42
|
+
"directory": "packages/ckeditor5-special-characters"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"lang",
|
|
46
|
+
"src",
|
|
47
|
+
"theme",
|
|
48
|
+
"build",
|
|
49
|
+
"ckeditor5-metadata.json"
|
|
50
|
+
],
|
|
51
|
+
"scripts": {
|
|
52
|
+
"dll:build": "webpack"
|
|
53
|
+
}
|
|
54
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @module special-characters
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export { default as SpecialCharacters } from './specialcharacters';
|
|
11
|
+
export { default as SpecialCharactersArrows } from './specialcharactersarrows';
|
|
12
|
+
export { default as SpecialCharactersText } from './specialcharacterstext';
|
|
13
|
+
export { default as SpecialCharactersMathematical } from './specialcharactersmathematical';
|
|
14
|
+
export { default as SpecialCharactersLatin } from './specialcharacterslatin';
|
|
15
|
+
export { default as SpecialCharactersEssentials } from './specialcharactersessentials';
|
|
16
|
+
export { default as SpecialCharactersCurrency } from './specialcharacterscurrency';
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @module special-characters/specialcharacters
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
11
|
+
import { Typing } from 'ckeditor5/src/typing';
|
|
12
|
+
import { createDropdown } from 'ckeditor5/src/ui';
|
|
13
|
+
import { CKEditorError } from 'ckeditor5/src/utils';
|
|
14
|
+
import SpecialCharactersNavigationView from './ui/specialcharactersnavigationview';
|
|
15
|
+
import CharacterGridView from './ui/charactergridview';
|
|
16
|
+
import CharacterInfoView from './ui/characterinfoview';
|
|
17
|
+
|
|
18
|
+
import specialCharactersIcon from '../theme/icons/specialcharacters.svg';
|
|
19
|
+
import '../theme/specialcharacters.css';
|
|
20
|
+
|
|
21
|
+
const ALL_SPECIAL_CHARACTERS_GROUP = 'All';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The special characters feature.
|
|
25
|
+
*
|
|
26
|
+
* Introduces the `'specialCharacters'` dropdown.
|
|
27
|
+
*
|
|
28
|
+
* @extends module:core/plugin~Plugin
|
|
29
|
+
*/
|
|
30
|
+
export default class SpecialCharacters extends Plugin {
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
static get requires() {
|
|
35
|
+
return [ Typing ];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @inheritDoc
|
|
40
|
+
*/
|
|
41
|
+
static get pluginName() {
|
|
42
|
+
return 'SpecialCharacters';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @inheritDoc
|
|
47
|
+
*/
|
|
48
|
+
constructor( editor ) {
|
|
49
|
+
super( editor );
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Registered characters. A pair of a character name and its symbol.
|
|
53
|
+
*
|
|
54
|
+
* @private
|
|
55
|
+
* @member {Map.<String, String>} #_characters
|
|
56
|
+
*/
|
|
57
|
+
this._characters = new Map();
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Registered groups. Each group contains a collection with symbol names.
|
|
61
|
+
*
|
|
62
|
+
* @private
|
|
63
|
+
* @member {Map.<String, Set.<String>>} #_groups
|
|
64
|
+
*/
|
|
65
|
+
this._groups = new Map();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @inheritDoc
|
|
70
|
+
*/
|
|
71
|
+
init() {
|
|
72
|
+
const editor = this.editor;
|
|
73
|
+
const t = editor.t;
|
|
74
|
+
|
|
75
|
+
const inputCommand = editor.commands.get( 'input' );
|
|
76
|
+
|
|
77
|
+
// Add the `specialCharacters` dropdown button to feature components.
|
|
78
|
+
editor.ui.componentFactory.add( 'specialCharacters', locale => {
|
|
79
|
+
const dropdownView = createDropdown( locale );
|
|
80
|
+
let dropdownPanelContent;
|
|
81
|
+
|
|
82
|
+
dropdownView.buttonView.set( {
|
|
83
|
+
label: t( 'Special characters' ),
|
|
84
|
+
icon: specialCharactersIcon,
|
|
85
|
+
tooltip: true
|
|
86
|
+
} );
|
|
87
|
+
|
|
88
|
+
dropdownView.bind( 'isEnabled' ).to( inputCommand );
|
|
89
|
+
|
|
90
|
+
// Insert a special character when a tile was clicked.
|
|
91
|
+
dropdownView.on( 'execute', ( evt, data ) => {
|
|
92
|
+
editor.execute( 'input', { text: data.character } );
|
|
93
|
+
editor.editing.view.focus();
|
|
94
|
+
} );
|
|
95
|
+
|
|
96
|
+
dropdownView.on( 'change:isOpen', () => {
|
|
97
|
+
if ( !dropdownPanelContent ) {
|
|
98
|
+
dropdownPanelContent = this._createDropdownPanelContent( locale, dropdownView );
|
|
99
|
+
|
|
100
|
+
dropdownView.panelView.children.add( dropdownPanelContent.navigationView );
|
|
101
|
+
dropdownView.panelView.children.add( dropdownPanelContent.gridView );
|
|
102
|
+
dropdownView.panelView.children.add( dropdownPanelContent.infoView );
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
dropdownPanelContent.infoView.set( {
|
|
106
|
+
character: null,
|
|
107
|
+
name: null
|
|
108
|
+
} );
|
|
109
|
+
} );
|
|
110
|
+
|
|
111
|
+
return dropdownView;
|
|
112
|
+
} );
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Adds a collection of special characters to the specified group. The title of a special character must be unique.
|
|
117
|
+
*
|
|
118
|
+
* **Note:** The "All" category name is reserved by the plugin and cannot be used as a new name for a special
|
|
119
|
+
* characters category.
|
|
120
|
+
*
|
|
121
|
+
* @param {String} groupName
|
|
122
|
+
* @param {Array.<module:special-characters/specialcharacters~SpecialCharacterDefinition>} items
|
|
123
|
+
*/
|
|
124
|
+
addItems( groupName, items ) {
|
|
125
|
+
if ( groupName === ALL_SPECIAL_CHARACTERS_GROUP ) {
|
|
126
|
+
/**
|
|
127
|
+
* The name "All" for a special category group cannot be used because it is a special category that displays all
|
|
128
|
+
* available special characters.
|
|
129
|
+
*
|
|
130
|
+
* @error special-character-invalid-group-name
|
|
131
|
+
*/
|
|
132
|
+
throw new CKEditorError(
|
|
133
|
+
`special-character-invalid-group-name: The name "${ ALL_SPECIAL_CHARACTERS_GROUP }" is reserved and cannot be used.`
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const group = this._getGroup( groupName );
|
|
138
|
+
|
|
139
|
+
for ( const item of items ) {
|
|
140
|
+
group.add( item.title );
|
|
141
|
+
this._characters.set( item.title, item.character );
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Returns an iterator of special characters groups.
|
|
147
|
+
*
|
|
148
|
+
* @returns {Iterable.<String>}
|
|
149
|
+
*/
|
|
150
|
+
getGroups() {
|
|
151
|
+
return this._groups.keys();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Returns a collection of special characters symbol names (titles).
|
|
156
|
+
*
|
|
157
|
+
* @param {String} groupName
|
|
158
|
+
* @returns {Set.<String>|undefined}
|
|
159
|
+
*/
|
|
160
|
+
getCharactersForGroup( groupName ) {
|
|
161
|
+
if ( groupName === ALL_SPECIAL_CHARACTERS_GROUP ) {
|
|
162
|
+
return new Set( this._characters.keys() );
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return this._groups.get( groupName );
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Returns the symbol of a special character for the specified name. If the special character could not be found, `undefined`
|
|
170
|
+
* is returned.
|
|
171
|
+
*
|
|
172
|
+
* @param {String} title The title of a special character.
|
|
173
|
+
* @returns {String|undefined}
|
|
174
|
+
*/
|
|
175
|
+
getCharacter( title ) {
|
|
176
|
+
return this._characters.get( title );
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Returns a group of special characters. If the group with the specified name does not exist, it will be created.
|
|
181
|
+
*
|
|
182
|
+
* @private
|
|
183
|
+
* @param {String} groupName The name of the group to create.
|
|
184
|
+
*/
|
|
185
|
+
_getGroup( groupName ) {
|
|
186
|
+
if ( !this._groups.has( groupName ) ) {
|
|
187
|
+
this._groups.set( groupName, new Set() );
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return this._groups.get( groupName );
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Updates the symbol grid depending on the currently selected character group.
|
|
195
|
+
*
|
|
196
|
+
* @private
|
|
197
|
+
* @param {String} currentGroupName
|
|
198
|
+
* @param {module:special-characters/ui/charactergridview~CharacterGridView} gridView
|
|
199
|
+
*/
|
|
200
|
+
_updateGrid( currentGroupName, gridView ) {
|
|
201
|
+
// Updating the grid starts with removing all tiles belonging to the old group.
|
|
202
|
+
gridView.tiles.clear();
|
|
203
|
+
|
|
204
|
+
const characterTitles = this.getCharactersForGroup( currentGroupName );
|
|
205
|
+
|
|
206
|
+
for ( const title of characterTitles ) {
|
|
207
|
+
const character = this.getCharacter( title );
|
|
208
|
+
|
|
209
|
+
gridView.tiles.add( gridView.createTile( character, title ) );
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Initializes the dropdown, used for lazy loading.
|
|
215
|
+
*
|
|
216
|
+
* @private
|
|
217
|
+
* @param {module:utils/locale~Locale} locale
|
|
218
|
+
* @param {module:ui/dropdown/dropdownview~DropdownView} dropdownView
|
|
219
|
+
* @returns {Object} Returns an object with `navigationView`, `gridView` and `infoView` properties, containing UI parts.
|
|
220
|
+
*/
|
|
221
|
+
_createDropdownPanelContent( locale, dropdownView ) {
|
|
222
|
+
const specialCharsGroups = [ ...this.getGroups() ];
|
|
223
|
+
|
|
224
|
+
// Add a special group that shows all available special characters.
|
|
225
|
+
specialCharsGroups.unshift( ALL_SPECIAL_CHARACTERS_GROUP );
|
|
226
|
+
|
|
227
|
+
const navigationView = new SpecialCharactersNavigationView( locale, specialCharsGroups );
|
|
228
|
+
const gridView = new CharacterGridView( locale );
|
|
229
|
+
const infoView = new CharacterInfoView( locale );
|
|
230
|
+
|
|
231
|
+
gridView.delegate( 'execute' ).to( dropdownView );
|
|
232
|
+
|
|
233
|
+
gridView.on( 'tileHover', ( evt, data ) => {
|
|
234
|
+
infoView.set( data );
|
|
235
|
+
} );
|
|
236
|
+
|
|
237
|
+
// Update the grid of special characters when a user changed the character group.
|
|
238
|
+
navigationView.on( 'execute', () => {
|
|
239
|
+
this._updateGrid( navigationView.currentGroupName, gridView );
|
|
240
|
+
} );
|
|
241
|
+
|
|
242
|
+
// Set the initial content of the special characters grid.
|
|
243
|
+
this._updateGrid( navigationView.currentGroupName, gridView );
|
|
244
|
+
|
|
245
|
+
return { navigationView, gridView, infoView };
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* @typedef {Object} module:special-characters/specialcharacters~SpecialCharacterDefinition
|
|
251
|
+
*
|
|
252
|
+
* @property {String} title A unique name of the character (e.g. "greek small letter epsilon").
|
|
253
|
+
* @property {String} character A human-readable character displayed as the label (e.g. "ε").
|
|
254
|
+
*/
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @module special-characters/specialcharactersarrows
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A plugin that provides special characters for the "Arrows" category.
|
|
14
|
+
*
|
|
15
|
+
* ClassicEditor
|
|
16
|
+
* .create( {
|
|
17
|
+
* plugins: [ ..., SpecialCharacters, SpecialCharactersArrows ],
|
|
18
|
+
* } )
|
|
19
|
+
* .then( ... )
|
|
20
|
+
* .catch( ... );
|
|
21
|
+
*
|
|
22
|
+
* @extends module:core/plugin~Plugin
|
|
23
|
+
*/
|
|
24
|
+
export default class SpecialCharactersArrows extends Plugin {
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get pluginName() {
|
|
29
|
+
return 'SpecialCharactersArrows';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
init() {
|
|
36
|
+
const editor = this.editor;
|
|
37
|
+
const t = editor.t;
|
|
38
|
+
|
|
39
|
+
editor.plugins.get( 'SpecialCharacters' ).addItems( 'Arrows', [
|
|
40
|
+
{ title: t( 'leftwards double arrow' ), character: '⇐' },
|
|
41
|
+
{ title: t( 'rightwards double arrow' ), character: '⇒' },
|
|
42
|
+
{ title: t( 'upwards double arrow' ), character: '⇑' },
|
|
43
|
+
{ title: t( 'downwards double arrow' ), character: '⇓' },
|
|
44
|
+
{ title: t( 'leftwards dashed arrow' ), character: '⇠' },
|
|
45
|
+
{ title: t( 'rightwards dashed arrow' ), character: '⇢' },
|
|
46
|
+
{ title: t( 'upwards dashed arrow' ), character: '⇡' },
|
|
47
|
+
{ title: t( 'downwards dashed arrow' ), character: '⇣' },
|
|
48
|
+
{ title: t( 'leftwards arrow to bar' ), character: '⇤' },
|
|
49
|
+
{ title: t( 'rightwards arrow to bar' ), character: '⇥' },
|
|
50
|
+
{ title: t( 'upwards arrow to bar' ), character: '⤒' },
|
|
51
|
+
{ title: t( 'downwards arrow to bar' ), character: '⤓' },
|
|
52
|
+
{ title: t( 'up down arrow with base' ), character: '↨' },
|
|
53
|
+
{ title: t( 'back with leftwards arrow above' ), character: '🔙' },
|
|
54
|
+
{ title: t( 'end with leftwards arrow above' ), character: '🔚' },
|
|
55
|
+
{ title: t( 'on with exclamation mark with left right arrow above' ), character: '🔛' },
|
|
56
|
+
{ title: t( 'soon with rightwards arrow above' ), character: '🔜' },
|
|
57
|
+
{ title: t( 'top with upwards arrow above' ), character: '🔝' }
|
|
58
|
+
] );
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @module special-characters/specialcharacterscurrency
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A plugin that provides special characters for the "Currency" category.
|
|
14
|
+
*
|
|
15
|
+
* ClassicEditor
|
|
16
|
+
* .create( {
|
|
17
|
+
* plugins: [ ..., SpecialCharacters, SpecialCharactersCurrency ],
|
|
18
|
+
* } )
|
|
19
|
+
* .then( ... )
|
|
20
|
+
* .catch( ... );
|
|
21
|
+
*
|
|
22
|
+
* @extends module:core/plugin~Plugin
|
|
23
|
+
*/
|
|
24
|
+
export default class SpecialCharactersCurrency extends Plugin {
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get pluginName() {
|
|
29
|
+
return 'SpecialCharactersCurrency';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
init() {
|
|
36
|
+
const editor = this.editor;
|
|
37
|
+
const t = editor.t;
|
|
38
|
+
|
|
39
|
+
editor.plugins.get( 'SpecialCharacters' ).addItems( 'Currency', [
|
|
40
|
+
{ character: '$', title: t( 'Dollar sign' ) },
|
|
41
|
+
{ character: '€', title: t( 'Euro sign' ) },
|
|
42
|
+
{ character: '¥', title: t( 'Yen sign' ) },
|
|
43
|
+
{ character: '£', title: t( 'Pound sign' ) },
|
|
44
|
+
{ character: '¢', title: t( 'Cent sign' ) },
|
|
45
|
+
{ character: '₠', title: t( 'Euro-currency sign' ) },
|
|
46
|
+
{ character: '₡', title: t( 'Colon sign' ) },
|
|
47
|
+
{ character: '₢', title: t( 'Cruzeiro sign' ) },
|
|
48
|
+
{ character: '₣', title: t( 'French franc sign' ) },
|
|
49
|
+
{ character: '₤', title: t( 'Lira sign' ) },
|
|
50
|
+
{ character: '¤', title: t( 'Currency sign' ) },
|
|
51
|
+
{ character: '₿', title: t( 'Bitcoin sign' ) },
|
|
52
|
+
{ character: '₥', title: t( 'Mill sign' ) },
|
|
53
|
+
{ character: '₦', title: t( 'Naira sign' ) },
|
|
54
|
+
{ character: '₧', title: t( 'Peseta sign' ) },
|
|
55
|
+
{ character: '₨', title: t( 'Rupee sign' ) },
|
|
56
|
+
{ character: '₩', title: t( 'Won sign' ) },
|
|
57
|
+
{ character: '₪', title: t( 'New sheqel sign' ) },
|
|
58
|
+
{ character: '₫', title: t( 'Dong sign' ) },
|
|
59
|
+
{ character: '₭', title: t( 'Kip sign' ) },
|
|
60
|
+
{ character: '₮', title: t( 'Tugrik sign' ) },
|
|
61
|
+
{ character: '₯', title: t( 'Drachma sign' ) },
|
|
62
|
+
{ character: '₰', title: t( 'German penny sign' ) },
|
|
63
|
+
{ character: '₱', title: t( 'Peso sign' ) },
|
|
64
|
+
{ character: '₲', title: t( 'Guarani sign' ) },
|
|
65
|
+
{ character: '₳', title: t( 'Austral sign' ) },
|
|
66
|
+
{ character: '₴', title: t( 'Hryvnia sign' ) },
|
|
67
|
+
{ character: '₵', title: t( 'Cedi sign' ) },
|
|
68
|
+
{ character: '₶', title: t( 'Livre tournois sign' ) },
|
|
69
|
+
{ character: '₷', title: t( 'Spesmilo sign' ) },
|
|
70
|
+
{ character: '₸', title: t( 'Tenge sign' ) },
|
|
71
|
+
{ character: '₹', title: t( 'Indian rupee sign' ) },
|
|
72
|
+
{ character: '₺', title: t( 'Turkish lira sign' ) },
|
|
73
|
+
{ character: '₻', title: t( 'Nordic mark sign' ) },
|
|
74
|
+
{ character: '₼', title: t( 'Manat sign' ) },
|
|
75
|
+
{ character: '₽', title: t( 'Ruble sign' ) }
|
|
76
|
+
] );
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @module special-characters/specialcharactersessentials
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
11
|
+
|
|
12
|
+
import SpecialCharactersCurrency from './specialcharacterscurrency';
|
|
13
|
+
import SpecialCharactersMathematical from './specialcharactersmathematical';
|
|
14
|
+
import SpecialCharactersArrows from './specialcharactersarrows';
|
|
15
|
+
import SpecialCharactersLatin from './specialcharacterslatin';
|
|
16
|
+
import SpecialCharactersText from './specialcharacterstext';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A plugin combining a basic set of characters for the special characters plugin.
|
|
20
|
+
*
|
|
21
|
+
* ClassicEditor
|
|
22
|
+
* .create( {
|
|
23
|
+
* plugins: [ ..., SpecialCharacters, SpecialCharactersEssentials ],
|
|
24
|
+
* } )
|
|
25
|
+
* .then( ... )
|
|
26
|
+
* .catch( ... );
|
|
27
|
+
*
|
|
28
|
+
* @extends module:core/plugin~Plugin
|
|
29
|
+
*/
|
|
30
|
+
export default class SpecialCharactersEssentials extends Plugin {
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
static get requires() {
|
|
35
|
+
return [
|
|
36
|
+
SpecialCharactersCurrency,
|
|
37
|
+
SpecialCharactersText,
|
|
38
|
+
SpecialCharactersMathematical,
|
|
39
|
+
SpecialCharactersArrows,
|
|
40
|
+
SpecialCharactersLatin
|
|
41
|
+
];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @module special-characters/specialcharacterslatin
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { Plugin } from 'ckeditor5/src/core';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A plugin that provides special characters for the "Latin" category.
|
|
14
|
+
*
|
|
15
|
+
* ClassicEditor
|
|
16
|
+
* .create( {
|
|
17
|
+
* plugins: [ ..., SpecialCharacters, SpecialCharactersLatin ],
|
|
18
|
+
* } )
|
|
19
|
+
* .then( ... )
|
|
20
|
+
* .catch( ... );
|
|
21
|
+
*
|
|
22
|
+
* @extends module:core/plugin~Plugin
|
|
23
|
+
*/
|
|
24
|
+
export default class SpecialCharactersLatin extends Plugin {
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get pluginName() {
|
|
29
|
+
return 'SpecialCharactersLatin';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
init() {
|
|
36
|
+
const editor = this.editor;
|
|
37
|
+
const t = editor.t;
|
|
38
|
+
|
|
39
|
+
editor.plugins.get( 'SpecialCharacters' ).addItems( 'Latin', [
|
|
40
|
+
{ character: 'Ā', title: t( 'Latin capital letter a with macron' ) },
|
|
41
|
+
{ character: 'ā', title: t( 'Latin small letter a with macron' ) },
|
|
42
|
+
{ character: 'Ă', title: t( 'Latin capital letter a with breve' ) },
|
|
43
|
+
{ character: 'ă', title: t( 'Latin small letter a with breve' ) },
|
|
44
|
+
{ character: 'Ą', title: t( 'Latin capital letter a with ogonek' ) },
|
|
45
|
+
{ character: 'ą', title: t( 'Latin small letter a with ogonek' ) },
|
|
46
|
+
{ character: 'Ć', title: t( 'Latin capital letter c with acute' ) },
|
|
47
|
+
{ character: 'ć', title: t( 'Latin small letter c with acute' ) },
|
|
48
|
+
{ character: 'Ĉ', title: t( 'Latin capital letter c with circumflex' ) },
|
|
49
|
+
{ character: 'ĉ', title: t( 'Latin small letter c with circumflex' ) },
|
|
50
|
+
{ character: 'Ċ', title: t( 'Latin capital letter c with dot above' ) },
|
|
51
|
+
{ character: 'ċ', title: t( 'Latin small letter c with dot above' ) },
|
|
52
|
+
{ character: 'Č', title: t( 'Latin capital letter c with caron' ) },
|
|
53
|
+
{ character: 'č', title: t( 'Latin small letter c with caron' ) },
|
|
54
|
+
{ character: 'Ď', title: t( 'Latin capital letter d with caron' ) },
|
|
55
|
+
{ character: 'ď', title: t( 'Latin small letter d with caron' ) },
|
|
56
|
+
{ character: 'Đ', title: t( 'Latin capital letter d with stroke' ) },
|
|
57
|
+
{ character: 'đ', title: t( 'Latin small letter d with stroke' ) },
|
|
58
|
+
{ character: 'Ē', title: t( 'Latin capital letter e with macron' ) },
|
|
59
|
+
{ character: 'ē', title: t( 'Latin small letter e with macron' ) },
|
|
60
|
+
{ character: 'Ĕ', title: t( 'Latin capital letter e with breve' ) },
|
|
61
|
+
{ character: 'ĕ', title: t( 'Latin small letter e with breve' ) },
|
|
62
|
+
{ character: 'Ė', title: t( 'Latin capital letter e with dot above' ) },
|
|
63
|
+
{ character: 'ė', title: t( 'Latin small letter e with dot above' ) },
|
|
64
|
+
{ character: 'Ę', title: t( 'Latin capital letter e with ogonek' ) },
|
|
65
|
+
{ character: 'ę', title: t( 'Latin small letter e with ogonek' ) },
|
|
66
|
+
{ character: 'Ě', title: t( 'Latin capital letter e with caron' ) },
|
|
67
|
+
{ character: 'ě', title: t( 'Latin small letter e with caron' ) },
|
|
68
|
+
{ character: 'Ĝ', title: t( 'Latin capital letter g with circumflex' ) },
|
|
69
|
+
{ character: 'ĝ', title: t( 'Latin small letter g with circumflex' ) },
|
|
70
|
+
{ character: 'Ğ', title: t( 'Latin capital letter g with breve' ) },
|
|
71
|
+
{ character: 'ğ', title: t( 'Latin small letter g with breve' ) },
|
|
72
|
+
{ character: 'Ġ', title: t( 'Latin capital letter g with dot above' ) },
|
|
73
|
+
{ character: 'ġ', title: t( 'Latin small letter g with dot above' ) },
|
|
74
|
+
{ character: 'Ģ', title: t( 'Latin capital letter g with cedilla' ) },
|
|
75
|
+
{ character: 'ģ', title: t( 'Latin small letter g with cedilla' ) },
|
|
76
|
+
{ character: 'Ĥ', title: t( 'Latin capital letter h with circumflex' ) },
|
|
77
|
+
{ character: 'ĥ', title: t( 'Latin small letter h with circumflex' ) },
|
|
78
|
+
{ character: 'Ħ', title: t( 'Latin capital letter h with stroke' ) },
|
|
79
|
+
{ character: 'ħ', title: t( 'Latin small letter h with stroke' ) },
|
|
80
|
+
{ character: 'Ĩ', title: t( 'Latin capital letter i with tilde' ) },
|
|
81
|
+
{ character: 'ĩ', title: t( 'Latin small letter i with tilde' ) },
|
|
82
|
+
{ character: 'Ī', title: t( 'Latin capital letter i with macron' ) },
|
|
83
|
+
{ character: 'ī', title: t( 'Latin small letter i with macron' ) },
|
|
84
|
+
{ character: 'Ĭ', title: t( 'Latin capital letter i with breve' ) },
|
|
85
|
+
{ character: 'ĭ', title: t( 'Latin small letter i with breve' ) },
|
|
86
|
+
{ character: 'Į', title: t( 'Latin capital letter i with ogonek' ) },
|
|
87
|
+
{ character: 'į', title: t( 'Latin small letter i with ogonek' ) },
|
|
88
|
+
{ character: 'İ', title: t( 'Latin capital letter i with dot above' ) },
|
|
89
|
+
{ character: 'ı', title: t( 'Latin small letter dotless i' ) },
|
|
90
|
+
{ character: 'IJ', title: t( 'Latin capital ligature ij' ) },
|
|
91
|
+
{ character: 'ij', title: t( 'Latin small ligature ij' ) },
|
|
92
|
+
{ character: 'Ĵ', title: t( 'Latin capital letter j with circumflex' ) },
|
|
93
|
+
{ character: 'ĵ', title: t( 'Latin small letter j with circumflex' ) },
|
|
94
|
+
{ character: 'Ķ', title: t( 'Latin capital letter k with cedilla' ) },
|
|
95
|
+
{ character: 'ķ', title: t( 'Latin small letter k with cedilla' ) },
|
|
96
|
+
{ character: 'ĸ', title: t( 'Latin small letter kra' ) },
|
|
97
|
+
{ character: 'Ĺ', title: t( 'Latin capital letter l with acute' ) },
|
|
98
|
+
{ character: 'ĺ', title: t( 'Latin small letter l with acute' ) },
|
|
99
|
+
{ character: 'Ļ', title: t( 'Latin capital letter l with cedilla' ) },
|
|
100
|
+
{ character: 'ļ', title: t( 'Latin small letter l with cedilla' ) },
|
|
101
|
+
{ character: 'Ľ', title: t( 'Latin capital letter l with caron' ) },
|
|
102
|
+
{ character: 'ľ', title: t( 'Latin small letter l with caron' ) },
|
|
103
|
+
{ character: 'Ŀ', title: t( 'Latin capital letter l with middle dot' ) },
|
|
104
|
+
{ character: 'ŀ', title: t( 'Latin small letter l with middle dot' ) },
|
|
105
|
+
{ character: 'Ł', title: t( 'Latin capital letter l with stroke' ) },
|
|
106
|
+
{ character: 'ł', title: t( 'Latin small letter l with stroke' ) },
|
|
107
|
+
{ character: 'Ń', title: t( 'Latin capital letter n with acute' ) },
|
|
108
|
+
{ character: 'ń', title: t( 'Latin small letter n with acute' ) },
|
|
109
|
+
{ character: 'Ņ', title: t( 'Latin capital letter n with cedilla' ) },
|
|
110
|
+
{ character: 'ņ', title: t( 'Latin small letter n with cedilla' ) },
|
|
111
|
+
{ character: 'Ň', title: t( 'Latin capital letter n with caron' ) },
|
|
112
|
+
{ character: 'ň', title: t( 'Latin small letter n with caron' ) },
|
|
113
|
+
{ character: 'ʼn', title: t( 'Latin small letter n preceded by apostrophe' ) },
|
|
114
|
+
{ character: 'Ŋ', title: t( 'Latin capital letter eng' ) },
|
|
115
|
+
{ character: 'ŋ', title: t( 'Latin small letter eng' ) },
|
|
116
|
+
{ character: 'Ō', title: t( 'Latin capital letter o with macron' ) },
|
|
117
|
+
{ character: 'ō', title: t( 'Latin small letter o with macron' ) },
|
|
118
|
+
{ character: 'Ŏ', title: t( 'Latin capital letter o with breve' ) },
|
|
119
|
+
{ character: 'ŏ', title: t( 'Latin small letter o with breve' ) },
|
|
120
|
+
{ character: 'Ő', title: t( 'Latin capital letter o with double acute' ) },
|
|
121
|
+
{ character: 'ő', title: t( 'Latin small letter o with double acute' ) },
|
|
122
|
+
{ character: 'Œ', title: t( 'Latin capital ligature oe' ) },
|
|
123
|
+
{ character: 'œ', title: t( 'Latin small ligature oe' ) },
|
|
124
|
+
{ character: 'Ŕ', title: t( 'Latin capital letter r with acute' ) },
|
|
125
|
+
{ character: 'ŕ', title: t( 'Latin small letter r with acute' ) },
|
|
126
|
+
{ character: 'Ŗ', title: t( 'Latin capital letter r with cedilla' ) },
|
|
127
|
+
{ character: 'ŗ', title: t( 'Latin small letter r with cedilla' ) },
|
|
128
|
+
{ character: 'Ř', title: t( 'Latin capital letter r with caron' ) },
|
|
129
|
+
{ character: 'ř', title: t( 'Latin small letter r with caron' ) },
|
|
130
|
+
{ character: 'Ś', title: t( 'Latin capital letter s with acute' ) },
|
|
131
|
+
{ character: 'ś', title: t( 'Latin small letter s with acute' ) },
|
|
132
|
+
{ character: 'Ŝ', title: t( 'Latin capital letter s with circumflex' ) },
|
|
133
|
+
{ character: 'ŝ', title: t( 'Latin small letter s with circumflex' ) },
|
|
134
|
+
{ character: 'Ş', title: t( 'Latin capital letter s with cedilla' ) },
|
|
135
|
+
{ character: 'ş', title: t( 'Latin small letter s with cedilla' ) },
|
|
136
|
+
{ character: 'Š', title: t( 'Latin capital letter s with caron' ) },
|
|
137
|
+
{ character: 'š', title: t( 'Latin small letter s with caron' ) },
|
|
138
|
+
{ character: 'Ţ', title: t( 'Latin capital letter t with cedilla' ) },
|
|
139
|
+
{ character: 'ţ', title: t( 'Latin small letter t with cedilla' ) },
|
|
140
|
+
{ character: 'Ť', title: t( 'Latin capital letter t with caron' ) },
|
|
141
|
+
{ character: 'ť', title: t( 'Latin small letter t with caron' ) },
|
|
142
|
+
{ character: 'Ŧ', title: t( 'Latin capital letter t with stroke' ) },
|
|
143
|
+
{ character: 'ŧ', title: t( 'Latin small letter t with stroke' ) },
|
|
144
|
+
{ character: 'Ũ', title: t( 'Latin capital letter u with tilde' ) },
|
|
145
|
+
{ character: 'ũ', title: t( 'Latin small letter u with tilde' ) },
|
|
146
|
+
{ character: 'Ū', title: t( 'Latin capital letter u with macron' ) },
|
|
147
|
+
{ character: 'ū', title: t( 'Latin small letter u with macron' ) },
|
|
148
|
+
{ character: 'Ŭ', title: t( 'Latin capital letter u with breve' ) },
|
|
149
|
+
{ character: 'ŭ', title: t( 'Latin small letter u with breve' ) },
|
|
150
|
+
{ character: 'Ů', title: t( 'Latin capital letter u with ring above' ) },
|
|
151
|
+
{ character: 'ů', title: t( 'Latin small letter u with ring above' ) },
|
|
152
|
+
{ character: 'Ű', title: t( 'Latin capital letter u with double acute' ) },
|
|
153
|
+
{ character: 'ű', title: t( 'Latin small letter u with double acute' ) },
|
|
154
|
+
{ character: 'Ų', title: t( 'Latin capital letter u with ogonek' ) },
|
|
155
|
+
{ character: 'ų', title: t( 'Latin small letter u with ogonek' ) },
|
|
156
|
+
{ character: 'Ŵ', title: t( 'Latin capital letter w with circumflex' ) },
|
|
157
|
+
{ character: 'ŵ', title: t( 'Latin small letter w with circumflex' ) },
|
|
158
|
+
{ character: 'Ŷ', title: t( 'Latin capital letter y with circumflex' ) },
|
|
159
|
+
{ character: 'ŷ', title: t( 'Latin small letter y with circumflex' ) },
|
|
160
|
+
{ character: 'Ÿ', title: t( 'Latin capital letter y with diaeresis' ) },
|
|
161
|
+
{ character: 'Ź', title: t( 'Latin capital letter z with acute' ) },
|
|
162
|
+
{ character: 'ź', title: t( 'Latin small letter z with acute' ) },
|
|
163
|
+
{ character: 'Ż', title: t( 'Latin capital letter z with dot above' ) },
|
|
164
|
+
{ character: 'ż', title: t( 'Latin small letter z with dot above' ) },
|
|
165
|
+
{ character: 'Ž', title: t( 'Latin capital letter z with caron' ) },
|
|
166
|
+
{ character: 'ž', title: t( 'Latin small letter z with caron' ) },
|
|
167
|
+
{ character: 'ſ', title: t( 'Latin small letter long s' ) }
|
|
168
|
+
] );
|
|
169
|
+
}
|
|
170
|
+
}
|