@ckeditor/ckeditor5-special-characters 0.0.0-nightly-20260116.0 → 0.0.0-nightly-next-20260116.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/ckeditor5-metadata.json +7 -7
- package/dist/index.js.map +1 -1
- package/{src → dist}/specialcharacters.d.ts +3 -3
- package/{src → dist}/specialcharactersarrows.d.ts +1 -1
- package/{src → dist}/specialcharacterscurrency.d.ts +1 -1
- package/{src → dist}/specialcharactersessentials.d.ts +1 -1
- package/{src → dist}/specialcharacterslatin.d.ts +1 -1
- package/{src → dist}/specialcharactersmathematical.d.ts +1 -1
- package/{src → dist}/specialcharacterstext.d.ts +1 -1
- package/{src → dist}/ui/charactergridview.d.ts +2 -2
- package/{src → dist}/ui/characterinfoview.d.ts +2 -2
- package/{src → dist}/ui/specialcharacterscategoriesview.d.ts +2 -2
- package/{src → dist}/ui/specialcharactersview.d.ts +2 -2
- package/package.json +23 -47
- package/build/special-characters.js +0 -5
- package/build/translations/af.js +0 -1
- package/build/translations/ar.js +0 -1
- package/build/translations/ast.js +0 -1
- package/build/translations/az.js +0 -1
- package/build/translations/be.js +0 -1
- package/build/translations/bg.js +0 -1
- package/build/translations/bn.js +0 -1
- package/build/translations/bs.js +0 -1
- package/build/translations/ca.js +0 -1
- package/build/translations/cs.js +0 -1
- package/build/translations/da.js +0 -1
- package/build/translations/de-ch.js +0 -1
- package/build/translations/de.js +0 -1
- package/build/translations/el.js +0 -1
- package/build/translations/en-au.js +0 -1
- package/build/translations/en-gb.js +0 -1
- package/build/translations/eo.js +0 -1
- package/build/translations/es-co.js +0 -1
- package/build/translations/es.js +0 -1
- package/build/translations/et.js +0 -1
- package/build/translations/eu.js +0 -1
- package/build/translations/fa.js +0 -1
- package/build/translations/fi.js +0 -1
- package/build/translations/fr.js +0 -1
- package/build/translations/gl.js +0 -1
- package/build/translations/gu.js +0 -1
- package/build/translations/he.js +0 -1
- package/build/translations/hi.js +0 -1
- package/build/translations/hr.js +0 -1
- package/build/translations/hu.js +0 -1
- package/build/translations/hy.js +0 -1
- package/build/translations/id.js +0 -1
- package/build/translations/it.js +0 -1
- package/build/translations/ja.js +0 -1
- package/build/translations/jv.js +0 -1
- package/build/translations/kk.js +0 -1
- package/build/translations/km.js +0 -1
- package/build/translations/kn.js +0 -1
- package/build/translations/ko.js +0 -1
- package/build/translations/ku.js +0 -1
- package/build/translations/lt.js +0 -1
- package/build/translations/lv.js +0 -1
- package/build/translations/ms.js +0 -1
- package/build/translations/nb.js +0 -1
- package/build/translations/ne.js +0 -1
- package/build/translations/nl.js +0 -1
- package/build/translations/no.js +0 -1
- package/build/translations/oc.js +0 -1
- package/build/translations/pl.js +0 -1
- package/build/translations/pt-br.js +0 -1
- package/build/translations/pt.js +0 -1
- package/build/translations/ro.js +0 -1
- package/build/translations/ru.js +0 -1
- package/build/translations/si.js +0 -1
- package/build/translations/sk.js +0 -1
- package/build/translations/sl.js +0 -1
- package/build/translations/sq.js +0 -1
- package/build/translations/sr-latn.js +0 -1
- package/build/translations/sr.js +0 -1
- package/build/translations/sv.js +0 -1
- package/build/translations/th.js +0 -1
- package/build/translations/ti.js +0 -1
- package/build/translations/tk.js +0 -1
- package/build/translations/tr.js +0 -1
- package/build/translations/tt.js +0 -1
- package/build/translations/ug.js +0 -1
- package/build/translations/uk.js +0 -1
- package/build/translations/ur.js +0 -1
- package/build/translations/uz.js +0 -1
- package/build/translations/vi.js +0 -1
- package/build/translations/zh-cn.js +0 -1
- package/build/translations/zh.js +0 -1
- package/lang/contexts.json +0 -267
- package/lang/translations/af.po +0 -1072
- package/lang/translations/ar.po +0 -1074
- package/lang/translations/ast.po +0 -1072
- package/lang/translations/az.po +0 -1072
- package/lang/translations/be.po +0 -1072
- package/lang/translations/bg.po +0 -1076
- package/lang/translations/bn.po +0 -1072
- package/lang/translations/bs.po +0 -1072
- package/lang/translations/ca.po +0 -1072
- package/lang/translations/cs.po +0 -1072
- package/lang/translations/da.po +0 -1072
- package/lang/translations/de-ch.po +0 -1072
- package/lang/translations/de.po +0 -1072
- package/lang/translations/el.po +0 -1072
- package/lang/translations/en-au.po +0 -1072
- package/lang/translations/en-gb.po +0 -1072
- package/lang/translations/en.po +0 -1072
- package/lang/translations/eo.po +0 -1072
- package/lang/translations/es-co.po +0 -1072
- package/lang/translations/es.po +0 -1072
- package/lang/translations/et.po +0 -1072
- package/lang/translations/eu.po +0 -1072
- package/lang/translations/fa.po +0 -1072
- package/lang/translations/fi.po +0 -1072
- package/lang/translations/fr.po +0 -1072
- package/lang/translations/gl.po +0 -1072
- package/lang/translations/gu.po +0 -1072
- package/lang/translations/he.po +0 -1072
- package/lang/translations/hi.po +0 -1072
- package/lang/translations/hr.po +0 -1072
- package/lang/translations/hu.po +0 -1072
- package/lang/translations/hy.po +0 -1072
- package/lang/translations/id.po +0 -1072
- package/lang/translations/it.po +0 -1072
- package/lang/translations/ja.po +0 -1072
- package/lang/translations/jv.po +0 -1072
- package/lang/translations/kk.po +0 -1072
- package/lang/translations/km.po +0 -1072
- package/lang/translations/kn.po +0 -1072
- package/lang/translations/ko.po +0 -1072
- package/lang/translations/ku.po +0 -1072
- package/lang/translations/lt.po +0 -1072
- package/lang/translations/lv.po +0 -1072
- package/lang/translations/ms.po +0 -1072
- package/lang/translations/nb.po +0 -1072
- package/lang/translations/ne.po +0 -1072
- package/lang/translations/nl.po +0 -1074
- package/lang/translations/no.po +0 -1074
- package/lang/translations/oc.po +0 -1072
- package/lang/translations/pl.po +0 -1072
- package/lang/translations/pt-br.po +0 -1072
- package/lang/translations/pt.po +0 -1072
- package/lang/translations/ro.po +0 -1072
- package/lang/translations/ru.po +0 -1072
- package/lang/translations/si.po +0 -1072
- package/lang/translations/sk.po +0 -1072
- package/lang/translations/sl.po +0 -1072
- package/lang/translations/sq.po +0 -1072
- package/lang/translations/sr-latn.po +0 -1072
- package/lang/translations/sr.po +0 -1072
- package/lang/translations/sv.po +0 -1072
- package/lang/translations/th.po +0 -1072
- package/lang/translations/ti.po +0 -1072
- package/lang/translations/tk.po +0 -1072
- package/lang/translations/tr.po +0 -1072
- package/lang/translations/tt.po +0 -1072
- package/lang/translations/ug.po +0 -1072
- package/lang/translations/uk.po +0 -1072
- package/lang/translations/ur.po +0 -1072
- package/lang/translations/uz.po +0 -1072
- package/lang/translations/vi.po +0 -1072
- package/lang/translations/zh-cn.po +0 -1072
- package/lang/translations/zh.po +0 -1072
- package/src/augmentation.js +0 -5
- package/src/index.js +0 -19
- package/src/specialcharacters.js +0 -260
- package/src/specialcharactersarrows.js +0 -66
- package/src/specialcharactersconfig.js +0 -5
- package/src/specialcharacterscurrency.js +0 -80
- package/src/specialcharactersessentials.js +0 -51
- package/src/specialcharacterslatin.js +0 -172
- package/src/specialcharactersmathematical.js +0 -88
- package/src/specialcharacterstext.js +0 -71
- package/src/ui/charactergridview.js +0 -143
- package/src/ui/characterinfoview.js +0 -73
- package/src/ui/specialcharacterscategoriesview.js +0 -98
- package/src/ui/specialcharactersview.js +0 -108
- package/theme/charactergrid.css +0 -12
- package/theme/characterinfo.css +0 -9
- package/theme/specialcharacters.css +0 -89
- /package/{src → dist}/augmentation.d.ts +0 -0
- /package/{src → dist}/index.d.ts +0 -0
- /package/{src → dist}/specialcharactersconfig.d.ts +0 -0
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module special-characters/specialcharactersmathematical
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
/**
|
|
10
|
-
* A plugin that provides special characters for the "Mathematical" category.
|
|
11
|
-
*
|
|
12
|
-
* ```ts
|
|
13
|
-
* ClassicEditor
|
|
14
|
-
* .create( {
|
|
15
|
-
* plugins: [ ..., SpecialCharacters, SpecialCharactersMathematical ],
|
|
16
|
-
* } )
|
|
17
|
-
* .then( ... )
|
|
18
|
-
* .catch( ... );
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export class SpecialCharactersMathematical extends Plugin {
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
static get pluginName() {
|
|
26
|
-
return 'SpecialCharactersMathematical';
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* @inheritDoc
|
|
30
|
-
*/
|
|
31
|
-
static get isOfficialPlugin() {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @inheritDoc
|
|
36
|
-
*/
|
|
37
|
-
init() {
|
|
38
|
-
const editor = this.editor;
|
|
39
|
-
const t = editor.t;
|
|
40
|
-
const plugin = editor.plugins.get('SpecialCharacters');
|
|
41
|
-
plugin.addItems('Mathematical', [
|
|
42
|
-
{ character: '<', title: t('Less-than sign') },
|
|
43
|
-
{ character: '>', title: t('Greater-than sign') },
|
|
44
|
-
{ character: '≤', title: t('Less-than or equal to') },
|
|
45
|
-
{ character: '≥', title: t('Greater-than or equal to') },
|
|
46
|
-
{ character: '–', title: t('En dash') },
|
|
47
|
-
{ character: '—', title: t('Em dash') },
|
|
48
|
-
{ character: '¯', title: t('Macron') },
|
|
49
|
-
{ character: '‾', title: t('Overline') },
|
|
50
|
-
{ character: '°', title: t('Degree sign') },
|
|
51
|
-
{ character: '−', title: t('Minus sign') },
|
|
52
|
-
{ character: '±', title: t('Plus-minus sign') },
|
|
53
|
-
{ character: '÷', title: t('Division sign') },
|
|
54
|
-
{ character: '⁄', title: t('Fraction slash') },
|
|
55
|
-
{ character: '×', title: t('Multiplication sign') },
|
|
56
|
-
{ character: 'ƒ', title: t('Latin small letter f with hook') },
|
|
57
|
-
{ character: '∫', title: t('Integral') },
|
|
58
|
-
{ character: '∑', title: t('N-ary summation') },
|
|
59
|
-
{ character: '∞', title: t('Infinity') },
|
|
60
|
-
{ character: '√', title: t('Square root') },
|
|
61
|
-
{ character: '∼', title: t('Tilde operator') },
|
|
62
|
-
{ character: '≅', title: t('Approximately equal to') },
|
|
63
|
-
{ character: '≈', title: t('Almost equal to') },
|
|
64
|
-
{ character: '≠', title: t('Not equal to') },
|
|
65
|
-
{ character: '≡', title: t('Identical to') },
|
|
66
|
-
{ character: '∈', title: t('Element of') },
|
|
67
|
-
{ character: '∉', title: t('Not an element of') },
|
|
68
|
-
{ character: '∋', title: t('Contains as member') },
|
|
69
|
-
{ character: '∏', title: t('N-ary product') },
|
|
70
|
-
{ character: '∧', title: t('Logical and') },
|
|
71
|
-
{ character: '∨', title: t('Logical or') },
|
|
72
|
-
{ character: '¬', title: t('Not sign') },
|
|
73
|
-
{ character: '∩', title: t('Intersection') },
|
|
74
|
-
{ character: '∪', title: t('Union') },
|
|
75
|
-
{ character: '∂', title: t('Partial differential') },
|
|
76
|
-
{ character: '∀', title: t('For all') },
|
|
77
|
-
{ character: '∃', title: t('There exists') },
|
|
78
|
-
{ character: '∅', title: t('Empty set') },
|
|
79
|
-
{ character: '∇', title: t('Nabla') },
|
|
80
|
-
{ character: '∗', title: t('Asterisk operator') },
|
|
81
|
-
{ character: '∝', title: t('Proportional to') },
|
|
82
|
-
{ character: '∠', title: t('Angle') },
|
|
83
|
-
{ character: '¼', title: t('Vulgar fraction one quarter') },
|
|
84
|
-
{ character: '½', title: t('Vulgar fraction one half') },
|
|
85
|
-
{ character: '¾', title: t('Vulgar fraction three quarters') }
|
|
86
|
-
], { label: t('Mathematical') });
|
|
87
|
-
}
|
|
88
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module special-characters/specialcharacterstext
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
/**
|
|
10
|
-
* A plugin that provides special characters for the "Text" category.
|
|
11
|
-
*
|
|
12
|
-
* ```ts
|
|
13
|
-
* ClassicEditor
|
|
14
|
-
* .create( {
|
|
15
|
-
* plugins: [ ..., SpecialCharacters, SpecialCharactersText ],
|
|
16
|
-
* } )
|
|
17
|
-
* .then( ... )
|
|
18
|
-
* .catch( ... );
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
export class SpecialCharactersText extends Plugin {
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
static get pluginName() {
|
|
26
|
-
return 'SpecialCharactersText';
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* @inheritDoc
|
|
30
|
-
*/
|
|
31
|
-
static get isOfficialPlugin() {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @inheritDoc
|
|
36
|
-
*/
|
|
37
|
-
init() {
|
|
38
|
-
const editor = this.editor;
|
|
39
|
-
const t = editor.t;
|
|
40
|
-
const plugin = editor.plugins.get('SpecialCharacters');
|
|
41
|
-
plugin.addItems('Text', [
|
|
42
|
-
{ character: '‹', title: t('Single left-pointing angle quotation mark') },
|
|
43
|
-
{ character: '›', title: t('Single right-pointing angle quotation mark') },
|
|
44
|
-
{ character: '«', title: t('Left-pointing double angle quotation mark') },
|
|
45
|
-
{ character: '»', title: t('Right-pointing double angle quotation mark') },
|
|
46
|
-
{ character: '‘', title: t('Left single quotation mark') },
|
|
47
|
-
{ character: '’', title: t('Right single quotation mark') },
|
|
48
|
-
{ character: '“', title: t('Left double quotation mark') },
|
|
49
|
-
{ character: '”', title: t('Right double quotation mark') },
|
|
50
|
-
{ character: '‚', title: t('Single low-9 quotation mark') },
|
|
51
|
-
{ character: '„', title: t('Double low-9 quotation mark') },
|
|
52
|
-
{ character: '¡', title: t('Inverted exclamation mark') },
|
|
53
|
-
{ character: '¿', title: t('Inverted question mark') },
|
|
54
|
-
{ character: '‥', title: t('Two dot leader') },
|
|
55
|
-
{ character: '…', title: t('Horizontal ellipsis') },
|
|
56
|
-
{ character: '‡', title: t('Double dagger') },
|
|
57
|
-
{ character: '‰', title: t('Per mille sign') },
|
|
58
|
-
{ character: '‱', title: t('Per ten thousand sign') },
|
|
59
|
-
{ character: '‼', title: t('Double exclamation mark') },
|
|
60
|
-
{ character: '⁈', title: t('Question exclamation mark') },
|
|
61
|
-
{ character: '⁉', title: t('Exclamation question mark') },
|
|
62
|
-
{ character: '⁇', title: t('Double question mark') },
|
|
63
|
-
{ character: '©', title: t('Copyright sign') },
|
|
64
|
-
{ character: '®', title: t('Registered sign') },
|
|
65
|
-
{ character: '™', title: t('Trade mark sign') },
|
|
66
|
-
{ character: '§', title: t('Section sign') },
|
|
67
|
-
{ character: '¶', title: t('Paragraph sign') },
|
|
68
|
-
{ character: '⁋', title: t('Reversed paragraph sign') }
|
|
69
|
-
], { label: t('Text') });
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module special-characters/ui/charactergridview
|
|
7
|
-
*/
|
|
8
|
-
import { View, ButtonView, addKeyboardHandlingForGrid } from 'ckeditor5/src/ui.js';
|
|
9
|
-
import { KeystrokeHandler, FocusTracker, global } from 'ckeditor5/src/utils.js';
|
|
10
|
-
import '../../theme/charactergrid.css';
|
|
11
|
-
/**
|
|
12
|
-
* A grid of character tiles. It allows browsing special characters and selecting the character to
|
|
13
|
-
* be inserted into the content.
|
|
14
|
-
*
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
export class CharacterGridView extends View {
|
|
18
|
-
/**
|
|
19
|
-
* A collection of the child tile views. Each tile represents a particular character.
|
|
20
|
-
*/
|
|
21
|
-
tiles;
|
|
22
|
-
/**
|
|
23
|
-
* Tracks information about the DOM focus in the grid.
|
|
24
|
-
*/
|
|
25
|
-
focusTracker;
|
|
26
|
-
/**
|
|
27
|
-
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
28
|
-
*/
|
|
29
|
-
keystrokes;
|
|
30
|
-
/**
|
|
31
|
-
* Creates an instance of a character grid containing tiles representing special characters.
|
|
32
|
-
*
|
|
33
|
-
* @param locale The localization services instance.
|
|
34
|
-
*/
|
|
35
|
-
constructor(locale) {
|
|
36
|
-
super(locale);
|
|
37
|
-
this.tiles = this.createCollection();
|
|
38
|
-
this.setTemplate({
|
|
39
|
-
tag: 'div',
|
|
40
|
-
children: [
|
|
41
|
-
{
|
|
42
|
-
tag: 'div',
|
|
43
|
-
attributes: {
|
|
44
|
-
class: [
|
|
45
|
-
'ck',
|
|
46
|
-
'ck-character-grid__tiles'
|
|
47
|
-
]
|
|
48
|
-
},
|
|
49
|
-
children: this.tiles
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
attributes: {
|
|
53
|
-
class: [
|
|
54
|
-
'ck',
|
|
55
|
-
'ck-character-grid'
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
this.focusTracker = new FocusTracker();
|
|
60
|
-
this.keystrokes = new KeystrokeHandler();
|
|
61
|
-
addKeyboardHandlingForGrid({
|
|
62
|
-
keystrokeHandler: this.keystrokes,
|
|
63
|
-
focusTracker: this.focusTracker,
|
|
64
|
-
gridItems: this.tiles,
|
|
65
|
-
numberOfColumns: () => global.window
|
|
66
|
-
.getComputedStyle(this.element.firstChild) // Responsive .ck-character-grid__tiles
|
|
67
|
-
.getPropertyValue('grid-template-columns')
|
|
68
|
-
.split(' ')
|
|
69
|
-
.length,
|
|
70
|
-
uiLanguageDirection: this.locale && this.locale.uiLanguageDirection
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Creates a new tile for the grid.
|
|
75
|
-
*
|
|
76
|
-
* @param character A human-readable character displayed as the label (e.g. "ε").
|
|
77
|
-
* @param name The name of the character (e.g. "greek small letter epsilon").
|
|
78
|
-
*/
|
|
79
|
-
createTile(character, name) {
|
|
80
|
-
const tile = new ButtonView(this.locale);
|
|
81
|
-
tile.set({
|
|
82
|
-
label: character,
|
|
83
|
-
withText: true,
|
|
84
|
-
class: 'ck-character-grid__tile'
|
|
85
|
-
});
|
|
86
|
-
// Labels are vital for the users to understand what character they're looking at.
|
|
87
|
-
// For now we're using native title attribute for that, see #5817.
|
|
88
|
-
tile.extendTemplate({
|
|
89
|
-
attributes: {
|
|
90
|
-
title: name
|
|
91
|
-
},
|
|
92
|
-
on: {
|
|
93
|
-
mouseover: tile.bindTemplate.to('mouseover'),
|
|
94
|
-
focus: tile.bindTemplate.to('focus')
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
tile.on('mouseover', () => {
|
|
98
|
-
this.fire('tileHover', { name, character });
|
|
99
|
-
});
|
|
100
|
-
tile.on('focus', () => {
|
|
101
|
-
this.fire('tileFocus', { name, character });
|
|
102
|
-
});
|
|
103
|
-
tile.on('execute', () => {
|
|
104
|
-
this.fire('execute', { name, character });
|
|
105
|
-
});
|
|
106
|
-
return tile;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* @inheritDoc
|
|
110
|
-
*/
|
|
111
|
-
render() {
|
|
112
|
-
super.render();
|
|
113
|
-
for (const item of this.tiles) {
|
|
114
|
-
this.focusTracker.add(item.element);
|
|
115
|
-
}
|
|
116
|
-
this.tiles.on('change', (eventInfo, { added, removed }) => {
|
|
117
|
-
if (added.length > 0) {
|
|
118
|
-
for (const item of added) {
|
|
119
|
-
this.focusTracker.add(item.element);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (removed.length > 0) {
|
|
123
|
-
for (const item of removed) {
|
|
124
|
-
this.focusTracker.remove(item.element);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
this.keystrokes.listenTo(this.element);
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* @inheritDoc
|
|
132
|
-
*/
|
|
133
|
-
destroy() {
|
|
134
|
-
super.destroy();
|
|
135
|
-
this.keystrokes.destroy();
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Focuses the first focusable in {@link ~CharacterGridView#tiles}.
|
|
139
|
-
*/
|
|
140
|
-
focus() {
|
|
141
|
-
this.tiles.first.focus();
|
|
142
|
-
}
|
|
143
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
import { View } from 'ckeditor5/src/ui.js';
|
|
6
|
-
import '../../theme/characterinfo.css';
|
|
7
|
-
/**
|
|
8
|
-
* The view displaying detailed information about a special character glyph, e.g. upon
|
|
9
|
-
* hovering it with a mouse.
|
|
10
|
-
*
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export class CharacterInfoView extends View {
|
|
14
|
-
constructor(locale) {
|
|
15
|
-
super(locale);
|
|
16
|
-
const bind = this.bindTemplate;
|
|
17
|
-
this.set('character', null);
|
|
18
|
-
this.set('name', null);
|
|
19
|
-
this.bind('code').to(this, 'character', characterToUnicodeString);
|
|
20
|
-
this.setTemplate({
|
|
21
|
-
tag: 'div',
|
|
22
|
-
children: [
|
|
23
|
-
{
|
|
24
|
-
tag: 'span',
|
|
25
|
-
attributes: {
|
|
26
|
-
class: [
|
|
27
|
-
'ck-character-info__name'
|
|
28
|
-
]
|
|
29
|
-
},
|
|
30
|
-
children: [
|
|
31
|
-
{
|
|
32
|
-
// Note: ZWSP to prevent vertical collapsing.
|
|
33
|
-
text: bind.to('name', name => name ? name : '\u200B')
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
tag: 'span',
|
|
39
|
-
attributes: {
|
|
40
|
-
class: [
|
|
41
|
-
'ck-character-info__code'
|
|
42
|
-
]
|
|
43
|
-
},
|
|
44
|
-
children: [
|
|
45
|
-
{
|
|
46
|
-
text: bind.to('code')
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
],
|
|
51
|
-
attributes: {
|
|
52
|
-
class: [
|
|
53
|
-
'ck',
|
|
54
|
-
'ck-character-info'
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Converts a character into a "Unicode string", for instance:
|
|
62
|
-
*
|
|
63
|
-
* "$" -> "U+0024"
|
|
64
|
-
*
|
|
65
|
-
* Returns an empty string when the character is `null`.
|
|
66
|
-
*/
|
|
67
|
-
function characterToUnicodeString(character) {
|
|
68
|
-
if (character === null) {
|
|
69
|
-
return '';
|
|
70
|
-
}
|
|
71
|
-
const hexCode = character.codePointAt(0).toString(16);
|
|
72
|
-
return 'U+' + ('0000' + hexCode).slice(-4);
|
|
73
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module special-characters/ui/specialcharacterscategoriesview
|
|
7
|
-
*/
|
|
8
|
-
import { Collection } from 'ckeditor5/src/utils.js';
|
|
9
|
-
import { addListToDropdown, createLabeledDropdown, LabeledFieldView, View, UIModel } from 'ckeditor5/src/ui.js';
|
|
10
|
-
/**
|
|
11
|
-
* A class representing the navigation part of the special characters UI. It is responsible
|
|
12
|
-
* for describing the feature and allowing the user to select a particular character group.
|
|
13
|
-
*
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
export class SpecialCharactersCategoriesView extends View {
|
|
17
|
-
_groupNames;
|
|
18
|
-
_dropdownView;
|
|
19
|
-
/**
|
|
20
|
-
* Creates an instance of the {@link module:special-characters/ui/specialcharacterscategoriesview~SpecialCharactersCategoriesView}
|
|
21
|
-
* class.
|
|
22
|
-
*
|
|
23
|
-
* @param locale The localization services instance.
|
|
24
|
-
* @param groupNames The names of the character groups.
|
|
25
|
-
*/
|
|
26
|
-
constructor(locale, groupNames) {
|
|
27
|
-
super(locale);
|
|
28
|
-
this.set('currentGroupName', Array.from(groupNames.entries())[0][0]);
|
|
29
|
-
this._groupNames = groupNames;
|
|
30
|
-
this._dropdownView = new LabeledFieldView(locale, createLabeledDropdown);
|
|
31
|
-
this.setTemplate({
|
|
32
|
-
tag: 'div',
|
|
33
|
-
attributes: {
|
|
34
|
-
class: ['ck', 'ck-character-categories']
|
|
35
|
-
},
|
|
36
|
-
children: [
|
|
37
|
-
this._dropdownView
|
|
38
|
-
]
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* @inheritDoc
|
|
43
|
-
*/
|
|
44
|
-
render() {
|
|
45
|
-
super.render();
|
|
46
|
-
this._setupDropdown();
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @inheritDoc
|
|
50
|
-
*/
|
|
51
|
-
focus() {
|
|
52
|
-
this._dropdownView.focus();
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Creates dropdown item list, sets up bindings and fills properties.
|
|
56
|
-
*/
|
|
57
|
-
_setupDropdown() {
|
|
58
|
-
const items = new Collection();
|
|
59
|
-
for (const [name, label] of this._groupNames) {
|
|
60
|
-
const item = {
|
|
61
|
-
type: 'button',
|
|
62
|
-
model: new UIModel({
|
|
63
|
-
name,
|
|
64
|
-
label,
|
|
65
|
-
role: 'menuitemradio',
|
|
66
|
-
withText: true
|
|
67
|
-
})
|
|
68
|
-
};
|
|
69
|
-
item.model.bind('isOn').to(this, 'currentGroupName', value => {
|
|
70
|
-
return value === name;
|
|
71
|
-
});
|
|
72
|
-
items.add(item);
|
|
73
|
-
}
|
|
74
|
-
const t = this.locale.t;
|
|
75
|
-
const accessibleLabel = t('Category');
|
|
76
|
-
this._dropdownView.set({
|
|
77
|
-
label: accessibleLabel,
|
|
78
|
-
isEmpty: false
|
|
79
|
-
});
|
|
80
|
-
this._dropdownView.fieldView.panelPosition = this.locale.uiLanguageDirection === 'rtl' ? 'se' : 'sw';
|
|
81
|
-
this._dropdownView.fieldView.buttonView.set({
|
|
82
|
-
withText: true,
|
|
83
|
-
tooltip: accessibleLabel,
|
|
84
|
-
ariaLabel: accessibleLabel,
|
|
85
|
-
ariaLabelledBy: undefined,
|
|
86
|
-
isOn: false
|
|
87
|
-
});
|
|
88
|
-
this._dropdownView.fieldView.buttonView.bind('label')
|
|
89
|
-
.to(this, 'currentGroupName', value => this._groupNames.get(value));
|
|
90
|
-
this._dropdownView.fieldView.on('execute', ({ source }) => {
|
|
91
|
-
this.currentGroupName = source.name;
|
|
92
|
-
});
|
|
93
|
-
addListToDropdown(this._dropdownView.fieldView, items, {
|
|
94
|
-
ariaLabel: accessibleLabel,
|
|
95
|
-
role: 'menu'
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module special-characters/ui/specialcharactersview
|
|
7
|
-
*/
|
|
8
|
-
import { View, FocusCycler } from 'ckeditor5/src/ui.js';
|
|
9
|
-
import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';
|
|
10
|
-
/**
|
|
11
|
-
* A view that glues pieces of the special characters dropdown panel together:
|
|
12
|
-
*
|
|
13
|
-
* * the navigation view (allows selecting the category),
|
|
14
|
-
* * the grid view (displays characters as a grid),
|
|
15
|
-
* * and the info view (displays detailed info about a specific character).
|
|
16
|
-
*
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
export class SpecialCharactersView extends View {
|
|
20
|
-
/**
|
|
21
|
-
* A collection of the focusable children of the view.
|
|
22
|
-
*/
|
|
23
|
-
items;
|
|
24
|
-
/**
|
|
25
|
-
* Tracks information about the DOM focus in the view.
|
|
26
|
-
*/
|
|
27
|
-
focusTracker;
|
|
28
|
-
/**
|
|
29
|
-
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
30
|
-
*/
|
|
31
|
-
keystrokes;
|
|
32
|
-
/**
|
|
33
|
-
* Helps cycling over focusable {@link #items} in the view.
|
|
34
|
-
*/
|
|
35
|
-
_focusCycler;
|
|
36
|
-
/**
|
|
37
|
-
* An instance of the `SpecialCharactersCategoriesView`.
|
|
38
|
-
*/
|
|
39
|
-
categoriesView;
|
|
40
|
-
/**
|
|
41
|
-
* An instance of the `CharacterGridView`.
|
|
42
|
-
*/
|
|
43
|
-
gridView;
|
|
44
|
-
/**
|
|
45
|
-
* An instance of the `CharacterInfoView`.
|
|
46
|
-
*/
|
|
47
|
-
infoView;
|
|
48
|
-
/**
|
|
49
|
-
* Creates an instance of the `SpecialCharactersView`.
|
|
50
|
-
*/
|
|
51
|
-
constructor(locale, categoriesView, gridView, infoView) {
|
|
52
|
-
super(locale);
|
|
53
|
-
this.categoriesView = categoriesView;
|
|
54
|
-
this.gridView = gridView;
|
|
55
|
-
this.infoView = infoView;
|
|
56
|
-
this.items = this.createCollection();
|
|
57
|
-
this.focusTracker = new FocusTracker();
|
|
58
|
-
this.keystrokes = new KeystrokeHandler();
|
|
59
|
-
this._focusCycler = new FocusCycler({
|
|
60
|
-
focusables: this.items,
|
|
61
|
-
focusTracker: this.focusTracker,
|
|
62
|
-
keystrokeHandler: this.keystrokes,
|
|
63
|
-
actions: {
|
|
64
|
-
focusPrevious: 'shift + tab',
|
|
65
|
-
focusNext: 'tab'
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
this.setTemplate({
|
|
69
|
-
tag: 'div',
|
|
70
|
-
children: [
|
|
71
|
-
this.categoriesView,
|
|
72
|
-
this.gridView,
|
|
73
|
-
this.infoView
|
|
74
|
-
],
|
|
75
|
-
attributes: {
|
|
76
|
-
// Avoid focus loss when the user clicks the area of the grid that is not a button.
|
|
77
|
-
// https://github.com/ckeditor/ckeditor5/pull/12319#issuecomment-1231779819
|
|
78
|
-
tabindex: '-1'
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
this.items.add(this.categoriesView);
|
|
82
|
-
this.items.add(this.gridView);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* @inheritDoc
|
|
86
|
-
*/
|
|
87
|
-
render() {
|
|
88
|
-
super.render();
|
|
89
|
-
this.focusTracker.add(this.categoriesView.element);
|
|
90
|
-
this.focusTracker.add(this.gridView.element);
|
|
91
|
-
// Start listening for the keystrokes coming from #element.
|
|
92
|
-
this.keystrokes.listenTo(this.element);
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* @inheritDoc
|
|
96
|
-
*/
|
|
97
|
-
destroy() {
|
|
98
|
-
super.destroy();
|
|
99
|
-
this.focusTracker.destroy();
|
|
100
|
-
this.keystrokes.destroy();
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Focuses the first focusable in {@link #items}.
|
|
104
|
-
*/
|
|
105
|
-
focus() {
|
|
106
|
-
this._focusCycler.focusFirst();
|
|
107
|
-
}
|
|
108
|
-
}
|
package/theme/charactergrid.css
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
.ck.ck-character-grid {
|
|
7
|
-
max-width: 100%;
|
|
8
|
-
|
|
9
|
-
& .ck-character-grid__tiles {
|
|
10
|
-
display: grid;
|
|
11
|
-
}
|
|
12
|
-
}
|
package/theme/characterinfo.css
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* Note: This file should contain the wireframe styles only. But since there are no such styles,
|
|
8
|
-
* it acts as a message to the builder telling that it should look for the corresponding styles
|
|
9
|
-
* **in the theme** when compiling the editor.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
.ck.ck-special-characters {
|
|
13
|
-
& > .ck-dialog__content > div {
|
|
14
|
-
width: 350px;
|
|
15
|
-
max-width: 100%;
|
|
16
|
-
height: 100%;
|
|
17
|
-
|
|
18
|
-
display: grid;
|
|
19
|
-
grid-column-gap: 0px;
|
|
20
|
-
grid-row-gap: 0px;
|
|
21
|
-
grid-template-columns: 1fr;
|
|
22
|
-
grid-template-rows: auto 1fr auto;
|
|
23
|
-
|
|
24
|
-
& > .ck-character-categories {
|
|
25
|
-
grid-area: 1 / 1 / 2 / 2;
|
|
26
|
-
padding: var(--ck-spacing-medium) var(--ck-spacing-large);
|
|
27
|
-
|
|
28
|
-
& > .ck-labeled-field-view {
|
|
29
|
-
padding-top: var(--ck-spacing-standard);
|
|
30
|
-
width: 100%;
|
|
31
|
-
|
|
32
|
-
& .ck.ck-labeled-field-view__status {
|
|
33
|
-
background: var(--ck-color-base-error);
|
|
34
|
-
color: var(--ck-color-base-background);
|
|
35
|
-
padding: var(--ck-spacing-small) var(--ck-spacing-medium);
|
|
36
|
-
min-width: var(--ck-table-properties-min-error-width);
|
|
37
|
-
text-align: center;
|
|
38
|
-
|
|
39
|
-
/* The arrow pointing towards the field. */
|
|
40
|
-
&::after {
|
|
41
|
-
border-color: transparent transparent var(--ck-color-base-error) transparent;
|
|
42
|
-
border-width: 0 var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size) var(--ck-table-properties-error-arrow-size);
|
|
43
|
-
border-style: solid;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
animation: ck-table-form-labeled-view-status-appear .15s ease both;
|
|
47
|
-
|
|
48
|
-
@media (prefers-reduced-motion: reduce) {
|
|
49
|
-
animation: none;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* Hide the error balloon when the field is blurred. Makes the experience much more clear. */
|
|
54
|
-
& .ck-input.ck-error:not(:focus) + .ck.ck-labeled-field-view__status {
|
|
55
|
-
display: none;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
& > .ck-label {
|
|
59
|
-
font-size: var(--ck-font-size-tiny);
|
|
60
|
-
text-align: center;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.ck-dropdown {
|
|
65
|
-
display: block;
|
|
66
|
-
width: 100%;
|
|
67
|
-
|
|
68
|
-
& > button {
|
|
69
|
-
&:not(:focus) {
|
|
70
|
-
border: 1px solid var(--ck-color-base-border);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
& > span {
|
|
74
|
-
width: 100%;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
& > .ck-character-grid {
|
|
81
|
-
grid-area: 2 / 1 / 3 / 2;
|
|
82
|
-
max-height: 200px;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
& > .ck-character-info {
|
|
86
|
-
grid-area: 3 / 1 / 4 / 2;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|