diff --git a/packages/client/src/tiptap/menus/emoji/constants.ts b/packages/client/src/tiptap/menus/emoji/constants.ts
deleted file mode 100644
index f178b3e..0000000
--- a/packages/client/src/tiptap/menus/emoji/constants.ts
+++ /dev/null
@@ -1,171 +0,0 @@
-export const EXPRESSIONES = [
- '๐',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐
',
- '๐',
- '๐คฃ',
- '๐ฅฒ',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐ฅฐ',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐คช',
- '๐คจ',
- '๐ง',
- '๐ค',
- '๐',
- '๐ฅธ',
- '๐คฉ',
- '๐ฅณ',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐ฃ',
- '๐',
- '๐ซ',
- '๐ฉ',
- '๐ฅบ',
- '๐ข',
- '๐ญ',
- '๐ค',
- '๐ ',
- '๐ก',
- '๐คฌ',
- '๐คฏ',
- '๐ณ',
- '๐ฅต',
- '๐ฅถ',
- '๐ฑ',
- '๐จ',
- '๐ฐ',
- '๐ฅ',
- '๐',
- '๐ค',
- '๐ค',
- '๐คญ',
- '๐คซ',
- '๐คฅ',
- '๐ถ',
- '๐',
- '๐',
- '๐ฌ',
- '๐',
- '๐ฏ',
- '๐ฆ',
- '๐ง',
- '๐ฎ',
- '๐ฒ',
- '๐ฅฑ',
- '๐ด',
- '๐คค',
- '๐ช',
- '๐ต',
- '๐ค',
- '๐ฅด',
- '๐คข',
- '๐คฎ',
- '๐คง',
- '๐ท',
- '๐ค',
- '๐ค',
- '๐ค',
- '๐ค ',
- '๐',
- '๐ฟ',
- '๐น',
- '๐บ',
- '๐คก',
- '๐ฉ',
- '๐ป',
- '๐',
- 'โ ๏ธ',
- '๐ฝ',
- '๐พ',
- '๐ค',
- '๐',
- '๐บ',
- '๐ธ',
- '๐น',
- '๐ป',
- '๐ผ',
- '๐ฝ',
- '๐',
- '๐ฟ',
- '๐พ',
-];
-
-export const GESTURES = [
- '๐',
- '๐ค',
- '๐',
- 'โ',
- '๐',
- '๐',
- '๐ค',
- '๐ค',
- 'โ๏ธ',
- '๐ค',
- '๐ค',
- '๐ค',
- '๐ค',
- '๐',
- '๐',
- '๐',
- '๐',
- '๐',
- 'โ๏ธ',
- '๐',
- '๐',
- 'โ',
- '๐',
- '๐ค',
- '๐ค',
- '๐',
- '๐',
- '๐',
- '๐คฒ',
- '๐ค',
- '๐',
- 'โ๏ธ',
- '๐
',
- '๐คณ',
- '๐ช',
- '๐ฆพ',
- '๐ฆต',
- '๐ฆฟ',
- '๐ฆถ',
- '๐ฃ',
- '๐',
- '๐ฆป',
- '๐',
- '๐ซ',
- '๐ซ',
- '๐ง ',
- '๐ฆท',
- '๐ฆด',
- '๐',
- '๐',
- '๐
',
- '๐',
- '๐',
- '๐ฉธ',
-];
diff --git a/packages/client/src/tiptap/menus/emoji/index.module.scss b/packages/client/src/tiptap/menus/emoji/index.module.scss
deleted file mode 100644
index 3c2158f..0000000
--- a/packages/client/src/tiptap/menus/emoji/index.module.scss
+++ /dev/null
@@ -1,24 +0,0 @@
-.wrap {
- height: 300px;
- overflow: auto;
-}
-
-.listWrap {
- display: flex;
- width: 320px;
- padding: 0;
- margin: 0;
- list-style: none;
- flex-wrap: wrap;
-
- > li {
- display: flex;
- justify-content: center;
- align-items: center;
- width: 32px;
- height: 32px;
- padding: 4px;
- font-size: 24px;
- cursor: pointer;
- }
-}
diff --git a/packages/client/src/tiptap/menus/emoji/index.tsx b/packages/client/src/tiptap/menus/emoji/index.tsx
index 0a77cf3..e95540d 100644
--- a/packages/client/src/tiptap/menus/emoji/index.tsx
+++ b/packages/client/src/tiptap/menus/emoji/index.tsx
@@ -1,63 +1,22 @@
import React, { useCallback } from 'react';
import { Editor } from '@tiptap/core';
-import { Popover, Button, Typography } from '@douyinfe/semi-ui';
+import { Button } from '@douyinfe/semi-ui';
import { Tooltip } from 'components/tooltip';
import { IconEmoji } from 'components/icons';
-import { EXPRESSIONES, GESTURES } from './constants';
-import styles from './index.module.scss';
-
-const { Title } = Typography;
-
-const LIST = [
- {
- title: '่กจๆ
',
- data: EXPRESSIONES,
- },
- {
- title: 'ๆๅฟ',
- data: GESTURES,
- },
-];
+import { EmojiPicker } from 'components/emoji-picker';
export const Emoji: React.FC<{ editor: Editor }> = ({ editor }) => {
const setEmoji = useCallback((emoji) => {
- return () => {
- const transaction = editor.state.tr.insertText(emoji);
- editor.view.dispatch(transaction);
- };
+ const { selection } = editor.state;
+ const { $anchor } = selection;
+ return editor.chain().insertContentAt($anchor.pos, emoji).run();
}, []);
return (
-
- {LIST.map((item, index) => {
- return (
-
-
- {item.title}
-
-
- {(item.data || []).map((ex) => (
- -
- {ex}
-
- ))}
-
-
- );
- })}
-
- }
- >
-
-
- } />
-
-
-
+
+
+ } />
+
+
);
};