@ckeditor/ckeditor5-special-characters 41.1.0 → 41.3.0-alpha.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/build/special-characters.js +1 -1
- package/build/translations/pt.js +1 -1
- package/dist/content-index.css +4 -0
- package/dist/editor-index.css +14 -0
- package/dist/index.css +28 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +1065 -0
- package/dist/index.js.map +1 -0
- package/dist/types/augmentation.d.ts +24 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/specialcharacters.d.ts +96 -0
- package/dist/types/specialcharactersarrows.d.ts +30 -0
- package/dist/types/specialcharactersconfig.d.ts +51 -0
- package/dist/types/specialcharacterscurrency.d.ts +30 -0
- package/dist/types/specialcharactersessentials.d.ts +35 -0
- package/dist/types/specialcharacterslatin.d.ts +30 -0
- package/dist/types/specialcharactersmathematical.d.ts +30 -0
- package/dist/types/specialcharacterstext.d.ts +30 -0
- package/dist/types/ui/charactergridview.d.ts +94 -0
- package/dist/types/ui/characterinfoview.d.ts +35 -0
- package/dist/types/ui/specialcharactersnavigationview.d.ts +59 -0
- package/dist/types/ui/specialcharactersview.d.ts +65 -0
- package/lang/translations/he.po +1 -1
- package/lang/translations/pt.po +2 -2
- package/package.json +3 -2
package/dist/index.js
ADDED
|
@@ -0,0 +1,1065 @@
|
|
|
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
|
+
import { Plugin } from '@ckeditor/ckeditor5-core/dist/index.js';
|
|
6
|
+
import { Typing } from '@ckeditor/ckeditor5-typing/dist/index.js';
|
|
7
|
+
import { FormHeaderView, createDropdown, addListToDropdown, ViewModel, View, addKeyboardHandlingForGrid, ButtonView, FocusCycler } from '@ckeditor/ckeditor5-ui/dist/index.js';
|
|
8
|
+
import { Collection, FocusTracker, KeystrokeHandler, global, CKEditorError } from '@ckeditor/ckeditor5-utils/dist/index.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
12
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* @module special-characters/ui/specialcharactersnavigationview
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* A class representing the navigation part of the special characters UI. It is responsible
|
|
19
|
+
* for describing the feature and allowing the user to select a particular character group.
|
|
20
|
+
*/
|
|
21
|
+
class SpecialCharactersNavigationView extends FormHeaderView {
|
|
22
|
+
/**
|
|
23
|
+
* Creates an instance of the {@link module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}
|
|
24
|
+
* class.
|
|
25
|
+
*
|
|
26
|
+
* @param locale The localization services instance.
|
|
27
|
+
* @param groupNames The names of the character groups and their displayed labels.
|
|
28
|
+
*/
|
|
29
|
+
constructor(locale, groupNames) {
|
|
30
|
+
super(locale);
|
|
31
|
+
const t = locale.t;
|
|
32
|
+
this.set('class', 'ck-special-characters-navigation');
|
|
33
|
+
this.groupDropdownView = this._createGroupDropdown(groupNames);
|
|
34
|
+
this.groupDropdownView.panelPosition = locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw';
|
|
35
|
+
this.label = t('Special characters');
|
|
36
|
+
this.children.add(this.groupDropdownView);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Returns the name of the character group currently selected in the {@link #groupDropdownView}.
|
|
40
|
+
*/
|
|
41
|
+
get currentGroupName() {
|
|
42
|
+
return this.groupDropdownView.value;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Focuses the character categories dropdown.
|
|
46
|
+
*/
|
|
47
|
+
focus() {
|
|
48
|
+
this.groupDropdownView.focus();
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Returns a dropdown that allows selecting character groups.
|
|
52
|
+
*
|
|
53
|
+
* @param groupNames The names of the character groups and their displayed labels.
|
|
54
|
+
*/
|
|
55
|
+
_createGroupDropdown(groupNames) {
|
|
56
|
+
const locale = this.locale;
|
|
57
|
+
const t = locale.t;
|
|
58
|
+
const dropdown = createDropdown(locale);
|
|
59
|
+
const groupDefinitions = this._getCharacterGroupListItemDefinitions(dropdown, groupNames);
|
|
60
|
+
const accessibleLabel = t('Character categories');
|
|
61
|
+
dropdown.set('value', groupDefinitions.first.model.name);
|
|
62
|
+
dropdown.buttonView.bind('label').to(dropdown, 'value', value => groupNames.get(value));
|
|
63
|
+
dropdown.buttonView.set({
|
|
64
|
+
isOn: false,
|
|
65
|
+
withText: true,
|
|
66
|
+
tooltip: accessibleLabel,
|
|
67
|
+
class: ['ck-dropdown__button_label-width_auto'],
|
|
68
|
+
ariaLabel: accessibleLabel,
|
|
69
|
+
ariaLabelledBy: undefined
|
|
70
|
+
});
|
|
71
|
+
dropdown.on('execute', evt => {
|
|
72
|
+
dropdown.value = evt.source.name;
|
|
73
|
+
});
|
|
74
|
+
dropdown.delegate('execute').to(this);
|
|
75
|
+
addListToDropdown(dropdown, groupDefinitions, {
|
|
76
|
+
ariaLabel: accessibleLabel,
|
|
77
|
+
role: 'menu'
|
|
78
|
+
});
|
|
79
|
+
return dropdown;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Returns list item definitions to be used in the character group dropdown
|
|
83
|
+
* representing specific character groups.
|
|
84
|
+
*
|
|
85
|
+
* @param dropdown Dropdown view element
|
|
86
|
+
* @param groupNames The names of the character groups and their displayed labels.
|
|
87
|
+
*/
|
|
88
|
+
_getCharacterGroupListItemDefinitions(dropdown, groupNames) {
|
|
89
|
+
const groupDefs = new Collection();
|
|
90
|
+
for (const [name, label] of groupNames) {
|
|
91
|
+
const model = new ViewModel({
|
|
92
|
+
name,
|
|
93
|
+
label,
|
|
94
|
+
withText: true,
|
|
95
|
+
role: 'menuitemradio'
|
|
96
|
+
});
|
|
97
|
+
model.bind('isOn').to(dropdown, 'value', value => value === model.name);
|
|
98
|
+
groupDefs.add({ type: 'button', model });
|
|
99
|
+
}
|
|
100
|
+
return groupDefs;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
106
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
107
|
+
*/
|
|
108
|
+
/**
|
|
109
|
+
* @module special-characters/ui/charactergridview
|
|
110
|
+
*/
|
|
111
|
+
/**
|
|
112
|
+
* A grid of character tiles. It allows browsing special characters and selecting the character to
|
|
113
|
+
* be inserted into the content.
|
|
114
|
+
*/
|
|
115
|
+
class CharacterGridView extends View {
|
|
116
|
+
/**
|
|
117
|
+
* Creates an instance of a character grid containing tiles representing special characters.
|
|
118
|
+
*
|
|
119
|
+
* @param locale The localization services instance.
|
|
120
|
+
*/
|
|
121
|
+
constructor(locale) {
|
|
122
|
+
super(locale);
|
|
123
|
+
this.tiles = this.createCollection();
|
|
124
|
+
this.setTemplate({
|
|
125
|
+
tag: 'div',
|
|
126
|
+
children: [
|
|
127
|
+
{
|
|
128
|
+
tag: 'div',
|
|
129
|
+
attributes: {
|
|
130
|
+
class: [
|
|
131
|
+
'ck',
|
|
132
|
+
'ck-character-grid__tiles'
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
children: this.tiles
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
attributes: {
|
|
139
|
+
class: [
|
|
140
|
+
'ck',
|
|
141
|
+
'ck-character-grid'
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
this.focusTracker = new FocusTracker();
|
|
146
|
+
this.keystrokes = new KeystrokeHandler();
|
|
147
|
+
addKeyboardHandlingForGrid({
|
|
148
|
+
keystrokeHandler: this.keystrokes,
|
|
149
|
+
focusTracker: this.focusTracker,
|
|
150
|
+
gridItems: this.tiles,
|
|
151
|
+
numberOfColumns: () => global.window
|
|
152
|
+
.getComputedStyle(this.element.firstChild) // Responsive .ck-character-grid__tiles
|
|
153
|
+
.getPropertyValue('grid-template-columns')
|
|
154
|
+
.split(' ')
|
|
155
|
+
.length,
|
|
156
|
+
uiLanguageDirection: this.locale && this.locale.uiLanguageDirection
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Creates a new tile for the grid.
|
|
161
|
+
*
|
|
162
|
+
* @param character A human-readable character displayed as the label (e.g. "ε").
|
|
163
|
+
* @param name The name of the character (e.g. "greek small letter epsilon").
|
|
164
|
+
*/
|
|
165
|
+
createTile(character, name) {
|
|
166
|
+
const tile = new ButtonView(this.locale);
|
|
167
|
+
tile.set({
|
|
168
|
+
label: character,
|
|
169
|
+
withText: true,
|
|
170
|
+
class: 'ck-character-grid__tile'
|
|
171
|
+
});
|
|
172
|
+
// Labels are vital for the users to understand what character they're looking at.
|
|
173
|
+
// For now we're using native title attribute for that, see #5817.
|
|
174
|
+
tile.extendTemplate({
|
|
175
|
+
attributes: {
|
|
176
|
+
title: name
|
|
177
|
+
},
|
|
178
|
+
on: {
|
|
179
|
+
mouseover: tile.bindTemplate.to('mouseover'),
|
|
180
|
+
focus: tile.bindTemplate.to('focus')
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
tile.on('mouseover', () => {
|
|
184
|
+
this.fire('tileHover', { name, character });
|
|
185
|
+
});
|
|
186
|
+
tile.on('focus', () => {
|
|
187
|
+
this.fire('tileFocus', { name, character });
|
|
188
|
+
});
|
|
189
|
+
tile.on('execute', () => {
|
|
190
|
+
this.fire('execute', { name, character });
|
|
191
|
+
});
|
|
192
|
+
return tile;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* @inheritDoc
|
|
196
|
+
*/
|
|
197
|
+
render() {
|
|
198
|
+
super.render();
|
|
199
|
+
for (const item of this.tiles) {
|
|
200
|
+
this.focusTracker.add(item.element);
|
|
201
|
+
}
|
|
202
|
+
this.tiles.on('change', (eventInfo, { added, removed }) => {
|
|
203
|
+
if (added.length > 0) {
|
|
204
|
+
for (const item of added) {
|
|
205
|
+
this.focusTracker.add(item.element);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (removed.length > 0) {
|
|
209
|
+
for (const item of removed) {
|
|
210
|
+
this.focusTracker.remove(item.element);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
this.keystrokes.listenTo(this.element);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* @inheritDoc
|
|
218
|
+
*/
|
|
219
|
+
destroy() {
|
|
220
|
+
super.destroy();
|
|
221
|
+
this.keystrokes.destroy();
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Focuses the first focusable in {@link ~CharacterGridView#tiles}.
|
|
225
|
+
*/
|
|
226
|
+
focus() {
|
|
227
|
+
this.tiles.first.focus();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
233
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
234
|
+
*/
|
|
235
|
+
/**
|
|
236
|
+
* The view displaying detailed information about a special character glyph, e.g. upon
|
|
237
|
+
* hovering it with a mouse.
|
|
238
|
+
*/
|
|
239
|
+
class CharacterInfoView extends View {
|
|
240
|
+
constructor(locale) {
|
|
241
|
+
super(locale);
|
|
242
|
+
const bind = this.bindTemplate;
|
|
243
|
+
this.set('character', null);
|
|
244
|
+
this.set('name', null);
|
|
245
|
+
this.bind('code').to(this, 'character', characterToUnicodeString);
|
|
246
|
+
this.setTemplate({
|
|
247
|
+
tag: 'div',
|
|
248
|
+
children: [
|
|
249
|
+
{
|
|
250
|
+
tag: 'span',
|
|
251
|
+
attributes: {
|
|
252
|
+
class: [
|
|
253
|
+
'ck-character-info__name'
|
|
254
|
+
]
|
|
255
|
+
},
|
|
256
|
+
children: [
|
|
257
|
+
{
|
|
258
|
+
// Note: ZWSP to prevent vertical collapsing.
|
|
259
|
+
text: bind.to('name', name => name ? name : '\u200B')
|
|
260
|
+
}
|
|
261
|
+
]
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
tag: 'span',
|
|
265
|
+
attributes: {
|
|
266
|
+
class: [
|
|
267
|
+
'ck-character-info__code'
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
children: [
|
|
271
|
+
{
|
|
272
|
+
text: bind.to('code')
|
|
273
|
+
}
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
],
|
|
277
|
+
attributes: {
|
|
278
|
+
class: [
|
|
279
|
+
'ck',
|
|
280
|
+
'ck-character-info'
|
|
281
|
+
]
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Converts a character into a "Unicode string", for instance:
|
|
288
|
+
*
|
|
289
|
+
* "$" -> "U+0024"
|
|
290
|
+
*
|
|
291
|
+
* Returns an empty string when the character is `null`.
|
|
292
|
+
*/
|
|
293
|
+
function characterToUnicodeString(character) {
|
|
294
|
+
if (character === null) {
|
|
295
|
+
return '';
|
|
296
|
+
}
|
|
297
|
+
const hexCode = character.codePointAt(0).toString(16);
|
|
298
|
+
return 'U+' + ('0000' + hexCode).slice(-4);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
303
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
304
|
+
*/
|
|
305
|
+
/**
|
|
306
|
+
* @module special-characters/ui/specialcharactersview
|
|
307
|
+
*/
|
|
308
|
+
/**
|
|
309
|
+
* A view that glues pieces of the special characters dropdown panel together:
|
|
310
|
+
*
|
|
311
|
+
* * the navigation view (allows selecting the category),
|
|
312
|
+
* * the grid view (displays characters as a grid),
|
|
313
|
+
* * and the info view (displays detailed info about a specific character).
|
|
314
|
+
*/
|
|
315
|
+
class SpecialCharactersView extends View {
|
|
316
|
+
/**
|
|
317
|
+
* Creates an instance of the `SpecialCharactersView`.
|
|
318
|
+
*/
|
|
319
|
+
constructor(locale, navigationView, gridView, infoView) {
|
|
320
|
+
super(locale);
|
|
321
|
+
this.navigationView = navigationView;
|
|
322
|
+
this.gridView = gridView;
|
|
323
|
+
this.infoView = infoView;
|
|
324
|
+
this.items = this.createCollection();
|
|
325
|
+
this.focusTracker = new FocusTracker();
|
|
326
|
+
this.keystrokes = new KeystrokeHandler();
|
|
327
|
+
this._focusCycler = new FocusCycler({
|
|
328
|
+
focusables: this.items,
|
|
329
|
+
focusTracker: this.focusTracker,
|
|
330
|
+
keystrokeHandler: this.keystrokes,
|
|
331
|
+
actions: {
|
|
332
|
+
focusPrevious: 'shift + tab',
|
|
333
|
+
focusNext: 'tab'
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
this.setTemplate({
|
|
337
|
+
tag: 'div',
|
|
338
|
+
children: [
|
|
339
|
+
this.navigationView,
|
|
340
|
+
this.gridView,
|
|
341
|
+
this.infoView
|
|
342
|
+
],
|
|
343
|
+
attributes: {
|
|
344
|
+
// Avoid focus loss when the user clicks the area of the grid that is not a button.
|
|
345
|
+
// https://github.com/ckeditor/ckeditor5/pull/12319#issuecomment-1231779819
|
|
346
|
+
tabindex: '-1'
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
this.items.add(this.navigationView.groupDropdownView.buttonView);
|
|
350
|
+
this.items.add(this.gridView);
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* @inheritDoc
|
|
354
|
+
*/
|
|
355
|
+
render() {
|
|
356
|
+
super.render();
|
|
357
|
+
this.focusTracker.add(this.navigationView.groupDropdownView.buttonView.element);
|
|
358
|
+
this.focusTracker.add(this.gridView.element);
|
|
359
|
+
// Start listening for the keystrokes coming from #element.
|
|
360
|
+
this.keystrokes.listenTo(this.element);
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* @inheritDoc
|
|
364
|
+
*/
|
|
365
|
+
destroy() {
|
|
366
|
+
super.destroy();
|
|
367
|
+
this.focusTracker.destroy();
|
|
368
|
+
this.keystrokes.destroy();
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Focuses the first focusable in {@link #items}.
|
|
372
|
+
*/
|
|
373
|
+
focus() {
|
|
374
|
+
this.navigationView.focus();
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
var specialCharactersIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 2.5a7.47 7.47 0 0 1 4.231 1.31 7.268 7.268 0 0 1 2.703 3.454 7.128 7.128 0 0 1 .199 4.353c-.39 1.436-1.475 2.72-2.633 3.677h2.013c0-.226.092-.443.254-.603a.876.876 0 0 1 1.229 0c.163.16.254.377.254.603v.853c0 .209-.078.41-.22.567a.873.873 0 0 1-.547.28l-.101.006h-4.695a.517.517 0 0 1-.516-.518v-1.265c0-.21.128-.398.317-.489a5.601 5.601 0 0 0 2.492-2.371 5.459 5.459 0 0 0 .552-3.693 5.53 5.53 0 0 0-1.955-3.2A5.71 5.71 0 0 0 10 4.206 5.708 5.708 0 0 0 6.419 5.46 5.527 5.527 0 0 0 4.46 8.663a5.457 5.457 0 0 0 .554 3.695 5.6 5.6 0 0 0 2.497 2.37.55.55 0 0 1 .317.49v1.264c0 .286-.23.518-.516.518H2.618a.877.877 0 0 1-.614-.25.845.845 0 0 1-.254-.603v-.853c0-.226.091-.443.254-.603a.876.876 0 0 1 1.228 0c.163.16.255.377.255.603h1.925c-1.158-.958-2.155-2.241-2.545-3.678a7.128 7.128 0 0 1 .199-4.352 7.268 7.268 0 0 1 2.703-3.455A7.475 7.475 0 0 1 10 2.5z\"/></svg>";
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
382
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
383
|
+
*/
|
|
384
|
+
/**
|
|
385
|
+
* @module special-characters/specialcharacters
|
|
386
|
+
*/
|
|
387
|
+
const ALL_SPECIAL_CHARACTERS_GROUP = 'All';
|
|
388
|
+
/**
|
|
389
|
+
* The special characters feature.
|
|
390
|
+
*
|
|
391
|
+
* Introduces the `'specialCharacters'` dropdown.
|
|
392
|
+
*/
|
|
393
|
+
class SpecialCharacters extends Plugin {
|
|
394
|
+
/**
|
|
395
|
+
* @inheritDoc
|
|
396
|
+
*/
|
|
397
|
+
static get requires() {
|
|
398
|
+
return [Typing];
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* @inheritDoc
|
|
402
|
+
*/
|
|
403
|
+
static get pluginName() {
|
|
404
|
+
return 'SpecialCharacters';
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* @inheritDoc
|
|
408
|
+
*/
|
|
409
|
+
constructor(editor) {
|
|
410
|
+
super(editor);
|
|
411
|
+
const t = editor.t;
|
|
412
|
+
this._characters = new Map();
|
|
413
|
+
this._groups = new Map();
|
|
414
|
+
this._allSpecialCharactersGroupLabel = t('All');
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* @inheritDoc
|
|
418
|
+
*/
|
|
419
|
+
init() {
|
|
420
|
+
const editor = this.editor;
|
|
421
|
+
const t = editor.t;
|
|
422
|
+
const inputCommand = editor.commands.get('insertText');
|
|
423
|
+
// Add the `specialCharacters` dropdown button to feature components.
|
|
424
|
+
editor.ui.componentFactory.add('specialCharacters', locale => {
|
|
425
|
+
const dropdownView = createDropdown(locale);
|
|
426
|
+
let dropdownPanelContent;
|
|
427
|
+
dropdownView.buttonView.set({
|
|
428
|
+
label: t('Special characters'),
|
|
429
|
+
icon: specialCharactersIcon,
|
|
430
|
+
tooltip: true
|
|
431
|
+
});
|
|
432
|
+
dropdownView.bind('isEnabled').to(inputCommand);
|
|
433
|
+
// Insert a special character when a tile was clicked.
|
|
434
|
+
dropdownView.on('execute', (evt, data) => {
|
|
435
|
+
editor.execute('insertText', { text: data.character });
|
|
436
|
+
editor.editing.view.focus();
|
|
437
|
+
});
|
|
438
|
+
dropdownView.on('change:isOpen', () => {
|
|
439
|
+
if (!dropdownPanelContent) {
|
|
440
|
+
dropdownPanelContent = this._createDropdownPanelContent(locale, dropdownView);
|
|
441
|
+
const specialCharactersView = new SpecialCharactersView(locale, dropdownPanelContent.navigationView, dropdownPanelContent.gridView, dropdownPanelContent.infoView);
|
|
442
|
+
dropdownView.panelView.children.add(specialCharactersView);
|
|
443
|
+
}
|
|
444
|
+
dropdownPanelContent.infoView.set({
|
|
445
|
+
character: null,
|
|
446
|
+
name: null
|
|
447
|
+
});
|
|
448
|
+
});
|
|
449
|
+
return dropdownView;
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Adds a collection of special characters to the specified group. The title of a special character must be unique.
|
|
454
|
+
*
|
|
455
|
+
* **Note:** The "All" category name is reserved by the plugin and cannot be used as a new name for a special
|
|
456
|
+
* characters category.
|
|
457
|
+
*/
|
|
458
|
+
addItems(groupName, items, options = { label: groupName }) {
|
|
459
|
+
if (groupName === ALL_SPECIAL_CHARACTERS_GROUP) {
|
|
460
|
+
/**
|
|
461
|
+
* The name "All" for a special category group cannot be used because it is a special category that displays all
|
|
462
|
+
* available special characters.
|
|
463
|
+
*
|
|
464
|
+
* @error special-character-invalid-group-name
|
|
465
|
+
*/
|
|
466
|
+
throw new CKEditorError('special-character-invalid-group-name', null);
|
|
467
|
+
}
|
|
468
|
+
const group = this._getGroup(groupName, options.label);
|
|
469
|
+
for (const item of items) {
|
|
470
|
+
group.items.add(item.title);
|
|
471
|
+
this._characters.set(item.title, item.character);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Returns special character groups in an order determined based on configuration and registration sequence.
|
|
476
|
+
*/
|
|
477
|
+
getGroups() {
|
|
478
|
+
const groups = Array.from(this._groups.keys());
|
|
479
|
+
const order = this.editor.config.get('specialCharacters.order') || [];
|
|
480
|
+
const invalidGroup = order.find(item => !groups.includes(item));
|
|
481
|
+
if (invalidGroup) {
|
|
482
|
+
/**
|
|
483
|
+
* One of the special character groups in the "specialCharacters.order" configuration doesn't exist.
|
|
484
|
+
*
|
|
485
|
+
* @error special-character-invalid-order-group-name
|
|
486
|
+
*/
|
|
487
|
+
throw new CKEditorError('special-character-invalid-order-group-name', null, { invalidGroup });
|
|
488
|
+
}
|
|
489
|
+
return new Set([
|
|
490
|
+
...order,
|
|
491
|
+
...groups
|
|
492
|
+
]);
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Returns a collection of special characters symbol names (titles).
|
|
496
|
+
*/
|
|
497
|
+
getCharactersForGroup(groupName) {
|
|
498
|
+
if (groupName === ALL_SPECIAL_CHARACTERS_GROUP) {
|
|
499
|
+
return new Set(this._characters.keys());
|
|
500
|
+
}
|
|
501
|
+
const group = this._groups.get(groupName);
|
|
502
|
+
if (group) {
|
|
503
|
+
return group.items;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Returns the symbol of a special character for the specified name. If the special character could not be found, `undefined`
|
|
508
|
+
* is returned.
|
|
509
|
+
*
|
|
510
|
+
* @param title The title of a special character.
|
|
511
|
+
*/
|
|
512
|
+
getCharacter(title) {
|
|
513
|
+
return this._characters.get(title);
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Returns a group of special characters. If the group with the specified name does not exist, it will be created.
|
|
517
|
+
*
|
|
518
|
+
* @param groupName The name of the group to create.
|
|
519
|
+
* @param label The label describing the new group.
|
|
520
|
+
*/
|
|
521
|
+
_getGroup(groupName, label) {
|
|
522
|
+
if (!this._groups.has(groupName)) {
|
|
523
|
+
this._groups.set(groupName, {
|
|
524
|
+
items: new Set(),
|
|
525
|
+
label
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
return this._groups.get(groupName);
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Updates the symbol grid depending on the currently selected character group.
|
|
532
|
+
*/
|
|
533
|
+
_updateGrid(currentGroupName, gridView) {
|
|
534
|
+
// Updating the grid starts with removing all tiles belonging to the old group.
|
|
535
|
+
gridView.tiles.clear();
|
|
536
|
+
const characterTitles = this.getCharactersForGroup(currentGroupName);
|
|
537
|
+
for (const title of characterTitles) {
|
|
538
|
+
const character = this.getCharacter(title);
|
|
539
|
+
gridView.tiles.add(gridView.createTile(character, title));
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
/**
|
|
543
|
+
* Initializes the dropdown, used for lazy loading.
|
|
544
|
+
*
|
|
545
|
+
* @returns An object with `navigationView`, `gridView` and `infoView` properties, containing UI parts.
|
|
546
|
+
*/
|
|
547
|
+
_createDropdownPanelContent(locale, dropdownView) {
|
|
548
|
+
const groupEntries = Array
|
|
549
|
+
.from(this.getGroups())
|
|
550
|
+
.map(name => ([name, this._groups.get(name).label]));
|
|
551
|
+
// The map contains a name of category (an identifier) and its label (a translational string).
|
|
552
|
+
const specialCharsGroups = new Map([
|
|
553
|
+
// Add a special group that shows all available special characters.
|
|
554
|
+
[ALL_SPECIAL_CHARACTERS_GROUP, this._allSpecialCharactersGroupLabel],
|
|
555
|
+
...groupEntries
|
|
556
|
+
]);
|
|
557
|
+
const navigationView = new SpecialCharactersNavigationView(locale, specialCharsGroups);
|
|
558
|
+
const gridView = new CharacterGridView(locale);
|
|
559
|
+
const infoView = new CharacterInfoView(locale);
|
|
560
|
+
gridView.delegate('execute').to(dropdownView);
|
|
561
|
+
gridView.on('tileHover', (evt, data) => {
|
|
562
|
+
infoView.set(data);
|
|
563
|
+
});
|
|
564
|
+
gridView.on('tileFocus', (evt, data) => {
|
|
565
|
+
infoView.set(data);
|
|
566
|
+
});
|
|
567
|
+
// Update the grid of special characters when a user changed the character group.
|
|
568
|
+
navigationView.on('execute', () => {
|
|
569
|
+
this._updateGrid(navigationView.currentGroupName, gridView);
|
|
570
|
+
});
|
|
571
|
+
// Set the initial content of the special characters grid.
|
|
572
|
+
this._updateGrid(navigationView.currentGroupName, gridView);
|
|
573
|
+
return { navigationView, gridView, infoView };
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
579
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
580
|
+
*/
|
|
581
|
+
/**
|
|
582
|
+
* @module special-characters/specialcharactersarrows
|
|
583
|
+
*/
|
|
584
|
+
/**
|
|
585
|
+
* A plugin that provides special characters for the "Arrows" category.
|
|
586
|
+
*
|
|
587
|
+
* ```ts
|
|
588
|
+
* ClassicEditor
|
|
589
|
+
* .create( {
|
|
590
|
+
* plugins: [ ..., SpecialCharacters, SpecialCharactersArrows ],
|
|
591
|
+
* } )
|
|
592
|
+
* .then( ... )
|
|
593
|
+
* .catch( ... );
|
|
594
|
+
* ```
|
|
595
|
+
*/
|
|
596
|
+
class SpecialCharactersArrows extends Plugin {
|
|
597
|
+
/**
|
|
598
|
+
* @inheritDoc
|
|
599
|
+
*/
|
|
600
|
+
static get pluginName() {
|
|
601
|
+
return 'SpecialCharactersArrows';
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* @inheritDoc
|
|
605
|
+
*/
|
|
606
|
+
init() {
|
|
607
|
+
const editor = this.editor;
|
|
608
|
+
const t = editor.t;
|
|
609
|
+
const plugin = editor.plugins.get('SpecialCharacters');
|
|
610
|
+
plugin.addItems('Arrows', [
|
|
611
|
+
{ title: t('leftwards simple arrow'), character: '←' },
|
|
612
|
+
{ title: t('rightwards simple arrow'), character: '→' },
|
|
613
|
+
{ title: t('upwards simple arrow'), character: '↑' },
|
|
614
|
+
{ title: t('downwards simple arrow'), character: '↓' },
|
|
615
|
+
{ title: t('leftwards double arrow'), character: '⇐' },
|
|
616
|
+
{ title: t('rightwards double arrow'), character: '⇒' },
|
|
617
|
+
{ title: t('upwards double arrow'), character: '⇑' },
|
|
618
|
+
{ title: t('downwards double arrow'), character: '⇓' },
|
|
619
|
+
{ title: t('leftwards dashed arrow'), character: '⇠' },
|
|
620
|
+
{ title: t('rightwards dashed arrow'), character: '⇢' },
|
|
621
|
+
{ title: t('upwards dashed arrow'), character: '⇡' },
|
|
622
|
+
{ title: t('downwards dashed arrow'), character: '⇣' },
|
|
623
|
+
{ title: t('leftwards arrow to bar'), character: '⇤' },
|
|
624
|
+
{ title: t('rightwards arrow to bar'), character: '⇥' },
|
|
625
|
+
{ title: t('upwards arrow to bar'), character: '⤒' },
|
|
626
|
+
{ title: t('downwards arrow to bar'), character: '⤓' },
|
|
627
|
+
{ title: t('up down arrow with base'), character: '↨' },
|
|
628
|
+
{ title: t('back with leftwards arrow above'), character: '🔙' },
|
|
629
|
+
{ title: t('end with leftwards arrow above'), character: '🔚' },
|
|
630
|
+
{ title: t('on with exclamation mark with left right arrow above'), character: '🔛' },
|
|
631
|
+
{ title: t('soon with rightwards arrow above'), character: '🔜' },
|
|
632
|
+
{ title: t('top with upwards arrow above'), character: '🔝' }
|
|
633
|
+
], { label: t('Arrows') });
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
639
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
640
|
+
*/
|
|
641
|
+
/**
|
|
642
|
+
* @module special-characters/specialcharacterstext
|
|
643
|
+
*/
|
|
644
|
+
/**
|
|
645
|
+
* A plugin that provides special characters for the "Text" category.
|
|
646
|
+
*
|
|
647
|
+
* ```ts
|
|
648
|
+
* ClassicEditor
|
|
649
|
+
* .create( {
|
|
650
|
+
* plugins: [ ..., SpecialCharacters, SpecialCharactersText ],
|
|
651
|
+
* } )
|
|
652
|
+
* .then( ... )
|
|
653
|
+
* .catch( ... );
|
|
654
|
+
* ```
|
|
655
|
+
*/
|
|
656
|
+
class SpecialCharactersText extends Plugin {
|
|
657
|
+
/**
|
|
658
|
+
* @inheritDoc
|
|
659
|
+
*/
|
|
660
|
+
static get pluginName() {
|
|
661
|
+
return 'SpecialCharactersText';
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* @inheritDoc
|
|
665
|
+
*/
|
|
666
|
+
init() {
|
|
667
|
+
const editor = this.editor;
|
|
668
|
+
const t = editor.t;
|
|
669
|
+
const plugin = editor.plugins.get('SpecialCharacters');
|
|
670
|
+
plugin.addItems('Text', [
|
|
671
|
+
{ character: '‹', title: t('Single left-pointing angle quotation mark') },
|
|
672
|
+
{ character: '›', title: t('Single right-pointing angle quotation mark') },
|
|
673
|
+
{ character: '«', title: t('Left-pointing double angle quotation mark') },
|
|
674
|
+
{ character: '»', title: t('Right-pointing double angle quotation mark') },
|
|
675
|
+
{ character: '‘', title: t('Left single quotation mark') },
|
|
676
|
+
{ character: '’', title: t('Right single quotation mark') },
|
|
677
|
+
{ character: '“', title: t('Left double quotation mark') },
|
|
678
|
+
{ character: '”', title: t('Right double quotation mark') },
|
|
679
|
+
{ character: '‚', title: t('Single low-9 quotation mark') },
|
|
680
|
+
{ character: '„', title: t('Double low-9 quotation mark') },
|
|
681
|
+
{ character: '¡', title: t('Inverted exclamation mark') },
|
|
682
|
+
{ character: '¿', title: t('Inverted question mark') },
|
|
683
|
+
{ character: '‥', title: t('Two dot leader') },
|
|
684
|
+
{ character: '…', title: t('Horizontal ellipsis') },
|
|
685
|
+
{ character: '‡', title: t('Double dagger') },
|
|
686
|
+
{ character: '‰', title: t('Per mille sign') },
|
|
687
|
+
{ character: '‱', title: t('Per ten thousand sign') },
|
|
688
|
+
{ character: '‼', title: t('Double exclamation mark') },
|
|
689
|
+
{ character: '⁈', title: t('Question exclamation mark') },
|
|
690
|
+
{ character: '⁉', title: t('Exclamation question mark') },
|
|
691
|
+
{ character: '⁇', title: t('Double question mark') },
|
|
692
|
+
{ character: '©', title: t('Copyright sign') },
|
|
693
|
+
{ character: '®', title: t('Registered sign') },
|
|
694
|
+
{ character: '™', title: t('Trade mark sign') },
|
|
695
|
+
{ character: '§', title: t('Section sign') },
|
|
696
|
+
{ character: '¶', title: t('Paragraph sign') },
|
|
697
|
+
{ character: '⁋', title: t('Reversed paragraph sign') }
|
|
698
|
+
], { label: t('Text') });
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/**
|
|
703
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
704
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
705
|
+
*/
|
|
706
|
+
/**
|
|
707
|
+
* @module special-characters/specialcharactersmathematical
|
|
708
|
+
*/
|
|
709
|
+
/**
|
|
710
|
+
* A plugin that provides special characters for the "Mathematical" category.
|
|
711
|
+
*
|
|
712
|
+
* ```ts
|
|
713
|
+
* ClassicEditor
|
|
714
|
+
* .create( {
|
|
715
|
+
* plugins: [ ..., SpecialCharacters, SpecialCharactersMathematical ],
|
|
716
|
+
* } )
|
|
717
|
+
* .then( ... )
|
|
718
|
+
* .catch( ... );
|
|
719
|
+
* ```
|
|
720
|
+
*/
|
|
721
|
+
class SpecialCharactersMathematical extends Plugin {
|
|
722
|
+
/**
|
|
723
|
+
* @inheritDoc
|
|
724
|
+
*/
|
|
725
|
+
static get pluginName() {
|
|
726
|
+
return 'SpecialCharactersMathematical';
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
* @inheritDoc
|
|
730
|
+
*/
|
|
731
|
+
init() {
|
|
732
|
+
const editor = this.editor;
|
|
733
|
+
const t = editor.t;
|
|
734
|
+
const plugin = editor.plugins.get('SpecialCharacters');
|
|
735
|
+
plugin.addItems('Mathematical', [
|
|
736
|
+
{ character: '<', title: t('Less-than sign') },
|
|
737
|
+
{ character: '>', title: t('Greater-than sign') },
|
|
738
|
+
{ character: '≤', title: t('Less-than or equal to') },
|
|
739
|
+
{ character: '≥', title: t('Greater-than or equal to') },
|
|
740
|
+
{ character: '–', title: t('En dash') },
|
|
741
|
+
{ character: '—', title: t('Em dash') },
|
|
742
|
+
{ character: '¯', title: t('Macron') },
|
|
743
|
+
{ character: '‾', title: t('Overline') },
|
|
744
|
+
{ character: '°', title: t('Degree sign') },
|
|
745
|
+
{ character: '−', title: t('Minus sign') },
|
|
746
|
+
{ character: '±', title: t('Plus-minus sign') },
|
|
747
|
+
{ character: '÷', title: t('Division sign') },
|
|
748
|
+
{ character: '⁄', title: t('Fraction slash') },
|
|
749
|
+
{ character: '×', title: t('Multiplication sign') },
|
|
750
|
+
{ character: 'ƒ', title: t('Latin small letter f with hook') },
|
|
751
|
+
{ character: '∫', title: t('Integral') },
|
|
752
|
+
{ character: '∑', title: t('N-ary summation') },
|
|
753
|
+
{ character: '∞', title: t('Infinity') },
|
|
754
|
+
{ character: '√', title: t('Square root') },
|
|
755
|
+
{ character: '∼', title: t('Tilde operator') },
|
|
756
|
+
{ character: '≅', title: t('Approximately equal to') },
|
|
757
|
+
{ character: '≈', title: t('Almost equal to') },
|
|
758
|
+
{ character: '≠', title: t('Not equal to') },
|
|
759
|
+
{ character: '≡', title: t('Identical to') },
|
|
760
|
+
{ character: '∈', title: t('Element of') },
|
|
761
|
+
{ character: '∉', title: t('Not an element of') },
|
|
762
|
+
{ character: '∋', title: t('Contains as member') },
|
|
763
|
+
{ character: '∏', title: t('N-ary product') },
|
|
764
|
+
{ character: '∧', title: t('Logical and') },
|
|
765
|
+
{ character: '∨', title: t('Logical or') },
|
|
766
|
+
{ character: '¬', title: t('Not sign') },
|
|
767
|
+
{ character: '∩', title: t('Intersection') },
|
|
768
|
+
{ character: '∪', title: t('Union') },
|
|
769
|
+
{ character: '∂', title: t('Partial differential') },
|
|
770
|
+
{ character: '∀', title: t('For all') },
|
|
771
|
+
{ character: '∃', title: t('There exists') },
|
|
772
|
+
{ character: '∅', title: t('Empty set') },
|
|
773
|
+
{ character: '∇', title: t('Nabla') },
|
|
774
|
+
{ character: '∗', title: t('Asterisk operator') },
|
|
775
|
+
{ character: '∝', title: t('Proportional to') },
|
|
776
|
+
{ character: '∠', title: t('Angle') },
|
|
777
|
+
{ character: '¼', title: t('Vulgar fraction one quarter') },
|
|
778
|
+
{ character: '½', title: t('Vulgar fraction one half') },
|
|
779
|
+
{ character: '¾', title: t('Vulgar fraction three quarters') }
|
|
780
|
+
], { label: t('Mathematical') });
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
786
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
787
|
+
*/
|
|
788
|
+
/**
|
|
789
|
+
* @module special-characters/specialcharacterslatin
|
|
790
|
+
*/
|
|
791
|
+
/**
|
|
792
|
+
* A plugin that provides special characters for the "Latin" category.
|
|
793
|
+
*
|
|
794
|
+
* ```ts
|
|
795
|
+
* ClassicEditor
|
|
796
|
+
* .create( {
|
|
797
|
+
* plugins: [ ..., SpecialCharacters, SpecialCharactersLatin ],
|
|
798
|
+
* } )
|
|
799
|
+
* .then( ... )
|
|
800
|
+
* .catch( ... );
|
|
801
|
+
* ```
|
|
802
|
+
*/
|
|
803
|
+
class SpecialCharactersLatin extends Plugin {
|
|
804
|
+
/**
|
|
805
|
+
* @inheritDoc
|
|
806
|
+
*/
|
|
807
|
+
static get pluginName() {
|
|
808
|
+
return 'SpecialCharactersLatin';
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* @inheritDoc
|
|
812
|
+
*/
|
|
813
|
+
init() {
|
|
814
|
+
const editor = this.editor;
|
|
815
|
+
const t = editor.t;
|
|
816
|
+
const plugin = editor.plugins.get('SpecialCharacters');
|
|
817
|
+
plugin.addItems('Latin', [
|
|
818
|
+
{ character: 'Ā', title: t('Latin capital letter a with macron') },
|
|
819
|
+
{ character: 'ā', title: t('Latin small letter a with macron') },
|
|
820
|
+
{ character: 'Ă', title: t('Latin capital letter a with breve') },
|
|
821
|
+
{ character: 'ă', title: t('Latin small letter a with breve') },
|
|
822
|
+
{ character: 'Ą', title: t('Latin capital letter a with ogonek') },
|
|
823
|
+
{ character: 'ą', title: t('Latin small letter a with ogonek') },
|
|
824
|
+
{ character: 'Ć', title: t('Latin capital letter c with acute') },
|
|
825
|
+
{ character: 'ć', title: t('Latin small letter c with acute') },
|
|
826
|
+
{ character: 'Ĉ', title: t('Latin capital letter c with circumflex') },
|
|
827
|
+
{ character: 'ĉ', title: t('Latin small letter c with circumflex') },
|
|
828
|
+
{ character: 'Ċ', title: t('Latin capital letter c with dot above') },
|
|
829
|
+
{ character: 'ċ', title: t('Latin small letter c with dot above') },
|
|
830
|
+
{ character: 'Č', title: t('Latin capital letter c with caron') },
|
|
831
|
+
{ character: 'č', title: t('Latin small letter c with caron') },
|
|
832
|
+
{ character: 'Ď', title: t('Latin capital letter d with caron') },
|
|
833
|
+
{ character: 'ď', title: t('Latin small letter d with caron') },
|
|
834
|
+
{ character: 'Đ', title: t('Latin capital letter d with stroke') },
|
|
835
|
+
{ character: 'đ', title: t('Latin small letter d with stroke') },
|
|
836
|
+
{ character: 'Ē', title: t('Latin capital letter e with macron') },
|
|
837
|
+
{ character: 'ē', title: t('Latin small letter e with macron') },
|
|
838
|
+
{ character: 'Ĕ', title: t('Latin capital letter e with breve') },
|
|
839
|
+
{ character: 'ĕ', title: t('Latin small letter e with breve') },
|
|
840
|
+
{ character: 'Ė', title: t('Latin capital letter e with dot above') },
|
|
841
|
+
{ character: 'ė', title: t('Latin small letter e with dot above') },
|
|
842
|
+
{ character: 'Ę', title: t('Latin capital letter e with ogonek') },
|
|
843
|
+
{ character: 'ę', title: t('Latin small letter e with ogonek') },
|
|
844
|
+
{ character: 'Ě', title: t('Latin capital letter e with caron') },
|
|
845
|
+
{ character: 'ě', title: t('Latin small letter e with caron') },
|
|
846
|
+
{ character: 'Ĝ', title: t('Latin capital letter g with circumflex') },
|
|
847
|
+
{ character: 'ĝ', title: t('Latin small letter g with circumflex') },
|
|
848
|
+
{ character: 'Ğ', title: t('Latin capital letter g with breve') },
|
|
849
|
+
{ character: 'ğ', title: t('Latin small letter g with breve') },
|
|
850
|
+
{ character: 'Ġ', title: t('Latin capital letter g with dot above') },
|
|
851
|
+
{ character: 'ġ', title: t('Latin small letter g with dot above') },
|
|
852
|
+
{ character: 'Ģ', title: t('Latin capital letter g with cedilla') },
|
|
853
|
+
{ character: 'ģ', title: t('Latin small letter g with cedilla') },
|
|
854
|
+
{ character: 'Ĥ', title: t('Latin capital letter h with circumflex') },
|
|
855
|
+
{ character: 'ĥ', title: t('Latin small letter h with circumflex') },
|
|
856
|
+
{ character: 'Ħ', title: t('Latin capital letter h with stroke') },
|
|
857
|
+
{ character: 'ħ', title: t('Latin small letter h with stroke') },
|
|
858
|
+
{ character: 'Ĩ', title: t('Latin capital letter i with tilde') },
|
|
859
|
+
{ character: 'ĩ', title: t('Latin small letter i with tilde') },
|
|
860
|
+
{ character: 'Ī', title: t('Latin capital letter i with macron') },
|
|
861
|
+
{ character: 'ī', title: t('Latin small letter i with macron') },
|
|
862
|
+
{ character: 'Ĭ', title: t('Latin capital letter i with breve') },
|
|
863
|
+
{ character: 'ĭ', title: t('Latin small letter i with breve') },
|
|
864
|
+
{ character: 'Į', title: t('Latin capital letter i with ogonek') },
|
|
865
|
+
{ character: 'į', title: t('Latin small letter i with ogonek') },
|
|
866
|
+
{ character: 'İ', title: t('Latin capital letter i with dot above') },
|
|
867
|
+
{ character: 'ı', title: t('Latin small letter dotless i') },
|
|
868
|
+
{ character: 'IJ', title: t('Latin capital ligature ij') },
|
|
869
|
+
{ character: 'ij', title: t('Latin small ligature ij') },
|
|
870
|
+
{ character: 'Ĵ', title: t('Latin capital letter j with circumflex') },
|
|
871
|
+
{ character: 'ĵ', title: t('Latin small letter j with circumflex') },
|
|
872
|
+
{ character: 'Ķ', title: t('Latin capital letter k with cedilla') },
|
|
873
|
+
{ character: 'ķ', title: t('Latin small letter k with cedilla') },
|
|
874
|
+
{ character: 'ĸ', title: t('Latin small letter kra') },
|
|
875
|
+
{ character: 'Ĺ', title: t('Latin capital letter l with acute') },
|
|
876
|
+
{ character: 'ĺ', title: t('Latin small letter l with acute') },
|
|
877
|
+
{ character: 'Ļ', title: t('Latin capital letter l with cedilla') },
|
|
878
|
+
{ character: 'ļ', title: t('Latin small letter l with cedilla') },
|
|
879
|
+
{ character: 'Ľ', title: t('Latin capital letter l with caron') },
|
|
880
|
+
{ character: 'ľ', title: t('Latin small letter l with caron') },
|
|
881
|
+
{ character: 'Ŀ', title: t('Latin capital letter l with middle dot') },
|
|
882
|
+
{ character: 'ŀ', title: t('Latin small letter l with middle dot') },
|
|
883
|
+
{ character: 'Ł', title: t('Latin capital letter l with stroke') },
|
|
884
|
+
{ character: 'ł', title: t('Latin small letter l with stroke') },
|
|
885
|
+
{ character: 'Ń', title: t('Latin capital letter n with acute') },
|
|
886
|
+
{ character: 'ń', title: t('Latin small letter n with acute') },
|
|
887
|
+
{ character: 'Ņ', title: t('Latin capital letter n with cedilla') },
|
|
888
|
+
{ character: 'ņ', title: t('Latin small letter n with cedilla') },
|
|
889
|
+
{ character: 'Ň', title: t('Latin capital letter n with caron') },
|
|
890
|
+
{ character: 'ň', title: t('Latin small letter n with caron') },
|
|
891
|
+
{ character: 'ʼn', title: t('Latin small letter n preceded by apostrophe') },
|
|
892
|
+
{ character: 'Ŋ', title: t('Latin capital letter eng') },
|
|
893
|
+
{ character: 'ŋ', title: t('Latin small letter eng') },
|
|
894
|
+
{ character: 'Ō', title: t('Latin capital letter o with macron') },
|
|
895
|
+
{ character: 'ō', title: t('Latin small letter o with macron') },
|
|
896
|
+
{ character: 'Ŏ', title: t('Latin capital letter o with breve') },
|
|
897
|
+
{ character: 'ŏ', title: t('Latin small letter o with breve') },
|
|
898
|
+
{ character: 'Ő', title: t('Latin capital letter o with double acute') },
|
|
899
|
+
{ character: 'ő', title: t('Latin small letter o with double acute') },
|
|
900
|
+
{ character: 'Œ', title: t('Latin capital ligature oe') },
|
|
901
|
+
{ character: 'œ', title: t('Latin small ligature oe') },
|
|
902
|
+
{ character: 'Ŕ', title: t('Latin capital letter r with acute') },
|
|
903
|
+
{ character: 'ŕ', title: t('Latin small letter r with acute') },
|
|
904
|
+
{ character: 'Ŗ', title: t('Latin capital letter r with cedilla') },
|
|
905
|
+
{ character: 'ŗ', title: t('Latin small letter r with cedilla') },
|
|
906
|
+
{ character: 'Ř', title: t('Latin capital letter r with caron') },
|
|
907
|
+
{ character: 'ř', title: t('Latin small letter r with caron') },
|
|
908
|
+
{ character: 'Ś', title: t('Latin capital letter s with acute') },
|
|
909
|
+
{ character: 'ś', title: t('Latin small letter s with acute') },
|
|
910
|
+
{ character: 'Ŝ', title: t('Latin capital letter s with circumflex') },
|
|
911
|
+
{ character: 'ŝ', title: t('Latin small letter s with circumflex') },
|
|
912
|
+
{ character: 'Ş', title: t('Latin capital letter s with cedilla') },
|
|
913
|
+
{ character: 'ş', title: t('Latin small letter s with cedilla') },
|
|
914
|
+
{ character: 'Š', title: t('Latin capital letter s with caron') },
|
|
915
|
+
{ character: 'š', title: t('Latin small letter s with caron') },
|
|
916
|
+
{ character: 'Ţ', title: t('Latin capital letter t with cedilla') },
|
|
917
|
+
{ character: 'ţ', title: t('Latin small letter t with cedilla') },
|
|
918
|
+
{ character: 'Ť', title: t('Latin capital letter t with caron') },
|
|
919
|
+
{ character: 'ť', title: t('Latin small letter t with caron') },
|
|
920
|
+
{ character: 'Ŧ', title: t('Latin capital letter t with stroke') },
|
|
921
|
+
{ character: 'ŧ', title: t('Latin small letter t with stroke') },
|
|
922
|
+
{ character: 'Ũ', title: t('Latin capital letter u with tilde') },
|
|
923
|
+
{ character: 'ũ', title: t('Latin small letter u with tilde') },
|
|
924
|
+
{ character: 'Ū', title: t('Latin capital letter u with macron') },
|
|
925
|
+
{ character: 'ū', title: t('Latin small letter u with macron') },
|
|
926
|
+
{ character: 'Ŭ', title: t('Latin capital letter u with breve') },
|
|
927
|
+
{ character: 'ŭ', title: t('Latin small letter u with breve') },
|
|
928
|
+
{ character: 'Ů', title: t('Latin capital letter u with ring above') },
|
|
929
|
+
{ character: 'ů', title: t('Latin small letter u with ring above') },
|
|
930
|
+
{ character: 'Ű', title: t('Latin capital letter u with double acute') },
|
|
931
|
+
{ character: 'ű', title: t('Latin small letter u with double acute') },
|
|
932
|
+
{ character: 'Ų', title: t('Latin capital letter u with ogonek') },
|
|
933
|
+
{ character: 'ų', title: t('Latin small letter u with ogonek') },
|
|
934
|
+
{ character: 'Ŵ', title: t('Latin capital letter w with circumflex') },
|
|
935
|
+
{ character: 'ŵ', title: t('Latin small letter w with circumflex') },
|
|
936
|
+
{ character: 'Ŷ', title: t('Latin capital letter y with circumflex') },
|
|
937
|
+
{ character: 'ŷ', title: t('Latin small letter y with circumflex') },
|
|
938
|
+
{ character: 'Ÿ', title: t('Latin capital letter y with diaeresis') },
|
|
939
|
+
{ character: 'Ź', title: t('Latin capital letter z with acute') },
|
|
940
|
+
{ character: 'ź', title: t('Latin small letter z with acute') },
|
|
941
|
+
{ character: 'Ż', title: t('Latin capital letter z with dot above') },
|
|
942
|
+
{ character: 'ż', title: t('Latin small letter z with dot above') },
|
|
943
|
+
{ character: 'Ž', title: t('Latin capital letter z with caron') },
|
|
944
|
+
{ character: 'ž', title: t('Latin small letter z with caron') },
|
|
945
|
+
{ character: 'ſ', title: t('Latin small letter long s') }
|
|
946
|
+
], { label: t('Latin') });
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
/**
|
|
951
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
952
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
953
|
+
*/
|
|
954
|
+
/**
|
|
955
|
+
* @module special-characters/specialcharacterscurrency
|
|
956
|
+
*/
|
|
957
|
+
/**
|
|
958
|
+
* A plugin that provides special characters for the "Currency" category.
|
|
959
|
+
*
|
|
960
|
+
* ```ts
|
|
961
|
+
* ClassicEditor
|
|
962
|
+
* .create( {
|
|
963
|
+
* plugins: [ ..., SpecialCharacters, SpecialCharactersCurrency ],
|
|
964
|
+
* } )
|
|
965
|
+
* .then( ... )
|
|
966
|
+
* .catch( ... );
|
|
967
|
+
* ```
|
|
968
|
+
*/
|
|
969
|
+
class SpecialCharactersCurrency extends Plugin {
|
|
970
|
+
/**
|
|
971
|
+
* @inheritDoc
|
|
972
|
+
*/
|
|
973
|
+
static get pluginName() {
|
|
974
|
+
return 'SpecialCharactersCurrency';
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* @inheritDoc
|
|
978
|
+
*/
|
|
979
|
+
init() {
|
|
980
|
+
const editor = this.editor;
|
|
981
|
+
const t = editor.t;
|
|
982
|
+
const plugin = editor.plugins.get('SpecialCharacters');
|
|
983
|
+
plugin.addItems('Currency', [
|
|
984
|
+
{ character: '$', title: t('Dollar sign') },
|
|
985
|
+
{ character: '€', title: t('Euro sign') },
|
|
986
|
+
{ character: '¥', title: t('Yen sign') },
|
|
987
|
+
{ character: '£', title: t('Pound sign') },
|
|
988
|
+
{ character: '¢', title: t('Cent sign') },
|
|
989
|
+
{ character: '₠', title: t('Euro-currency sign') },
|
|
990
|
+
{ character: '₡', title: t('Colon sign') },
|
|
991
|
+
{ character: '₢', title: t('Cruzeiro sign') },
|
|
992
|
+
{ character: '₣', title: t('French franc sign') },
|
|
993
|
+
{ character: '₤', title: t('Lira sign') },
|
|
994
|
+
{ character: '¤', title: t('Currency sign') },
|
|
995
|
+
{ character: '₿', title: t('Bitcoin sign') },
|
|
996
|
+
{ character: '₥', title: t('Mill sign') },
|
|
997
|
+
{ character: '₦', title: t('Naira sign') },
|
|
998
|
+
{ character: '₧', title: t('Peseta sign') },
|
|
999
|
+
{ character: '₨', title: t('Rupee sign') },
|
|
1000
|
+
{ character: '₩', title: t('Won sign') },
|
|
1001
|
+
{ character: '₪', title: t('New sheqel sign') },
|
|
1002
|
+
{ character: '₫', title: t('Dong sign') },
|
|
1003
|
+
{ character: '₭', title: t('Kip sign') },
|
|
1004
|
+
{ character: '₮', title: t('Tugrik sign') },
|
|
1005
|
+
{ character: '₯', title: t('Drachma sign') },
|
|
1006
|
+
{ character: '₰', title: t('German penny sign') },
|
|
1007
|
+
{ character: '₱', title: t('Peso sign') },
|
|
1008
|
+
{ character: '₲', title: t('Guarani sign') },
|
|
1009
|
+
{ character: '₳', title: t('Austral sign') },
|
|
1010
|
+
{ character: '₴', title: t('Hryvnia sign') },
|
|
1011
|
+
{ character: '₵', title: t('Cedi sign') },
|
|
1012
|
+
{ character: '₶', title: t('Livre tournois sign') },
|
|
1013
|
+
{ character: '₷', title: t('Spesmilo sign') },
|
|
1014
|
+
{ character: '₸', title: t('Tenge sign') },
|
|
1015
|
+
{ character: '₹', title: t('Indian rupee sign') },
|
|
1016
|
+
{ character: '₺', title: t('Turkish lira sign') },
|
|
1017
|
+
{ character: '₻', title: t('Nordic mark sign') },
|
|
1018
|
+
{ character: '₼', title: t('Manat sign') },
|
|
1019
|
+
{ character: '₽', title: t('Ruble sign') }
|
|
1020
|
+
], { label: t('Currency') });
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
/**
|
|
1025
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
1026
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
1027
|
+
*/
|
|
1028
|
+
/**
|
|
1029
|
+
* @module special-characters/specialcharactersessentials
|
|
1030
|
+
*/
|
|
1031
|
+
/**
|
|
1032
|
+
* A plugin combining a basic set of characters for the special characters plugin.
|
|
1033
|
+
*
|
|
1034
|
+
* ```ts
|
|
1035
|
+
* ClassicEditor
|
|
1036
|
+
* .create( {
|
|
1037
|
+
* plugins: [ ..., SpecialCharacters, SpecialCharactersEssentials ],
|
|
1038
|
+
* } )
|
|
1039
|
+
* .then( ... )
|
|
1040
|
+
* .catch( ... );
|
|
1041
|
+
* ```
|
|
1042
|
+
*/
|
|
1043
|
+
class SpecialCharactersEssentials extends Plugin {
|
|
1044
|
+
/**
|
|
1045
|
+
* @inheritDoc
|
|
1046
|
+
*/
|
|
1047
|
+
static get pluginName() {
|
|
1048
|
+
return 'SpecialCharactersEssentials';
|
|
1049
|
+
}
|
|
1050
|
+
/**
|
|
1051
|
+
* @inheritDoc
|
|
1052
|
+
*/
|
|
1053
|
+
static get requires() {
|
|
1054
|
+
return [
|
|
1055
|
+
SpecialCharactersCurrency,
|
|
1056
|
+
SpecialCharactersText,
|
|
1057
|
+
SpecialCharactersMathematical,
|
|
1058
|
+
SpecialCharactersArrows,
|
|
1059
|
+
SpecialCharactersLatin
|
|
1060
|
+
];
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
export { SpecialCharacters, SpecialCharactersArrows, SpecialCharactersCurrency, SpecialCharactersEssentials, SpecialCharactersLatin, SpecialCharactersMathematical, SpecialCharactersText };
|
|
1065
|
+
//# sourceMappingURL=index.js.map
|