Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate emojis with the text transformation feature #17737

Open
pomek opened this issue Jan 10, 2025 · 0 comments
Open

Integrate emojis with the text transformation feature #17737

pomek opened this issue Jan 10, 2025 · 0 comments
Labels
package:emoji type:feature This issue reports a feature request (an idea for a new functionality or a missing option).

Comments

@pomek
Copy link
Member

pomek commented Jan 10, 2025

๐Ÿ“ Provide a description of the new feature

The text transformation feature enables autocorrection. It automatically changes predefined text fragments into their improved forms.

Example: (tm) is replaced with โ„ข.

Integrating the text emoticons and a commonly used emoji they might map to would be good.

Below, you can find a text and a corresponding emoji.

  • :) โ€” :slightly_smiling_face: (๐Ÿ™‚)
  • :( โ€” :slightly_frowning_face: (๐Ÿ™)
  • :D โ€” :grinning: (๐Ÿ˜€)
  • :O โ€” :open_mouth: (๐Ÿ˜ฎ)
  • ;) โ€” :wink: (๐Ÿ˜‰)
  • :P โ€” :stuck_out_tongue: (๐Ÿ˜›)
  • :/ โ€” :confused: (๐Ÿ˜•)
  • :\ โ€” :confused: (๐Ÿ˜•)
  • :| โ€” :neutral_face: (๐Ÿ˜)
  • 8) โ€” :sunglasses: (๐Ÿ˜Ž)
  • :* โ€” :kissing: (๐Ÿ˜—)
  • :'( โ€” :cry: (๐Ÿ˜ข)
  • :') โ€” :joy: (๐Ÿ˜‚)
  • XD โ€” :laughing: (๐Ÿ˜†)
  • XP โ€” :stuck_out_tongue_winking_eye: (๐Ÿ˜œ)
  • T_T โ€” :sob: (๐Ÿ˜ญ)
  • -_- โ€” :expressionless: (๐Ÿ˜‘)
  • x_x โ€” :dizzy_face: (๐Ÿ˜ต)
  • :3 โ€” :smile_cat: (๐Ÿ˜ธ)
  • <3 โ€” :heart: (โค)
  • </3 โ€” :broken_heart: (๐Ÿ’”)
  • >:( โ€” :angry: (๐Ÿ˜ )
  • D: โ€” :anguished: (๐Ÿ˜ง)
  • :^D โ€” :zany_face: (๐Ÿคช)
  • :v โ€” :v: (โœŒ)
  • =D โ€” :grin: (๐Ÿ˜)
  • 8( โ€” :tired_face: (๐Ÿ˜ซ)
  • ;( โ€” :cry: (๐Ÿ˜ข)

To avoid issues with the loaded plugins' order, I suggest moving the TextTransformation initialization phase from the init() hook to afterInit().

public init(): void {
const model = this.editor.model;
const modelSelection = model.document.selection;
modelSelection.on( 'change:range', () => {
// Disable plugin when selection is inside a code block.
this.isEnabled = !modelSelection.anchor!.parent.is( 'element', 'codeBlock' );
} );
this._enableTransformationWatchers();
}

Definition of Done

  • A text emoticon is replaced with an emoji while typing in the editor.

If you'd like to see this feature implemented, add a ๐Ÿ‘ reaction to this post.

@pomek pomek added package:emoji type:feature This issue reports a feature request (an idea for a new functionality or a missing option). labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:emoji type:feature This issue reports a feature request (an idea for a new functionality or a missing option).
Projects
None yet
Development

No branches or pull requests

1 participant