@tiptap/extension-emoji 2.22.0

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/dist/data.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { EmojiItem } from './emoji.js';
2
+ export declare const emojis: EmojiItem[];
3
+ export declare const gitHubCustomEmojis: EmojiItem[];
4
+ export declare const gitHubEmojis: EmojiItem[];
5
+ //# sourceMappingURL=data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../src/data.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC,eAAO,MAAM,MAAM,EAAE,SAAS,EAmp9B7B,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,SAAS,EA4KzC,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,SAAS,EAAuC,CAAA"}
@@ -0,0 +1,67 @@
1
+ import { Node } from '@tiptap/core';
2
+ import { PluginKey } from '@tiptap/pm/state';
3
+ import { SuggestionOptions } from '@tiptap/suggestion';
4
+ declare module '@tiptap/core' {
5
+ interface Commands<ReturnType> {
6
+ emoji: {
7
+ /**
8
+ * Add an emoji
9
+ */
10
+ setEmoji: (shortcode: string) => ReturnType;
11
+ };
12
+ }
13
+ }
14
+ export type EmojiItem = {
15
+ /**
16
+ * A unique name of the emoji which will be stored as attribute
17
+ */
18
+ name: string;
19
+ /**
20
+ * The emoji unicode character
21
+ */
22
+ emoji?: string;
23
+ /**
24
+ * A list of unique shortcodes that are used by input rules to find the emoji
25
+ */
26
+ shortcodes: string[];
27
+ /**
28
+ * A list of tags that can help for searching emojis
29
+ */
30
+ tags: string[];
31
+ /**
32
+ * A name that can help to group emojis
33
+ */
34
+ group?: string;
35
+ /**
36
+ * A list of unique emoticons
37
+ */
38
+ emoticons?: string[];
39
+ /**
40
+ * The unicode version the emoji was introduced
41
+ */
42
+ version?: number;
43
+ /**
44
+ * A fallback image if the current system doesn't support the emoji or for custom emojis
45
+ */
46
+ fallbackImage?: string;
47
+ /**
48
+ * Store some custom data
49
+ */
50
+ [key: string]: any;
51
+ };
52
+ export type EmojiOptions = {
53
+ HTMLAttributes: Record<string, any>;
54
+ emojis: EmojiItem[];
55
+ enableEmoticons: boolean;
56
+ forceFallbackImages: boolean;
57
+ suggestion: Omit<SuggestionOptions, 'editor'>;
58
+ };
59
+ export type EmojiStorage = {
60
+ emojis: EmojiItem[];
61
+ isSupported: (item: EmojiItem) => boolean;
62
+ };
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emoji.d.ts","sourceRoot":"","sources":["../src/emoji.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,IAAI,EAGL,MAAM,cAAc,CAAA;AACrB,OAAO,EAAU,SAAS,EAAe,MAAM,kBAAkB,CAAA;AACjE,OAAmB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AASlE,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,QAAQ,CAAC,UAAU;QAC3B,KAAK,EAAE;YACL;;eAEG;YACH,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,UAAU,CAAC;SAC7C,CAAA;KACF;CACF;AAED,MAAM,MAAM,SAAS,GAAG;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB;;OAEG;IACH,IAAI,EAAE,MAAM,EAAE,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,UAAU,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;CAC/C,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,WAAW,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAC;CAC3C,CAAA;AAED,eAAO,MAAM,wBAAwB,gBAAmC,CAAA;AAExE,eAAO,MAAM,UAAU,QAAyB,CAAA;AAEhD,eAAO,MAAM,UAAU,QAAyB,CAAA;AAEhD,eAAO,MAAM,KAAK,kCAiXhB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { EmojiItem } from '../emoji.js';
2
+ export declare function emojiToShortcode(emoji: string, emojis: EmojiItem[]): string | undefined;
3
+ //# sourceMappingURL=emojiToShortcode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emojiToShortcode.d.ts","sourceRoot":"","sources":["../../src/helpers/emojiToShortcode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGvC,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,GAAG,SAAS,CAEvF"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Removes duplicated values within an array.
3
+ * Supports numbers, strings and objects.
4
+ */
5
+ export declare function removeDuplicates<T>(array: T[], by?: {
6
+ (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
7
+ (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
8
+ }): T[];
9
+ //# sourceMappingURL=removeDuplicates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeDuplicates.d.ts","sourceRoot":"","sources":["../../src/helpers/removeDuplicates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE;;;CAAiB,GAAG,CAAC,EAAE,CAUxE"}
@@ -0,0 +1,2 @@
1
+ export declare function removeVariationSelector(value: string): string;
2
+ //# sourceMappingURL=removeVariationSelector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeVariationSelector.d.ts","sourceRoot":"","sources":["../../src/helpers/removeVariationSelector.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE7D"}
@@ -0,0 +1,3 @@
1
+ import { EmojiItem } from '../emoji.js';
2
+ export declare function shortcodeToEmoji(shortcode: string, emojis: EmojiItem[]): EmojiItem | undefined;
3
+ //# sourceMappingURL=shortcodeToEmoji.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shortcodeToEmoji.d.ts","sourceRoot":"","sources":["../../src/helpers/shortcodeToEmoji.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,GAAG,SAAS,CAE9F"}