File tree Expand file tree Collapse file tree
src/lib/components/common/RichTextInput Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 import CheckBox from ' $lib/components/icons/CheckBox.svelte' ;
2020 import ArrowLeftTag from ' $lib/components/icons/ArrowLeftTag.svelte' ;
2121 import ArrowRightTag from ' $lib/components/icons/ArrowRightTag.svelte' ;
22+
23+ import EmojiPicker from ' ../EmojiPicker.svelte' ;
24+ import FaceSmile from ' $lib/components/icons/FaceSmile.svelte' ;
25+ import { shortCodesToEmojis } from ' $lib/stores' ;
2226 </script >
2327
2428<div
179183 <CodeBracket />
180184 </button >
181185 </Tooltip >
186+
187+ <EmojiPicker
188+ onSubmit ={(shortCode ) => {
189+ const codepoint = $shortCodesToEmojis [shortCode ];
190+ if (codepoint ) {
191+ const emoji = codepoint
192+ .split (' -' )
193+ .map ((cp ) => String .fromCodePoint (parseInt (cp , 16 )))
194+ .join (' ' );
195+ editor ?.chain ().focus ().insertContent (emoji ).run ();
196+ }
197+ }}
198+ >
199+ <Tooltip placement ="top" content ={$i18n .t (' Emoji' )}>
200+ <button
201+ class =" hover:bg-gray-50 dark:hover:bg-gray-700 rounded-lg p-1.5 transition-all"
202+ type =" button"
203+ >
204+ <FaceSmile className =" size-4" />
205+ </button >
206+ </Tooltip >
207+ </EmojiPicker >
182208</div >
You can’t perform that action at this time.
0 commit comments