@tiptap/extension-emoji 2.24.1 → 3.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/dist/index.cjs +19695 -31889
- package/dist/index.cjs.map +1 -1
- package/dist/{emoji.d.ts → index.d.cts} +18 -8
- package/dist/index.d.ts +77 -7
- package/dist/index.js +19662 -31873
- package/dist/index.js.map +1 -1
- package/package.json +15 -18
- package/src/data.ts +3949 -16136
- package/src/emoji.ts +73 -76
- package/src/generate.ts +4 -9
- package/src/helpers/emojiToShortcode.ts +1 -1
- package/src/helpers/removeDuplicates.ts +1 -3
- package/src/helpers/shortcodeToEmoji.ts +1 -1
- package/dist/data.d.ts +0 -5
- package/dist/data.d.ts.map +0 -1
- package/dist/emoji.d.ts.map +0 -1
- package/dist/helpers/emojiToShortcode.d.ts +0 -3
- package/dist/helpers/emojiToShortcode.d.ts.map +0 -1
- package/dist/helpers/removeDuplicates.d.ts +0 -9
- package/dist/helpers/removeDuplicates.d.ts.map +0 -1
- package/dist/helpers/removeVariationSelector.d.ts +0 -2
- package/dist/helpers/removeVariationSelector.d.ts.map +0 -1
- package/dist/helpers/shortcodeToEmoji.d.ts +0 -3
- package/dist/helpers/shortcodeToEmoji.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.umd.js +0 -31911
- package/dist/index.umd.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Node } from '@tiptap/core';
|
|
2
2
|
import { PluginKey } from '@tiptap/pm/state';
|
|
3
3
|
import { SuggestionOptions } from '@tiptap/suggestion';
|
|
4
|
+
|
|
4
5
|
declare module '@tiptap/core' {
|
|
5
6
|
interface Commands<ReturnType> {
|
|
6
7
|
emoji: {
|
|
@@ -11,7 +12,7 @@ declare module '@tiptap/core' {
|
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
+
type EmojiItem = {
|
|
15
16
|
/**
|
|
16
17
|
* A unique name of the emoji which will be stored as attribute
|
|
17
18
|
*/
|
|
@@ -49,19 +50,28 @@ export type EmojiItem = {
|
|
|
49
50
|
*/
|
|
50
51
|
[key: string]: any;
|
|
51
52
|
};
|
|
52
|
-
|
|
53
|
+
type EmojiOptions = {
|
|
53
54
|
HTMLAttributes: Record<string, any>;
|
|
54
55
|
emojis: EmojiItem[];
|
|
55
56
|
enableEmoticons: boolean;
|
|
56
57
|
forceFallbackImages: boolean;
|
|
57
58
|
suggestion: Omit<SuggestionOptions, 'editor'>;
|
|
58
59
|
};
|
|
59
|
-
|
|
60
|
+
type EmojiStorage = {
|
|
60
61
|
emojis: EmojiItem[];
|
|
61
62
|
isSupported: (item: EmojiItem) => boolean;
|
|
62
63
|
};
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
64
|
+
declare const EmojiSuggestionPluginKey: PluginKey<any>;
|
|
65
|
+
declare const inputRegex: RegExp;
|
|
66
|
+
declare const pasteRegex: RegExp;
|
|
67
|
+
declare const Emoji: Node<EmojiOptions, EmojiStorage>;
|
|
68
|
+
|
|
69
|
+
declare const emojis: EmojiItem[];
|
|
70
|
+
declare const gitHubCustomEmojis: EmojiItem[];
|
|
71
|
+
declare const gitHubEmojis: EmojiItem[];
|
|
72
|
+
|
|
73
|
+
declare function emojiToShortcode(emoji: string, emojis: EmojiItem[]): string | undefined;
|
|
74
|
+
|
|
75
|
+
declare function shortcodeToEmoji(shortcode: string, emojis: EmojiItem[]): EmojiItem | undefined;
|
|
76
|
+
|
|
77
|
+
export { Emoji, type EmojiItem, type EmojiOptions, type EmojiStorage, EmojiSuggestionPluginKey, Emoji as default, emojiToShortcode, emojis, gitHubCustomEmojis, gitHubEmojis, inputRegex, pasteRegex, shortcodeToEmoji };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,77 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
import { PluginKey } from '@tiptap/pm/state';
|
|
3
|
+
import { SuggestionOptions } from '@tiptap/suggestion';
|
|
4
|
+
|
|
5
|
+
declare module '@tiptap/core' {
|
|
6
|
+
interface Commands<ReturnType> {
|
|
7
|
+
emoji: {
|
|
8
|
+
/**
|
|
9
|
+
* Add an emoji
|
|
10
|
+
*/
|
|
11
|
+
setEmoji: (shortcode: string) => ReturnType;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
type EmojiItem = {
|
|
16
|
+
/**
|
|
17
|
+
* A unique name of the emoji which will be stored as attribute
|
|
18
|
+
*/
|
|
19
|
+
name: string;
|
|
20
|
+
/**
|
|
21
|
+
* The emoji unicode character
|
|
22
|
+
*/
|
|
23
|
+
emoji?: string;
|
|
24
|
+
/**
|
|
25
|
+
* A list of unique shortcodes that are used by input rules to find the emoji
|
|
26
|
+
*/
|
|
27
|
+
shortcodes: string[];
|
|
28
|
+
/**
|
|
29
|
+
* A list of tags that can help for searching emojis
|
|
30
|
+
*/
|
|
31
|
+
tags: string[];
|
|
32
|
+
/**
|
|
33
|
+
* A name that can help to group emojis
|
|
34
|
+
*/
|
|
35
|
+
group?: string;
|
|
36
|
+
/**
|
|
37
|
+
* A list of unique emoticons
|
|
38
|
+
*/
|
|
39
|
+
emoticons?: string[];
|
|
40
|
+
/**
|
|
41
|
+
* The unicode version the emoji was introduced
|
|
42
|
+
*/
|
|
43
|
+
version?: number;
|
|
44
|
+
/**
|
|
45
|
+
* A fallback image if the current system doesn't support the emoji or for custom emojis
|
|
46
|
+
*/
|
|
47
|
+
fallbackImage?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Store some custom data
|
|
50
|
+
*/
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
};
|
|
53
|
+
type EmojiOptions = {
|
|
54
|
+
HTMLAttributes: Record<string, any>;
|
|
55
|
+
emojis: EmojiItem[];
|
|
56
|
+
enableEmoticons: boolean;
|
|
57
|
+
forceFallbackImages: boolean;
|
|
58
|
+
suggestion: Omit<SuggestionOptions, 'editor'>;
|
|
59
|
+
};
|
|
60
|
+
type EmojiStorage = {
|
|
61
|
+
emojis: EmojiItem[];
|
|
62
|
+
isSupported: (item: EmojiItem) => boolean;
|
|
63
|
+
};
|
|
64
|
+
declare const EmojiSuggestionPluginKey: PluginKey<any>;
|
|
65
|
+
declare const inputRegex: RegExp;
|
|
66
|
+
declare const pasteRegex: RegExp;
|
|
67
|
+
declare const Emoji: Node<EmojiOptions, EmojiStorage>;
|
|
68
|
+
|
|
69
|
+
declare const emojis: EmojiItem[];
|
|
70
|
+
declare const gitHubCustomEmojis: EmojiItem[];
|
|
71
|
+
declare const gitHubEmojis: EmojiItem[];
|
|
72
|
+
|
|
73
|
+
declare function emojiToShortcode(emoji: string, emojis: EmojiItem[]): string | undefined;
|
|
74
|
+
|
|
75
|
+
declare function shortcodeToEmoji(shortcode: string, emojis: EmojiItem[]): EmojiItem | undefined;
|
|
76
|
+
|
|
77
|
+
export { Emoji, type EmojiItem, type EmojiOptions, type EmojiStorage, EmojiSuggestionPluginKey, Emoji as default, emojiToShortcode, emojis, gitHubCustomEmojis, gitHubEmojis, inputRegex, pasteRegex, shortcodeToEmoji };
|