/
specialcharactersarrows.ts
66 lines (61 loc) · 2.41 KB
/
specialcharactersarrows.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
/**
* @module special-characters/specialcharactersarrows
*/
import { Plugin } from 'ckeditor5/src/core.js';
import type SpecialCharacters from './specialcharacters.js';
/**
* A plugin that provides special characters for the "Arrows" category.
*
* ```ts
* ClassicEditor
* .create( {
* plugins: [ ..., SpecialCharacters, SpecialCharactersArrows ],
* } )
* .then( ... )
* .catch( ... );
* ```
*/
export default class SpecialCharactersArrows extends Plugin {
/**
* @inheritDoc
*/
public static get pluginName() {
return 'SpecialCharactersArrows' as const;
}
/**
* @inheritDoc
*/
public init(): void {
const editor = this.editor;
const t = editor.t;
const plugin: SpecialCharacters = editor.plugins.get( 'SpecialCharacters' );
plugin.addItems( 'Arrows', [
{ title: t( 'leftwards simple arrow' ), character: '←' },
{ title: t( 'rightwards simple arrow' ), character: '→' },
{ title: t( 'upwards simple arrow' ), character: '↑' },
{ title: t( 'downwards simple arrow' ), character: '↓' },
{ title: t( 'leftwards double arrow' ), character: '⇐' },
{ title: t( 'rightwards double arrow' ), character: '⇒' },
{ title: t( 'upwards double arrow' ), character: '⇑' },
{ title: t( 'downwards double arrow' ), character: '⇓' },
{ title: t( 'leftwards dashed arrow' ), character: '⇠' },
{ title: t( 'rightwards dashed arrow' ), character: '⇢' },
{ title: t( 'upwards dashed arrow' ), character: '⇡' },
{ title: t( 'downwards dashed arrow' ), character: '⇣' },
{ title: t( 'leftwards arrow to bar' ), character: '⇤' },
{ title: t( 'rightwards arrow to bar' ), character: '⇥' },
{ title: t( 'upwards arrow to bar' ), character: '⤒' },
{ title: t( 'downwards arrow to bar' ), character: '⤓' },
{ title: t( 'up down arrow with base' ), character: '↨' },
{ title: t( 'back with leftwards arrow above' ), character: '🔙' },
{ title: t( 'end with leftwards arrow above' ), character: '🔚' },
{ title: t( 'on with exclamation mark with left right arrow above' ), character: '🔛' },
{ title: t( 'soon with rightwards arrow above' ), character: '🔜' },
{ title: t( 'top with upwards arrow above' ), character: '🔝' }
], { label: t( 'Arrows' ) } );
}
}