From 00f2c986a81ca7d751b3f67afe895ebb81f60d52 Mon Sep 17 00:00:00 2001 From: d3m1d0v Date: Sat, 14 Dec 2024 18:58:30 +0300 Subject: [PATCH] feat(MarkdownEditor): add emoji suggest task template --- .../extensions/markup/emoji-suggest.ts/index.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/components/Examples/pages/MarkdownEditor/extensions/markup/emoji-suggest.ts/index.ts diff --git a/src/components/Examples/pages/MarkdownEditor/extensions/markup/emoji-suggest.ts/index.ts b/src/components/Examples/pages/MarkdownEditor/extensions/markup/emoji-suggest.ts/index.ts new file mode 100644 index 000000000000..43e8eca84fd7 --- /dev/null +++ b/src/components/Examples/pages/MarkdownEditor/extensions/markup/emoji-suggest.ts/index.ts @@ -0,0 +1,16 @@ +// import type {Completion} from '@gravity-ui/markdown-editor/cm/autocomplete'; +import type {MarkdownEditorMarkupConfig} from '@gravity-ui/markdown-editor'; + +// emoji data from https://github.com/gravity-ui/markdown-editor/blob/main/src/bundle/emoji.ts +export type EmojiDefs = Record; + +// how to connect to editor: https://github.com/gravity-ui/markdown-editor/blob/dac5314615c3808a086ba33ebe19b0063fdb6ffd/src/bundle/types.ts#L130 + +export function buildEmojiSuggestLanguageData( + _emojiDefs: EmojiDefs, +): NonNullable { + // todo: implement autocompletion for emoji suggest + // see example https://github.com/gravity-ui/markdown-editor/blob/dac5314615c3808a086ba33ebe19b0063fdb6ffd/src/markup/codemirror/yfm.ts#L94 + + return []; +}