diff --git a/packages/ckeditor5-emoji/src/ui/emojiinfoview.ts b/packages/ckeditor5-emoji/src/ui/emojiinfoview.ts index 12de7f779d0..7c02a3b4fa9 100644 --- a/packages/ckeditor5-emoji/src/ui/emojiinfoview.ts +++ b/packages/ckeditor5-emoji/src/ui/emojiinfoview.ts @@ -30,13 +30,6 @@ export default class EmojiInfoView extends View { */ declare public name: string | null; - /** - * The "Unicode string" of the {@link #emoji}. For instance "U+0061". - * - * @observable - */ - declare public readonly code: string; - /** * @inheritDoc */ @@ -47,7 +40,6 @@ export default class EmojiInfoView extends View { this.set( 'emoji', null ); this.set( 'name', null ); - this.bind( 'code' ).to( this, 'emoji', characterToUnicodeString ); this.setTemplate( { tag: 'div', @@ -65,19 +57,6 @@ export default class EmojiInfoView extends View { text: bind.to( 'name', name => name ? name : '\u200B' ) } ] - }, - { - tag: 'span', - attributes: { - class: [ - 'ck-emoji-info__code' - ] - }, - children: [ - { - text: bind.to( 'code' ) - } - ] } ], attributes: { @@ -89,20 +68,3 @@ export default class EmojiInfoView extends View { } ); } } - -/** - * Converts a character into a "Unicode string", for instance: - * - * "$" -> "U+0024" - * - * Returns an empty string when the character is `null`. - */ -function characterToUnicodeString( emoji: string | null ): string { - if ( emoji === null ) { - return ''; - } - - const hexCode = emoji.codePointAt( 0 )!.toString( 16 ); - - return 'U+' + ( '0000' + hexCode ).slice( -4 ); -} diff --git a/packages/ckeditor5-emoji/tests/ui/emojiinfoview.js b/packages/ckeditor5-emoji/tests/ui/emojiinfoview.js index 64b8bb7600c..551b23a0f7a 100644 --- a/packages/ckeditor5-emoji/tests/ui/emojiinfoview.js +++ b/packages/ckeditor5-emoji/tests/ui/emojiinfoview.js @@ -33,33 +33,18 @@ describe( 'EmojiInfoView', () => { } ); } ); - describe( '#code', () => { - it( 'is defined', () => { - expect( view.code ).to.equal( '' ); - } ); - - it( 'is bound to #emoji', () => { - view.set( 'emoji', 'A' ); - - expect( view.code ).to.equal( 'U+0041' ); - } ); - } ); - describe( '#element', () => { it( 'is being created from template', () => { expect( view.element.classList.contains( 'ck' ) ).to.be.true; expect( view.element.classList.contains( 'ck-emoji-info' ) ).to.be.true; expect( view.element.firstElementChild.classList.contains( 'ck-emoji-info__name' ) ).to.be.true; - expect( view.element.lastElementChild.classList.contains( 'ck-emoji-info__code' ) ).to.be.true; } ); - it( 'is being updated when #code and #name have changed', () => { + it( 'is being updated when #name have changed', () => { const infoEl = view.element.firstElementChild; - const codeEl = view.element.lastElementChild; expect( infoEl.innerText ).to.equal( '\u200B' ); - expect( codeEl.innerText ).to.equal( '' ); view.set( { emoji: 'A', @@ -67,7 +52,6 @@ describe( 'EmojiInfoView', () => { } ); expect( infoEl.innerText ).to.equal( 'SYMBOL: A' ); - expect( codeEl.innerText ).to.equal( 'U+0041' ); } ); } ); } );