@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 +5 -0
- package/dist/data.d.ts.map +1 -0
- package/dist/emoji.d.ts +67 -0
- package/dist/emoji.d.ts.map +1 -0
- package/dist/helpers/emojiToShortcode.d.ts +3 -0
- package/dist/helpers/emojiToShortcode.d.ts.map +1 -0
- package/dist/helpers/removeDuplicates.d.ts +9 -0
- package/dist/helpers/removeDuplicates.d.ts.map +1 -0
- package/dist/helpers/removeVariationSelector.d.ts +2 -0
- package/dist/helpers/removeVariationSelector.d.ts.map +1 -0
- package/dist/helpers/shortcodeToEmoji.d.ts +3 -0
- package/dist/helpers/shortcodeToEmoji.d.ts.map +1 -0
- package/dist/index.cjs +31916 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31898 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +31911 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +53 -0
- package/src/data.ts +31560 -0
- package/src/emoji.ts +460 -0
- package/src/generate.ts +85 -0
- package/src/helpers/emojiToShortcode.ts +6 -0
- package/src/helpers/removeDuplicates.ts +15 -0
- package/src/helpers/removeVariationSelector.ts +3 -0
- package/src/helpers/shortcodeToEmoji.ts +5 -0
- package/src/index.ts +8 -0
package/dist/data.d.ts
ADDED
|
@@ -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"}
|
package/dist/emoji.d.ts
ADDED
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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"}
|