@tiptap/extension-emoji 2.24.2 → 3.0.0-beta.11

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.
@@ -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
- export type EmojiItem = {
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
- export type EmojiOptions = {
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
- export type EmojiStorage = {
60
+ type EmojiStorage = {
60
61
  emojis: EmojiItem[];
61
62
  isSupported: (item: EmojiItem) => boolean;
62
63
  };
63
- export declare const EmojiSuggestionPluginKey: PluginKey<any>;
64
- export declare const inputRegex: RegExp;
65
- export declare const pasteRegex: RegExp;
66
- export declare const Emoji: Node<EmojiOptions, EmojiStorage>;
67
- //# sourceMappingURL=emoji.d.ts.map
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 { Emoji } from './emoji.js';
2
- export * from './data.js';
3
- export * from './emoji.js';
4
- export * from './helpers/emojiToShortcode.js';
5
- export * from './helpers/shortcodeToEmoji.js';
6
- export default Emoji;
7
- //# sourceMappingURL=index.d.ts.map
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 };