@ckeditor/ckeditor5-special-characters 41.3.1 → 41.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/build/special-characters.js +1 -1
  2. package/build/translations/ti.js +1 -0
  3. package/dist/index-content.css +4 -0
  4. package/dist/index-editor.css +14 -0
  5. package/dist/index.css +28 -0
  6. package/dist/index.css.map +1 -0
  7. package/dist/index.js +1663 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/translations/ar.d.ts +8 -0
  10. package/dist/translations/ar.js +5 -0
  11. package/dist/translations/ar.umd.js +11 -0
  12. package/dist/translations/az.d.ts +8 -0
  13. package/dist/translations/az.js +5 -0
  14. package/dist/translations/az.umd.js +11 -0
  15. package/dist/translations/bg.d.ts +8 -0
  16. package/dist/translations/bg.js +5 -0
  17. package/dist/translations/bg.umd.js +11 -0
  18. package/dist/translations/bn.d.ts +8 -0
  19. package/dist/translations/bn.js +5 -0
  20. package/dist/translations/bn.umd.js +11 -0
  21. package/dist/translations/ca.d.ts +8 -0
  22. package/dist/translations/ca.js +5 -0
  23. package/dist/translations/ca.umd.js +11 -0
  24. package/dist/translations/cs.d.ts +8 -0
  25. package/dist/translations/cs.js +5 -0
  26. package/dist/translations/cs.umd.js +11 -0
  27. package/dist/translations/da.d.ts +8 -0
  28. package/dist/translations/da.js +5 -0
  29. package/dist/translations/da.umd.js +11 -0
  30. package/dist/translations/de.d.ts +8 -0
  31. package/dist/translations/de.js +5 -0
  32. package/dist/translations/de.umd.js +11 -0
  33. package/dist/translations/el.d.ts +8 -0
  34. package/dist/translations/el.js +5 -0
  35. package/dist/translations/el.umd.js +11 -0
  36. package/dist/translations/en-au.d.ts +8 -0
  37. package/dist/translations/en-au.js +5 -0
  38. package/dist/translations/en-au.umd.js +11 -0
  39. package/dist/translations/en.d.ts +8 -0
  40. package/dist/translations/en.js +5 -0
  41. package/dist/translations/en.umd.js +11 -0
  42. package/dist/translations/es.d.ts +8 -0
  43. package/dist/translations/es.js +5 -0
  44. package/dist/translations/es.umd.js +11 -0
  45. package/dist/translations/et.d.ts +8 -0
  46. package/dist/translations/et.js +5 -0
  47. package/dist/translations/et.umd.js +11 -0
  48. package/dist/translations/fa.d.ts +8 -0
  49. package/dist/translations/fa.js +5 -0
  50. package/dist/translations/fa.umd.js +11 -0
  51. package/dist/translations/fi.d.ts +8 -0
  52. package/dist/translations/fi.js +5 -0
  53. package/dist/translations/fi.umd.js +11 -0
  54. package/dist/translations/fr.d.ts +8 -0
  55. package/dist/translations/fr.js +5 -0
  56. package/dist/translations/fr.umd.js +11 -0
  57. package/dist/translations/gl.d.ts +8 -0
  58. package/dist/translations/gl.js +5 -0
  59. package/dist/translations/gl.umd.js +11 -0
  60. package/dist/translations/he.d.ts +8 -0
  61. package/dist/translations/he.js +5 -0
  62. package/dist/translations/he.umd.js +11 -0
  63. package/dist/translations/hi.d.ts +8 -0
  64. package/dist/translations/hi.js +5 -0
  65. package/dist/translations/hi.umd.js +11 -0
  66. package/dist/translations/hr.d.ts +8 -0
  67. package/dist/translations/hr.js +5 -0
  68. package/dist/translations/hr.umd.js +11 -0
  69. package/dist/translations/hu.d.ts +8 -0
  70. package/dist/translations/hu.js +5 -0
  71. package/dist/translations/hu.umd.js +11 -0
  72. package/dist/translations/id.d.ts +8 -0
  73. package/dist/translations/id.js +5 -0
  74. package/dist/translations/id.umd.js +11 -0
  75. package/dist/translations/it.d.ts +8 -0
  76. package/dist/translations/it.js +5 -0
  77. package/dist/translations/it.umd.js +11 -0
  78. package/dist/translations/ja.d.ts +8 -0
  79. package/dist/translations/ja.js +5 -0
  80. package/dist/translations/ja.umd.js +11 -0
  81. package/dist/translations/ko.d.ts +8 -0
  82. package/dist/translations/ko.js +5 -0
  83. package/dist/translations/ko.umd.js +11 -0
  84. package/dist/translations/lt.d.ts +8 -0
  85. package/dist/translations/lt.js +5 -0
  86. package/dist/translations/lt.umd.js +11 -0
  87. package/dist/translations/lv.d.ts +8 -0
  88. package/dist/translations/lv.js +5 -0
  89. package/dist/translations/lv.umd.js +11 -0
  90. package/dist/translations/ms.d.ts +8 -0
  91. package/dist/translations/ms.js +5 -0
  92. package/dist/translations/ms.umd.js +11 -0
  93. package/dist/translations/nl.d.ts +8 -0
  94. package/dist/translations/nl.js +5 -0
  95. package/dist/translations/nl.umd.js +11 -0
  96. package/dist/translations/no.d.ts +8 -0
  97. package/dist/translations/no.js +5 -0
  98. package/dist/translations/no.umd.js +11 -0
  99. package/dist/translations/pl.d.ts +8 -0
  100. package/dist/translations/pl.js +5 -0
  101. package/dist/translations/pl.umd.js +11 -0
  102. package/dist/translations/pt-br.d.ts +8 -0
  103. package/dist/translations/pt-br.js +5 -0
  104. package/dist/translations/pt-br.umd.js +11 -0
  105. package/dist/translations/pt.d.ts +8 -0
  106. package/dist/translations/pt.js +5 -0
  107. package/dist/translations/pt.umd.js +11 -0
  108. package/dist/translations/ro.d.ts +8 -0
  109. package/dist/translations/ro.js +5 -0
  110. package/dist/translations/ro.umd.js +11 -0
  111. package/dist/translations/ru.d.ts +8 -0
  112. package/dist/translations/ru.js +5 -0
  113. package/dist/translations/ru.umd.js +11 -0
  114. package/dist/translations/sk.d.ts +8 -0
  115. package/dist/translations/sk.js +5 -0
  116. package/dist/translations/sk.umd.js +11 -0
  117. package/dist/translations/sq.d.ts +8 -0
  118. package/dist/translations/sq.js +5 -0
  119. package/dist/translations/sq.umd.js +11 -0
  120. package/dist/translations/sr-latn.d.ts +8 -0
  121. package/dist/translations/sr-latn.js +5 -0
  122. package/dist/translations/sr-latn.umd.js +11 -0
  123. package/dist/translations/sr.d.ts +8 -0
  124. package/dist/translations/sr.js +5 -0
  125. package/dist/translations/sr.umd.js +11 -0
  126. package/dist/translations/sv.d.ts +8 -0
  127. package/dist/translations/sv.js +5 -0
  128. package/dist/translations/sv.umd.js +11 -0
  129. package/dist/translations/th.d.ts +8 -0
  130. package/dist/translations/th.js +5 -0
  131. package/dist/translations/th.umd.js +11 -0
  132. package/dist/translations/ti.d.ts +8 -0
  133. package/dist/translations/ti.js +5 -0
  134. package/dist/translations/ti.umd.js +11 -0
  135. package/dist/translations/tk.d.ts +8 -0
  136. package/dist/translations/tk.js +5 -0
  137. package/dist/translations/tk.umd.js +11 -0
  138. package/dist/translations/tr.d.ts +8 -0
  139. package/dist/translations/tr.js +5 -0
  140. package/dist/translations/tr.umd.js +11 -0
  141. package/dist/translations/uk.d.ts +8 -0
  142. package/dist/translations/uk.js +5 -0
  143. package/dist/translations/uk.umd.js +11 -0
  144. package/dist/translations/ur.d.ts +8 -0
  145. package/dist/translations/ur.js +5 -0
  146. package/dist/translations/ur.umd.js +11 -0
  147. package/dist/translations/uz.d.ts +8 -0
  148. package/dist/translations/uz.js +5 -0
  149. package/dist/translations/uz.umd.js +11 -0
  150. package/dist/translations/vi.d.ts +8 -0
  151. package/dist/translations/vi.js +5 -0
  152. package/dist/translations/vi.umd.js +11 -0
  153. package/dist/translations/zh-cn.d.ts +8 -0
  154. package/dist/translations/zh-cn.js +5 -0
  155. package/dist/translations/zh-cn.umd.js +11 -0
  156. package/dist/translations/zh.d.ts +8 -0
  157. package/dist/translations/zh.js +5 -0
  158. package/dist/translations/zh.umd.js +11 -0
  159. package/dist/types/augmentation.d.ts +28 -0
  160. package/dist/types/index.d.ts +20 -0
  161. package/dist/types/specialcharacters.d.ts +100 -0
  162. package/dist/types/specialcharactersarrows.d.ts +34 -0
  163. package/dist/types/specialcharactersconfig.d.ts +55 -0
  164. package/dist/types/specialcharacterscurrency.d.ts +34 -0
  165. package/dist/types/specialcharactersessentials.d.ts +39 -0
  166. package/dist/types/specialcharacterslatin.d.ts +34 -0
  167. package/dist/types/specialcharactersmathematical.d.ts +34 -0
  168. package/dist/types/specialcharacterstext.d.ts +34 -0
  169. package/dist/types/ui/charactergridview.d.ts +98 -0
  170. package/dist/types/ui/characterinfoview.d.ts +39 -0
  171. package/dist/types/ui/specialcharactersnavigationview.d.ts +63 -0
  172. package/dist/types/ui/specialcharactersview.d.ts +69 -0
  173. package/lang/translations/ti.po +1078 -0
  174. package/package.json +3 -2
package/dist/index.js ADDED
@@ -0,0 +1,1663 @@
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, ButtonView, addKeyboardHandlingForGrid, FocusCycler } from '@ckeditor/ckeditor5-ui/dist/index.js';
8
+ import { Collection, FocusTracker, KeystrokeHandler, global, CKEditorError } from '@ckeditor/ckeditor5-utils/dist/index.js';
9
+
10
+ class SpecialCharactersNavigationView extends FormHeaderView {
11
+ /**
12
+ * Returns the name of the character group currently selected in the {@link #groupDropdownView}.
13
+ */ get currentGroupName() {
14
+ return this.groupDropdownView.value;
15
+ }
16
+ /**
17
+ * Focuses the character categories dropdown.
18
+ */ focus() {
19
+ this.groupDropdownView.focus();
20
+ }
21
+ /**
22
+ * Returns a dropdown that allows selecting character groups.
23
+ *
24
+ * @param groupNames The names of the character groups and their displayed labels.
25
+ */ _createGroupDropdown(groupNames) {
26
+ const locale = this.locale;
27
+ const t = locale.t;
28
+ const dropdown = createDropdown(locale);
29
+ const groupDefinitions = this._getCharacterGroupListItemDefinitions(dropdown, groupNames);
30
+ const accessibleLabel = t('Character categories');
31
+ dropdown.set('value', groupDefinitions.first.model.name);
32
+ dropdown.buttonView.bind('label').to(dropdown, 'value', (value)=>groupNames.get(value));
33
+ dropdown.buttonView.set({
34
+ isOn: false,
35
+ withText: true,
36
+ tooltip: accessibleLabel,
37
+ class: [
38
+ 'ck-dropdown__button_label-width_auto'
39
+ ],
40
+ ariaLabel: accessibleLabel,
41
+ ariaLabelledBy: undefined
42
+ });
43
+ dropdown.on('execute', (evt)=>{
44
+ dropdown.value = evt.source.name;
45
+ });
46
+ dropdown.delegate('execute').to(this);
47
+ addListToDropdown(dropdown, groupDefinitions, {
48
+ ariaLabel: accessibleLabel,
49
+ role: 'menu'
50
+ });
51
+ return dropdown;
52
+ }
53
+ /**
54
+ * Returns list item definitions to be used in the character group dropdown
55
+ * representing specific character groups.
56
+ *
57
+ * @param dropdown Dropdown view element
58
+ * @param groupNames The names of the character groups and their displayed labels.
59
+ */ _getCharacterGroupListItemDefinitions(dropdown, groupNames) {
60
+ const groupDefs = new Collection();
61
+ for (const [name, label] of groupNames){
62
+ const model = new ViewModel({
63
+ name,
64
+ label,
65
+ withText: true,
66
+ role: 'menuitemradio'
67
+ });
68
+ model.bind('isOn').to(dropdown, 'value', (value)=>value === model.name);
69
+ groupDefs.add({
70
+ type: 'button',
71
+ model
72
+ });
73
+ }
74
+ return groupDefs;
75
+ }
76
+ /**
77
+ * Creates an instance of the {@link module:special-characters/ui/specialcharactersnavigationview~SpecialCharactersNavigationView}
78
+ * class.
79
+ *
80
+ * @param locale The localization services instance.
81
+ * @param groupNames The names of the character groups and their displayed labels.
82
+ */ constructor(locale, groupNames){
83
+ super(locale);
84
+ const t = locale.t;
85
+ this.set('class', 'ck-special-characters-navigation');
86
+ this.groupDropdownView = this._createGroupDropdown(groupNames);
87
+ this.groupDropdownView.panelPosition = locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw';
88
+ this.label = t('Special characters');
89
+ this.children.add(this.groupDropdownView);
90
+ }
91
+ }
92
+
93
+ class CharacterGridView extends View {
94
+ /**
95
+ * Creates a new tile for the grid.
96
+ *
97
+ * @param character A human-readable character displayed as the label (e.g. "ε").
98
+ * @param name The name of the character (e.g. "greek small letter epsilon").
99
+ */ createTile(character, name) {
100
+ const tile = new ButtonView(this.locale);
101
+ tile.set({
102
+ label: character,
103
+ withText: true,
104
+ class: 'ck-character-grid__tile'
105
+ });
106
+ // Labels are vital for the users to understand what character they're looking at.
107
+ // For now we're using native title attribute for that, see #5817.
108
+ tile.extendTemplate({
109
+ attributes: {
110
+ title: name
111
+ },
112
+ on: {
113
+ mouseover: tile.bindTemplate.to('mouseover'),
114
+ focus: tile.bindTemplate.to('focus')
115
+ }
116
+ });
117
+ tile.on('mouseover', ()=>{
118
+ this.fire('tileHover', {
119
+ name,
120
+ character
121
+ });
122
+ });
123
+ tile.on('focus', ()=>{
124
+ this.fire('tileFocus', {
125
+ name,
126
+ character
127
+ });
128
+ });
129
+ tile.on('execute', ()=>{
130
+ this.fire('execute', {
131
+ name,
132
+ character
133
+ });
134
+ });
135
+ return tile;
136
+ }
137
+ /**
138
+ * @inheritDoc
139
+ */ render() {
140
+ super.render();
141
+ for (const item of this.tiles){
142
+ this.focusTracker.add(item.element);
143
+ }
144
+ this.tiles.on('change', (eventInfo, { added, removed })=>{
145
+ if (added.length > 0) {
146
+ for (const item of added){
147
+ this.focusTracker.add(item.element);
148
+ }
149
+ }
150
+ if (removed.length > 0) {
151
+ for (const item of removed){
152
+ this.focusTracker.remove(item.element);
153
+ }
154
+ }
155
+ });
156
+ this.keystrokes.listenTo(this.element);
157
+ }
158
+ /**
159
+ * @inheritDoc
160
+ */ destroy() {
161
+ super.destroy();
162
+ this.keystrokes.destroy();
163
+ }
164
+ /**
165
+ * Focuses the first focusable in {@link ~CharacterGridView#tiles}.
166
+ */ focus() {
167
+ this.tiles.first.focus();
168
+ }
169
+ /**
170
+ * Creates an instance of a character grid containing tiles representing special characters.
171
+ *
172
+ * @param locale The localization services instance.
173
+ */ constructor(locale){
174
+ super(locale);
175
+ this.tiles = this.createCollection();
176
+ this.setTemplate({
177
+ tag: 'div',
178
+ children: [
179
+ {
180
+ tag: 'div',
181
+ attributes: {
182
+ class: [
183
+ 'ck',
184
+ 'ck-character-grid__tiles'
185
+ ]
186
+ },
187
+ children: this.tiles
188
+ }
189
+ ],
190
+ attributes: {
191
+ class: [
192
+ 'ck',
193
+ 'ck-character-grid'
194
+ ]
195
+ }
196
+ });
197
+ this.focusTracker = new FocusTracker();
198
+ this.keystrokes = new KeystrokeHandler();
199
+ addKeyboardHandlingForGrid({
200
+ keystrokeHandler: this.keystrokes,
201
+ focusTracker: this.focusTracker,
202
+ gridItems: this.tiles,
203
+ numberOfColumns: ()=>global.window.getComputedStyle(this.element.firstChild) // Responsive .ck-character-grid__tiles
204
+ .getPropertyValue('grid-template-columns').split(' ').length,
205
+ uiLanguageDirection: this.locale && this.locale.uiLanguageDirection
206
+ });
207
+ }
208
+ }
209
+
210
+ class CharacterInfoView extends View {
211
+ constructor(locale){
212
+ super(locale);
213
+ const bind = this.bindTemplate;
214
+ this.set('character', null);
215
+ this.set('name', null);
216
+ this.bind('code').to(this, 'character', characterToUnicodeString);
217
+ this.setTemplate({
218
+ tag: 'div',
219
+ children: [
220
+ {
221
+ tag: 'span',
222
+ attributes: {
223
+ class: [
224
+ 'ck-character-info__name'
225
+ ]
226
+ },
227
+ children: [
228
+ {
229
+ // Note: ZWSP to prevent vertical collapsing.
230
+ text: bind.to('name', (name)=>name ? name : '\u200B')
231
+ }
232
+ ]
233
+ },
234
+ {
235
+ tag: 'span',
236
+ attributes: {
237
+ class: [
238
+ 'ck-character-info__code'
239
+ ]
240
+ },
241
+ children: [
242
+ {
243
+ text: bind.to('code')
244
+ }
245
+ ]
246
+ }
247
+ ],
248
+ attributes: {
249
+ class: [
250
+ 'ck',
251
+ 'ck-character-info'
252
+ ]
253
+ }
254
+ });
255
+ }
256
+ }
257
+ /**
258
+ * Converts a character into a "Unicode string", for instance:
259
+ *
260
+ * "$" -> "U+0024"
261
+ *
262
+ * Returns an empty string when the character is `null`.
263
+ */ function characterToUnicodeString(character) {
264
+ if (character === null) {
265
+ return '';
266
+ }
267
+ const hexCode = character.codePointAt(0).toString(16);
268
+ return 'U+' + ('0000' + hexCode).slice(-4);
269
+ }
270
+
271
+ class SpecialCharactersView extends View {
272
+ /**
273
+ * @inheritDoc
274
+ */ render() {
275
+ super.render();
276
+ this.focusTracker.add(this.navigationView.groupDropdownView.buttonView.element);
277
+ this.focusTracker.add(this.gridView.element);
278
+ // Start listening for the keystrokes coming from #element.
279
+ this.keystrokes.listenTo(this.element);
280
+ }
281
+ /**
282
+ * @inheritDoc
283
+ */ destroy() {
284
+ super.destroy();
285
+ this.focusTracker.destroy();
286
+ this.keystrokes.destroy();
287
+ }
288
+ /**
289
+ * Focuses the first focusable in {@link #items}.
290
+ */ focus() {
291
+ this.navigationView.focus();
292
+ }
293
+ /**
294
+ * Creates an instance of the `SpecialCharactersView`.
295
+ */ constructor(locale, navigationView, gridView, infoView){
296
+ super(locale);
297
+ this.navigationView = navigationView;
298
+ this.gridView = gridView;
299
+ this.infoView = infoView;
300
+ this.items = this.createCollection();
301
+ this.focusTracker = new FocusTracker();
302
+ this.keystrokes = new KeystrokeHandler();
303
+ this._focusCycler = new FocusCycler({
304
+ focusables: this.items,
305
+ focusTracker: this.focusTracker,
306
+ keystrokeHandler: this.keystrokes,
307
+ actions: {
308
+ focusPrevious: 'shift + tab',
309
+ focusNext: 'tab'
310
+ }
311
+ });
312
+ this.setTemplate({
313
+ tag: 'div',
314
+ children: [
315
+ this.navigationView,
316
+ this.gridView,
317
+ this.infoView
318
+ ],
319
+ attributes: {
320
+ // Avoid focus loss when the user clicks the area of the grid that is not a button.
321
+ // https://github.com/ckeditor/ckeditor5/pull/12319#issuecomment-1231779819
322
+ tabindex: '-1'
323
+ }
324
+ });
325
+ this.items.add(this.navigationView.groupDropdownView.buttonView);
326
+ this.items.add(this.gridView);
327
+ }
328
+ }
329
+
330
+ 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>";
331
+
332
+ const ALL_SPECIAL_CHARACTERS_GROUP = 'All';
333
+ class SpecialCharacters extends Plugin {
334
+ /**
335
+ * @inheritDoc
336
+ */ static get requires() {
337
+ return [
338
+ Typing
339
+ ];
340
+ }
341
+ /**
342
+ * @inheritDoc
343
+ */ static get pluginName() {
344
+ return 'SpecialCharacters';
345
+ }
346
+ /**
347
+ * @inheritDoc
348
+ */ init() {
349
+ const editor = this.editor;
350
+ const t = editor.t;
351
+ const inputCommand = editor.commands.get('insertText');
352
+ // Add the `specialCharacters` dropdown button to feature components.
353
+ editor.ui.componentFactory.add('specialCharacters', (locale)=>{
354
+ const dropdownView = createDropdown(locale);
355
+ let dropdownPanelContent;
356
+ dropdownView.buttonView.set({
357
+ label: t('Special characters'),
358
+ icon: specialCharactersIcon,
359
+ tooltip: true
360
+ });
361
+ dropdownView.bind('isEnabled').to(inputCommand);
362
+ // Insert a special character when a tile was clicked.
363
+ dropdownView.on('execute', (evt, data)=>{
364
+ editor.execute('insertText', {
365
+ text: data.character
366
+ });
367
+ editor.editing.view.focus();
368
+ });
369
+ dropdownView.on('change:isOpen', ()=>{
370
+ if (!dropdownPanelContent) {
371
+ dropdownPanelContent = this._createDropdownPanelContent(locale, dropdownView);
372
+ const specialCharactersView = new SpecialCharactersView(locale, dropdownPanelContent.navigationView, dropdownPanelContent.gridView, dropdownPanelContent.infoView);
373
+ dropdownView.panelView.children.add(specialCharactersView);
374
+ }
375
+ dropdownPanelContent.infoView.set({
376
+ character: null,
377
+ name: null
378
+ });
379
+ });
380
+ return dropdownView;
381
+ });
382
+ }
383
+ /**
384
+ * Adds a collection of special characters to the specified group. The title of a special character must be unique.
385
+ *
386
+ * **Note:** The "All" category name is reserved by the plugin and cannot be used as a new name for a special
387
+ * characters category.
388
+ */ addItems(groupName, items, options = {
389
+ label: groupName
390
+ }) {
391
+ if (groupName === ALL_SPECIAL_CHARACTERS_GROUP) {
392
+ /**
393
+ * The name "All" for a special category group cannot be used because it is a special category that displays all
394
+ * available special characters.
395
+ *
396
+ * @error special-character-invalid-group-name
397
+ */ throw new CKEditorError('special-character-invalid-group-name', null);
398
+ }
399
+ const group = this._getGroup(groupName, options.label);
400
+ for (const item of items){
401
+ group.items.add(item.title);
402
+ this._characters.set(item.title, item.character);
403
+ }
404
+ }
405
+ /**
406
+ * Returns special character groups in an order determined based on configuration and registration sequence.
407
+ */ getGroups() {
408
+ const groups = Array.from(this._groups.keys());
409
+ const order = this.editor.config.get('specialCharacters.order') || [];
410
+ const invalidGroup = order.find((item)=>!groups.includes(item));
411
+ if (invalidGroup) {
412
+ /**
413
+ * One of the special character groups in the "specialCharacters.order" configuration doesn't exist.
414
+ *
415
+ * @error special-character-invalid-order-group-name
416
+ */ throw new CKEditorError('special-character-invalid-order-group-name', null, {
417
+ invalidGroup
418
+ });
419
+ }
420
+ return new Set([
421
+ ...order,
422
+ ...groups
423
+ ]);
424
+ }
425
+ /**
426
+ * Returns a collection of special characters symbol names (titles).
427
+ */ getCharactersForGroup(groupName) {
428
+ if (groupName === ALL_SPECIAL_CHARACTERS_GROUP) {
429
+ return new Set(this._characters.keys());
430
+ }
431
+ const group = this._groups.get(groupName);
432
+ if (group) {
433
+ return group.items;
434
+ }
435
+ }
436
+ /**
437
+ * Returns the symbol of a special character for the specified name. If the special character could not be found, `undefined`
438
+ * is returned.
439
+ *
440
+ * @param title The title of a special character.
441
+ */ getCharacter(title) {
442
+ return this._characters.get(title);
443
+ }
444
+ /**
445
+ * Returns a group of special characters. If the group with the specified name does not exist, it will be created.
446
+ *
447
+ * @param groupName The name of the group to create.
448
+ * @param label The label describing the new group.
449
+ */ _getGroup(groupName, label) {
450
+ if (!this._groups.has(groupName)) {
451
+ this._groups.set(groupName, {
452
+ items: new Set(),
453
+ label
454
+ });
455
+ }
456
+ return this._groups.get(groupName);
457
+ }
458
+ /**
459
+ * Updates the symbol grid depending on the currently selected character group.
460
+ */ _updateGrid(currentGroupName, gridView) {
461
+ // Updating the grid starts with removing all tiles belonging to the old group.
462
+ gridView.tiles.clear();
463
+ const characterTitles = this.getCharactersForGroup(currentGroupName);
464
+ for (const title of characterTitles){
465
+ const character = this.getCharacter(title);
466
+ gridView.tiles.add(gridView.createTile(character, title));
467
+ }
468
+ }
469
+ /**
470
+ * Initializes the dropdown, used for lazy loading.
471
+ *
472
+ * @returns An object with `navigationView`, `gridView` and `infoView` properties, containing UI parts.
473
+ */ _createDropdownPanelContent(locale, dropdownView) {
474
+ const groupEntries = Array.from(this.getGroups()).map((name)=>[
475
+ name,
476
+ this._groups.get(name).label
477
+ ]);
478
+ // The map contains a name of category (an identifier) and its label (a translational string).
479
+ const specialCharsGroups = new Map([
480
+ // Add a special group that shows all available special characters.
481
+ [
482
+ ALL_SPECIAL_CHARACTERS_GROUP,
483
+ this._allSpecialCharactersGroupLabel
484
+ ],
485
+ ...groupEntries
486
+ ]);
487
+ const navigationView = new SpecialCharactersNavigationView(locale, specialCharsGroups);
488
+ const gridView = new CharacterGridView(locale);
489
+ const infoView = new CharacterInfoView(locale);
490
+ gridView.delegate('execute').to(dropdownView);
491
+ gridView.on('tileHover', (evt, data)=>{
492
+ infoView.set(data);
493
+ });
494
+ gridView.on('tileFocus', (evt, data)=>{
495
+ infoView.set(data);
496
+ });
497
+ // Update the grid of special characters when a user changed the character group.
498
+ navigationView.on('execute', ()=>{
499
+ this._updateGrid(navigationView.currentGroupName, gridView);
500
+ });
501
+ // Set the initial content of the special characters grid.
502
+ this._updateGrid(navigationView.currentGroupName, gridView);
503
+ return {
504
+ navigationView,
505
+ gridView,
506
+ infoView
507
+ };
508
+ }
509
+ /**
510
+ * @inheritDoc
511
+ */ constructor(editor){
512
+ super(editor);
513
+ const t = editor.t;
514
+ this._characters = new Map();
515
+ this._groups = new Map();
516
+ this._allSpecialCharactersGroupLabel = t('All');
517
+ }
518
+ }
519
+
520
+ class SpecialCharactersArrows extends Plugin {
521
+ /**
522
+ * @inheritDoc
523
+ */ static get pluginName() {
524
+ return 'SpecialCharactersArrows';
525
+ }
526
+ /**
527
+ * @inheritDoc
528
+ */ init() {
529
+ const editor = this.editor;
530
+ const t = editor.t;
531
+ const plugin = editor.plugins.get('SpecialCharacters');
532
+ plugin.addItems('Arrows', [
533
+ {
534
+ title: t('leftwards simple arrow'),
535
+ character: '←'
536
+ },
537
+ {
538
+ title: t('rightwards simple arrow'),
539
+ character: '→'
540
+ },
541
+ {
542
+ title: t('upwards simple arrow'),
543
+ character: '↑'
544
+ },
545
+ {
546
+ title: t('downwards simple arrow'),
547
+ character: '↓'
548
+ },
549
+ {
550
+ title: t('leftwards double arrow'),
551
+ character: '⇐'
552
+ },
553
+ {
554
+ title: t('rightwards double arrow'),
555
+ character: '⇒'
556
+ },
557
+ {
558
+ title: t('upwards double arrow'),
559
+ character: '⇑'
560
+ },
561
+ {
562
+ title: t('downwards double arrow'),
563
+ character: '⇓'
564
+ },
565
+ {
566
+ title: t('leftwards dashed arrow'),
567
+ character: '⇠'
568
+ },
569
+ {
570
+ title: t('rightwards dashed arrow'),
571
+ character: '⇢'
572
+ },
573
+ {
574
+ title: t('upwards dashed arrow'),
575
+ character: '⇡'
576
+ },
577
+ {
578
+ title: t('downwards dashed arrow'),
579
+ character: '⇣'
580
+ },
581
+ {
582
+ title: t('leftwards arrow to bar'),
583
+ character: '⇤'
584
+ },
585
+ {
586
+ title: t('rightwards arrow to bar'),
587
+ character: '⇥'
588
+ },
589
+ {
590
+ title: t('upwards arrow to bar'),
591
+ character: '⤒'
592
+ },
593
+ {
594
+ title: t('downwards arrow to bar'),
595
+ character: '⤓'
596
+ },
597
+ {
598
+ title: t('up down arrow with base'),
599
+ character: '↨'
600
+ },
601
+ {
602
+ title: t('back with leftwards arrow above'),
603
+ character: '🔙'
604
+ },
605
+ {
606
+ title: t('end with leftwards arrow above'),
607
+ character: '🔚'
608
+ },
609
+ {
610
+ title: t('on with exclamation mark with left right arrow above'),
611
+ character: '🔛'
612
+ },
613
+ {
614
+ title: t('soon with rightwards arrow above'),
615
+ character: '🔜'
616
+ },
617
+ {
618
+ title: t('top with upwards arrow above'),
619
+ character: '🔝'
620
+ }
621
+ ], {
622
+ label: t('Arrows')
623
+ });
624
+ }
625
+ }
626
+
627
+ class SpecialCharactersText extends Plugin {
628
+ /**
629
+ * @inheritDoc
630
+ */ static get pluginName() {
631
+ return 'SpecialCharactersText';
632
+ }
633
+ /**
634
+ * @inheritDoc
635
+ */ init() {
636
+ const editor = this.editor;
637
+ const t = editor.t;
638
+ const plugin = editor.plugins.get('SpecialCharacters');
639
+ plugin.addItems('Text', [
640
+ {
641
+ character: '‹',
642
+ title: t('Single left-pointing angle quotation mark')
643
+ },
644
+ {
645
+ character: '›',
646
+ title: t('Single right-pointing angle quotation mark')
647
+ },
648
+ {
649
+ character: '«',
650
+ title: t('Left-pointing double angle quotation mark')
651
+ },
652
+ {
653
+ character: '»',
654
+ title: t('Right-pointing double angle quotation mark')
655
+ },
656
+ {
657
+ character: '‘',
658
+ title: t('Left single quotation mark')
659
+ },
660
+ {
661
+ character: '’',
662
+ title: t('Right single quotation mark')
663
+ },
664
+ {
665
+ character: '“',
666
+ title: t('Left double quotation mark')
667
+ },
668
+ {
669
+ character: '”',
670
+ title: t('Right double quotation mark')
671
+ },
672
+ {
673
+ character: '‚',
674
+ title: t('Single low-9 quotation mark')
675
+ },
676
+ {
677
+ character: '„',
678
+ title: t('Double low-9 quotation mark')
679
+ },
680
+ {
681
+ character: '¡',
682
+ title: t('Inverted exclamation mark')
683
+ },
684
+ {
685
+ character: '¿',
686
+ title: t('Inverted question mark')
687
+ },
688
+ {
689
+ character: '‥',
690
+ title: t('Two dot leader')
691
+ },
692
+ {
693
+ character: '…',
694
+ title: t('Horizontal ellipsis')
695
+ },
696
+ {
697
+ character: '‡',
698
+ title: t('Double dagger')
699
+ },
700
+ {
701
+ character: '‰',
702
+ title: t('Per mille sign')
703
+ },
704
+ {
705
+ character: '‱',
706
+ title: t('Per ten thousand sign')
707
+ },
708
+ {
709
+ character: '‼',
710
+ title: t('Double exclamation mark')
711
+ },
712
+ {
713
+ character: '⁈',
714
+ title: t('Question exclamation mark')
715
+ },
716
+ {
717
+ character: '⁉',
718
+ title: t('Exclamation question mark')
719
+ },
720
+ {
721
+ character: '⁇',
722
+ title: t('Double question mark')
723
+ },
724
+ {
725
+ character: '©',
726
+ title: t('Copyright sign')
727
+ },
728
+ {
729
+ character: '®',
730
+ title: t('Registered sign')
731
+ },
732
+ {
733
+ character: '™',
734
+ title: t('Trade mark sign')
735
+ },
736
+ {
737
+ character: '§',
738
+ title: t('Section sign')
739
+ },
740
+ {
741
+ character: '¶',
742
+ title: t('Paragraph sign')
743
+ },
744
+ {
745
+ character: '⁋',
746
+ title: t('Reversed paragraph sign')
747
+ }
748
+ ], {
749
+ label: t('Text')
750
+ });
751
+ }
752
+ }
753
+
754
+ class SpecialCharactersMathematical extends Plugin {
755
+ /**
756
+ * @inheritDoc
757
+ */ static get pluginName() {
758
+ return 'SpecialCharactersMathematical';
759
+ }
760
+ /**
761
+ * @inheritDoc
762
+ */ init() {
763
+ const editor = this.editor;
764
+ const t = editor.t;
765
+ const plugin = editor.plugins.get('SpecialCharacters');
766
+ plugin.addItems('Mathematical', [
767
+ {
768
+ character: '<',
769
+ title: t('Less-than sign')
770
+ },
771
+ {
772
+ character: '>',
773
+ title: t('Greater-than sign')
774
+ },
775
+ {
776
+ character: '≤',
777
+ title: t('Less-than or equal to')
778
+ },
779
+ {
780
+ character: '≥',
781
+ title: t('Greater-than or equal to')
782
+ },
783
+ {
784
+ character: '–',
785
+ title: t('En dash')
786
+ },
787
+ {
788
+ character: '—',
789
+ title: t('Em dash')
790
+ },
791
+ {
792
+ character: '¯',
793
+ title: t('Macron')
794
+ },
795
+ {
796
+ character: '‾',
797
+ title: t('Overline')
798
+ },
799
+ {
800
+ character: '°',
801
+ title: t('Degree sign')
802
+ },
803
+ {
804
+ character: '−',
805
+ title: t('Minus sign')
806
+ },
807
+ {
808
+ character: '±',
809
+ title: t('Plus-minus sign')
810
+ },
811
+ {
812
+ character: '÷',
813
+ title: t('Division sign')
814
+ },
815
+ {
816
+ character: '⁄',
817
+ title: t('Fraction slash')
818
+ },
819
+ {
820
+ character: '×',
821
+ title: t('Multiplication sign')
822
+ },
823
+ {
824
+ character: 'ƒ',
825
+ title: t('Latin small letter f with hook')
826
+ },
827
+ {
828
+ character: '∫',
829
+ title: t('Integral')
830
+ },
831
+ {
832
+ character: '∑',
833
+ title: t('N-ary summation')
834
+ },
835
+ {
836
+ character: '∞',
837
+ title: t('Infinity')
838
+ },
839
+ {
840
+ character: '√',
841
+ title: t('Square root')
842
+ },
843
+ {
844
+ character: '∼',
845
+ title: t('Tilde operator')
846
+ },
847
+ {
848
+ character: '≅',
849
+ title: t('Approximately equal to')
850
+ },
851
+ {
852
+ character: '≈',
853
+ title: t('Almost equal to')
854
+ },
855
+ {
856
+ character: '≠',
857
+ title: t('Not equal to')
858
+ },
859
+ {
860
+ character: '≡',
861
+ title: t('Identical to')
862
+ },
863
+ {
864
+ character: '∈',
865
+ title: t('Element of')
866
+ },
867
+ {
868
+ character: '∉',
869
+ title: t('Not an element of')
870
+ },
871
+ {
872
+ character: '∋',
873
+ title: t('Contains as member')
874
+ },
875
+ {
876
+ character: '∏',
877
+ title: t('N-ary product')
878
+ },
879
+ {
880
+ character: '∧',
881
+ title: t('Logical and')
882
+ },
883
+ {
884
+ character: '∨',
885
+ title: t('Logical or')
886
+ },
887
+ {
888
+ character: '¬',
889
+ title: t('Not sign')
890
+ },
891
+ {
892
+ character: '∩',
893
+ title: t('Intersection')
894
+ },
895
+ {
896
+ character: '∪',
897
+ title: t('Union')
898
+ },
899
+ {
900
+ character: '∂',
901
+ title: t('Partial differential')
902
+ },
903
+ {
904
+ character: '∀',
905
+ title: t('For all')
906
+ },
907
+ {
908
+ character: '∃',
909
+ title: t('There exists')
910
+ },
911
+ {
912
+ character: '∅',
913
+ title: t('Empty set')
914
+ },
915
+ {
916
+ character: '∇',
917
+ title: t('Nabla')
918
+ },
919
+ {
920
+ character: '∗',
921
+ title: t('Asterisk operator')
922
+ },
923
+ {
924
+ character: '∝',
925
+ title: t('Proportional to')
926
+ },
927
+ {
928
+ character: '∠',
929
+ title: t('Angle')
930
+ },
931
+ {
932
+ character: '¼',
933
+ title: t('Vulgar fraction one quarter')
934
+ },
935
+ {
936
+ character: '½',
937
+ title: t('Vulgar fraction one half')
938
+ },
939
+ {
940
+ character: '¾',
941
+ title: t('Vulgar fraction three quarters')
942
+ }
943
+ ], {
944
+ label: t('Mathematical')
945
+ });
946
+ }
947
+ }
948
+
949
+ class SpecialCharactersLatin extends Plugin {
950
+ /**
951
+ * @inheritDoc
952
+ */ static get pluginName() {
953
+ return 'SpecialCharactersLatin';
954
+ }
955
+ /**
956
+ * @inheritDoc
957
+ */ init() {
958
+ const editor = this.editor;
959
+ const t = editor.t;
960
+ const plugin = editor.plugins.get('SpecialCharacters');
961
+ plugin.addItems('Latin', [
962
+ {
963
+ character: 'Ā',
964
+ title: t('Latin capital letter a with macron')
965
+ },
966
+ {
967
+ character: 'ā',
968
+ title: t('Latin small letter a with macron')
969
+ },
970
+ {
971
+ character: 'Ă',
972
+ title: t('Latin capital letter a with breve')
973
+ },
974
+ {
975
+ character: 'ă',
976
+ title: t('Latin small letter a with breve')
977
+ },
978
+ {
979
+ character: 'Ą',
980
+ title: t('Latin capital letter a with ogonek')
981
+ },
982
+ {
983
+ character: 'ą',
984
+ title: t('Latin small letter a with ogonek')
985
+ },
986
+ {
987
+ character: 'Ć',
988
+ title: t('Latin capital letter c with acute')
989
+ },
990
+ {
991
+ character: 'ć',
992
+ title: t('Latin small letter c with acute')
993
+ },
994
+ {
995
+ character: 'Ĉ',
996
+ title: t('Latin capital letter c with circumflex')
997
+ },
998
+ {
999
+ character: 'ĉ',
1000
+ title: t('Latin small letter c with circumflex')
1001
+ },
1002
+ {
1003
+ character: 'Ċ',
1004
+ title: t('Latin capital letter c with dot above')
1005
+ },
1006
+ {
1007
+ character: 'ċ',
1008
+ title: t('Latin small letter c with dot above')
1009
+ },
1010
+ {
1011
+ character: 'Č',
1012
+ title: t('Latin capital letter c with caron')
1013
+ },
1014
+ {
1015
+ character: 'č',
1016
+ title: t('Latin small letter c with caron')
1017
+ },
1018
+ {
1019
+ character: 'Ď',
1020
+ title: t('Latin capital letter d with caron')
1021
+ },
1022
+ {
1023
+ character: 'ď',
1024
+ title: t('Latin small letter d with caron')
1025
+ },
1026
+ {
1027
+ character: 'Đ',
1028
+ title: t('Latin capital letter d with stroke')
1029
+ },
1030
+ {
1031
+ character: 'đ',
1032
+ title: t('Latin small letter d with stroke')
1033
+ },
1034
+ {
1035
+ character: 'Ē',
1036
+ title: t('Latin capital letter e with macron')
1037
+ },
1038
+ {
1039
+ character: 'ē',
1040
+ title: t('Latin small letter e with macron')
1041
+ },
1042
+ {
1043
+ character: 'Ĕ',
1044
+ title: t('Latin capital letter e with breve')
1045
+ },
1046
+ {
1047
+ character: 'ĕ',
1048
+ title: t('Latin small letter e with breve')
1049
+ },
1050
+ {
1051
+ character: 'Ė',
1052
+ title: t('Latin capital letter e with dot above')
1053
+ },
1054
+ {
1055
+ character: 'ė',
1056
+ title: t('Latin small letter e with dot above')
1057
+ },
1058
+ {
1059
+ character: 'Ę',
1060
+ title: t('Latin capital letter e with ogonek')
1061
+ },
1062
+ {
1063
+ character: 'ę',
1064
+ title: t('Latin small letter e with ogonek')
1065
+ },
1066
+ {
1067
+ character: 'Ě',
1068
+ title: t('Latin capital letter e with caron')
1069
+ },
1070
+ {
1071
+ character: 'ě',
1072
+ title: t('Latin small letter e with caron')
1073
+ },
1074
+ {
1075
+ character: 'Ĝ',
1076
+ title: t('Latin capital letter g with circumflex')
1077
+ },
1078
+ {
1079
+ character: 'ĝ',
1080
+ title: t('Latin small letter g with circumflex')
1081
+ },
1082
+ {
1083
+ character: 'Ğ',
1084
+ title: t('Latin capital letter g with breve')
1085
+ },
1086
+ {
1087
+ character: 'ğ',
1088
+ title: t('Latin small letter g with breve')
1089
+ },
1090
+ {
1091
+ character: 'Ġ',
1092
+ title: t('Latin capital letter g with dot above')
1093
+ },
1094
+ {
1095
+ character: 'ġ',
1096
+ title: t('Latin small letter g with dot above')
1097
+ },
1098
+ {
1099
+ character: 'Ģ',
1100
+ title: t('Latin capital letter g with cedilla')
1101
+ },
1102
+ {
1103
+ character: 'ģ',
1104
+ title: t('Latin small letter g with cedilla')
1105
+ },
1106
+ {
1107
+ character: 'Ĥ',
1108
+ title: t('Latin capital letter h with circumflex')
1109
+ },
1110
+ {
1111
+ character: 'ĥ',
1112
+ title: t('Latin small letter h with circumflex')
1113
+ },
1114
+ {
1115
+ character: 'Ħ',
1116
+ title: t('Latin capital letter h with stroke')
1117
+ },
1118
+ {
1119
+ character: 'ħ',
1120
+ title: t('Latin small letter h with stroke')
1121
+ },
1122
+ {
1123
+ character: 'Ĩ',
1124
+ title: t('Latin capital letter i with tilde')
1125
+ },
1126
+ {
1127
+ character: 'ĩ',
1128
+ title: t('Latin small letter i with tilde')
1129
+ },
1130
+ {
1131
+ character: 'Ī',
1132
+ title: t('Latin capital letter i with macron')
1133
+ },
1134
+ {
1135
+ character: 'ī',
1136
+ title: t('Latin small letter i with macron')
1137
+ },
1138
+ {
1139
+ character: 'Ĭ',
1140
+ title: t('Latin capital letter i with breve')
1141
+ },
1142
+ {
1143
+ character: 'ĭ',
1144
+ title: t('Latin small letter i with breve')
1145
+ },
1146
+ {
1147
+ character: 'Į',
1148
+ title: t('Latin capital letter i with ogonek')
1149
+ },
1150
+ {
1151
+ character: 'į',
1152
+ title: t('Latin small letter i with ogonek')
1153
+ },
1154
+ {
1155
+ character: 'İ',
1156
+ title: t('Latin capital letter i with dot above')
1157
+ },
1158
+ {
1159
+ character: 'ı',
1160
+ title: t('Latin small letter dotless i')
1161
+ },
1162
+ {
1163
+ character: 'IJ',
1164
+ title: t('Latin capital ligature ij')
1165
+ },
1166
+ {
1167
+ character: 'ij',
1168
+ title: t('Latin small ligature ij')
1169
+ },
1170
+ {
1171
+ character: 'Ĵ',
1172
+ title: t('Latin capital letter j with circumflex')
1173
+ },
1174
+ {
1175
+ character: 'ĵ',
1176
+ title: t('Latin small letter j with circumflex')
1177
+ },
1178
+ {
1179
+ character: 'Ķ',
1180
+ title: t('Latin capital letter k with cedilla')
1181
+ },
1182
+ {
1183
+ character: 'ķ',
1184
+ title: t('Latin small letter k with cedilla')
1185
+ },
1186
+ {
1187
+ character: 'ĸ',
1188
+ title: t('Latin small letter kra')
1189
+ },
1190
+ {
1191
+ character: 'Ĺ',
1192
+ title: t('Latin capital letter l with acute')
1193
+ },
1194
+ {
1195
+ character: 'ĺ',
1196
+ title: t('Latin small letter l with acute')
1197
+ },
1198
+ {
1199
+ character: 'Ļ',
1200
+ title: t('Latin capital letter l with cedilla')
1201
+ },
1202
+ {
1203
+ character: 'ļ',
1204
+ title: t('Latin small letter l with cedilla')
1205
+ },
1206
+ {
1207
+ character: 'Ľ',
1208
+ title: t('Latin capital letter l with caron')
1209
+ },
1210
+ {
1211
+ character: 'ľ',
1212
+ title: t('Latin small letter l with caron')
1213
+ },
1214
+ {
1215
+ character: 'Ŀ',
1216
+ title: t('Latin capital letter l with middle dot')
1217
+ },
1218
+ {
1219
+ character: 'ŀ',
1220
+ title: t('Latin small letter l with middle dot')
1221
+ },
1222
+ {
1223
+ character: 'Ł',
1224
+ title: t('Latin capital letter l with stroke')
1225
+ },
1226
+ {
1227
+ character: 'ł',
1228
+ title: t('Latin small letter l with stroke')
1229
+ },
1230
+ {
1231
+ character: 'Ń',
1232
+ title: t('Latin capital letter n with acute')
1233
+ },
1234
+ {
1235
+ character: 'ń',
1236
+ title: t('Latin small letter n with acute')
1237
+ },
1238
+ {
1239
+ character: 'Ņ',
1240
+ title: t('Latin capital letter n with cedilla')
1241
+ },
1242
+ {
1243
+ character: 'ņ',
1244
+ title: t('Latin small letter n with cedilla')
1245
+ },
1246
+ {
1247
+ character: 'Ň',
1248
+ title: t('Latin capital letter n with caron')
1249
+ },
1250
+ {
1251
+ character: 'ň',
1252
+ title: t('Latin small letter n with caron')
1253
+ },
1254
+ {
1255
+ character: 'ʼn',
1256
+ title: t('Latin small letter n preceded by apostrophe')
1257
+ },
1258
+ {
1259
+ character: 'Ŋ',
1260
+ title: t('Latin capital letter eng')
1261
+ },
1262
+ {
1263
+ character: 'ŋ',
1264
+ title: t('Latin small letter eng')
1265
+ },
1266
+ {
1267
+ character: 'Ō',
1268
+ title: t('Latin capital letter o with macron')
1269
+ },
1270
+ {
1271
+ character: 'ō',
1272
+ title: t('Latin small letter o with macron')
1273
+ },
1274
+ {
1275
+ character: 'Ŏ',
1276
+ title: t('Latin capital letter o with breve')
1277
+ },
1278
+ {
1279
+ character: 'ŏ',
1280
+ title: t('Latin small letter o with breve')
1281
+ },
1282
+ {
1283
+ character: 'Ő',
1284
+ title: t('Latin capital letter o with double acute')
1285
+ },
1286
+ {
1287
+ character: 'ő',
1288
+ title: t('Latin small letter o with double acute')
1289
+ },
1290
+ {
1291
+ character: 'Œ',
1292
+ title: t('Latin capital ligature oe')
1293
+ },
1294
+ {
1295
+ character: 'œ',
1296
+ title: t('Latin small ligature oe')
1297
+ },
1298
+ {
1299
+ character: 'Ŕ',
1300
+ title: t('Latin capital letter r with acute')
1301
+ },
1302
+ {
1303
+ character: 'ŕ',
1304
+ title: t('Latin small letter r with acute')
1305
+ },
1306
+ {
1307
+ character: 'Ŗ',
1308
+ title: t('Latin capital letter r with cedilla')
1309
+ },
1310
+ {
1311
+ character: 'ŗ',
1312
+ title: t('Latin small letter r with cedilla')
1313
+ },
1314
+ {
1315
+ character: 'Ř',
1316
+ title: t('Latin capital letter r with caron')
1317
+ },
1318
+ {
1319
+ character: 'ř',
1320
+ title: t('Latin small letter r with caron')
1321
+ },
1322
+ {
1323
+ character: 'Ś',
1324
+ title: t('Latin capital letter s with acute')
1325
+ },
1326
+ {
1327
+ character: 'ś',
1328
+ title: t('Latin small letter s with acute')
1329
+ },
1330
+ {
1331
+ character: 'Ŝ',
1332
+ title: t('Latin capital letter s with circumflex')
1333
+ },
1334
+ {
1335
+ character: 'ŝ',
1336
+ title: t('Latin small letter s with circumflex')
1337
+ },
1338
+ {
1339
+ character: 'Ş',
1340
+ title: t('Latin capital letter s with cedilla')
1341
+ },
1342
+ {
1343
+ character: 'ş',
1344
+ title: t('Latin small letter s with cedilla')
1345
+ },
1346
+ {
1347
+ character: 'Š',
1348
+ title: t('Latin capital letter s with caron')
1349
+ },
1350
+ {
1351
+ character: 'š',
1352
+ title: t('Latin small letter s with caron')
1353
+ },
1354
+ {
1355
+ character: 'Ţ',
1356
+ title: t('Latin capital letter t with cedilla')
1357
+ },
1358
+ {
1359
+ character: 'ţ',
1360
+ title: t('Latin small letter t with cedilla')
1361
+ },
1362
+ {
1363
+ character: 'Ť',
1364
+ title: t('Latin capital letter t with caron')
1365
+ },
1366
+ {
1367
+ character: 'ť',
1368
+ title: t('Latin small letter t with caron')
1369
+ },
1370
+ {
1371
+ character: 'Ŧ',
1372
+ title: t('Latin capital letter t with stroke')
1373
+ },
1374
+ {
1375
+ character: 'ŧ',
1376
+ title: t('Latin small letter t with stroke')
1377
+ },
1378
+ {
1379
+ character: 'Ũ',
1380
+ title: t('Latin capital letter u with tilde')
1381
+ },
1382
+ {
1383
+ character: 'ũ',
1384
+ title: t('Latin small letter u with tilde')
1385
+ },
1386
+ {
1387
+ character: 'Ū',
1388
+ title: t('Latin capital letter u with macron')
1389
+ },
1390
+ {
1391
+ character: 'ū',
1392
+ title: t('Latin small letter u with macron')
1393
+ },
1394
+ {
1395
+ character: 'Ŭ',
1396
+ title: t('Latin capital letter u with breve')
1397
+ },
1398
+ {
1399
+ character: 'ŭ',
1400
+ title: t('Latin small letter u with breve')
1401
+ },
1402
+ {
1403
+ character: 'Ů',
1404
+ title: t('Latin capital letter u with ring above')
1405
+ },
1406
+ {
1407
+ character: 'ů',
1408
+ title: t('Latin small letter u with ring above')
1409
+ },
1410
+ {
1411
+ character: 'Ű',
1412
+ title: t('Latin capital letter u with double acute')
1413
+ },
1414
+ {
1415
+ character: 'ű',
1416
+ title: t('Latin small letter u with double acute')
1417
+ },
1418
+ {
1419
+ character: 'Ų',
1420
+ title: t('Latin capital letter u with ogonek')
1421
+ },
1422
+ {
1423
+ character: 'ų',
1424
+ title: t('Latin small letter u with ogonek')
1425
+ },
1426
+ {
1427
+ character: 'Ŵ',
1428
+ title: t('Latin capital letter w with circumflex')
1429
+ },
1430
+ {
1431
+ character: 'ŵ',
1432
+ title: t('Latin small letter w with circumflex')
1433
+ },
1434
+ {
1435
+ character: 'Ŷ',
1436
+ title: t('Latin capital letter y with circumflex')
1437
+ },
1438
+ {
1439
+ character: 'ŷ',
1440
+ title: t('Latin small letter y with circumflex')
1441
+ },
1442
+ {
1443
+ character: 'Ÿ',
1444
+ title: t('Latin capital letter y with diaeresis')
1445
+ },
1446
+ {
1447
+ character: 'Ź',
1448
+ title: t('Latin capital letter z with acute')
1449
+ },
1450
+ {
1451
+ character: 'ź',
1452
+ title: t('Latin small letter z with acute')
1453
+ },
1454
+ {
1455
+ character: 'Ż',
1456
+ title: t('Latin capital letter z with dot above')
1457
+ },
1458
+ {
1459
+ character: 'ż',
1460
+ title: t('Latin small letter z with dot above')
1461
+ },
1462
+ {
1463
+ character: 'Ž',
1464
+ title: t('Latin capital letter z with caron')
1465
+ },
1466
+ {
1467
+ character: 'ž',
1468
+ title: t('Latin small letter z with caron')
1469
+ },
1470
+ {
1471
+ character: 'ſ',
1472
+ title: t('Latin small letter long s')
1473
+ }
1474
+ ], {
1475
+ label: t('Latin')
1476
+ });
1477
+ }
1478
+ }
1479
+
1480
+ class SpecialCharactersCurrency extends Plugin {
1481
+ /**
1482
+ * @inheritDoc
1483
+ */ static get pluginName() {
1484
+ return 'SpecialCharactersCurrency';
1485
+ }
1486
+ /**
1487
+ * @inheritDoc
1488
+ */ init() {
1489
+ const editor = this.editor;
1490
+ const t = editor.t;
1491
+ const plugin = editor.plugins.get('SpecialCharacters');
1492
+ plugin.addItems('Currency', [
1493
+ {
1494
+ character: '$',
1495
+ title: t('Dollar sign')
1496
+ },
1497
+ {
1498
+ character: '€',
1499
+ title: t('Euro sign')
1500
+ },
1501
+ {
1502
+ character: '¥',
1503
+ title: t('Yen sign')
1504
+ },
1505
+ {
1506
+ character: '£',
1507
+ title: t('Pound sign')
1508
+ },
1509
+ {
1510
+ character: '¢',
1511
+ title: t('Cent sign')
1512
+ },
1513
+ {
1514
+ character: '₠',
1515
+ title: t('Euro-currency sign')
1516
+ },
1517
+ {
1518
+ character: '₡',
1519
+ title: t('Colon sign')
1520
+ },
1521
+ {
1522
+ character: '₢',
1523
+ title: t('Cruzeiro sign')
1524
+ },
1525
+ {
1526
+ character: '₣',
1527
+ title: t('French franc sign')
1528
+ },
1529
+ {
1530
+ character: '₤',
1531
+ title: t('Lira sign')
1532
+ },
1533
+ {
1534
+ character: '¤',
1535
+ title: t('Currency sign')
1536
+ },
1537
+ {
1538
+ character: '₿',
1539
+ title: t('Bitcoin sign')
1540
+ },
1541
+ {
1542
+ character: '₥',
1543
+ title: t('Mill sign')
1544
+ },
1545
+ {
1546
+ character: '₦',
1547
+ title: t('Naira sign')
1548
+ },
1549
+ {
1550
+ character: '₧',
1551
+ title: t('Peseta sign')
1552
+ },
1553
+ {
1554
+ character: '₨',
1555
+ title: t('Rupee sign')
1556
+ },
1557
+ {
1558
+ character: '₩',
1559
+ title: t('Won sign')
1560
+ },
1561
+ {
1562
+ character: '₪',
1563
+ title: t('New sheqel sign')
1564
+ },
1565
+ {
1566
+ character: '₫',
1567
+ title: t('Dong sign')
1568
+ },
1569
+ {
1570
+ character: '₭',
1571
+ title: t('Kip sign')
1572
+ },
1573
+ {
1574
+ character: '₮',
1575
+ title: t('Tugrik sign')
1576
+ },
1577
+ {
1578
+ character: '₯',
1579
+ title: t('Drachma sign')
1580
+ },
1581
+ {
1582
+ character: '₰',
1583
+ title: t('German penny sign')
1584
+ },
1585
+ {
1586
+ character: '₱',
1587
+ title: t('Peso sign')
1588
+ },
1589
+ {
1590
+ character: '₲',
1591
+ title: t('Guarani sign')
1592
+ },
1593
+ {
1594
+ character: '₳',
1595
+ title: t('Austral sign')
1596
+ },
1597
+ {
1598
+ character: '₴',
1599
+ title: t('Hryvnia sign')
1600
+ },
1601
+ {
1602
+ character: '₵',
1603
+ title: t('Cedi sign')
1604
+ },
1605
+ {
1606
+ character: '₶',
1607
+ title: t('Livre tournois sign')
1608
+ },
1609
+ {
1610
+ character: '₷',
1611
+ title: t('Spesmilo sign')
1612
+ },
1613
+ {
1614
+ character: '₸',
1615
+ title: t('Tenge sign')
1616
+ },
1617
+ {
1618
+ character: '₹',
1619
+ title: t('Indian rupee sign')
1620
+ },
1621
+ {
1622
+ character: '₺',
1623
+ title: t('Turkish lira sign')
1624
+ },
1625
+ {
1626
+ character: '₻',
1627
+ title: t('Nordic mark sign')
1628
+ },
1629
+ {
1630
+ character: '₼',
1631
+ title: t('Manat sign')
1632
+ },
1633
+ {
1634
+ character: '₽',
1635
+ title: t('Ruble sign')
1636
+ }
1637
+ ], {
1638
+ label: t('Currency')
1639
+ });
1640
+ }
1641
+ }
1642
+
1643
+ class SpecialCharactersEssentials extends Plugin {
1644
+ /**
1645
+ * @inheritDoc
1646
+ */ static get pluginName() {
1647
+ return 'SpecialCharactersEssentials';
1648
+ }
1649
+ /**
1650
+ * @inheritDoc
1651
+ */ static get requires() {
1652
+ return [
1653
+ SpecialCharactersCurrency,
1654
+ SpecialCharactersText,
1655
+ SpecialCharactersMathematical,
1656
+ SpecialCharactersArrows,
1657
+ SpecialCharactersLatin
1658
+ ];
1659
+ }
1660
+ }
1661
+
1662
+ export { SpecialCharacters, SpecialCharactersArrows, SpecialCharactersCurrency, SpecialCharactersEssentials, SpecialCharactersLatin, SpecialCharactersMathematical, SpecialCharactersText };
1663
+ //# sourceMappingURL=index.js.map