@igeekfan/fluent-emoji-ms-core 0.1.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/LICENSE +21 -0
- package/dist/data/emoji-categories.d.ts +6 -0
- package/dist/data/emoji-list.d.ts +3 -0
- package/dist/data/emoji-presets.d.ts +4 -0
- package/dist/data/emoji-styles.d.ts +4 -0
- package/dist/i18n.d.ts +3 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +13374 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/types.d.ts +75 -0
- package/package.json +31 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export interface EmojiItem {
|
|
2
|
+
name: string;
|
|
3
|
+
path: string;
|
|
4
|
+
category: string;
|
|
5
|
+
}
|
|
6
|
+
export interface EmojiItemWithStyle extends EmojiItem {
|
|
7
|
+
style: string;
|
|
8
|
+
}
|
|
9
|
+
export interface EmojiCategory {
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
icon?: string;
|
|
13
|
+
}
|
|
14
|
+
export type EmojiPresetKey = 'basic' | 'reactions' | 'workflow';
|
|
15
|
+
export interface EmojiPreset {
|
|
16
|
+
key: EmojiPresetKey;
|
|
17
|
+
label: string;
|
|
18
|
+
description: string;
|
|
19
|
+
emojiNames: string[];
|
|
20
|
+
}
|
|
21
|
+
export type EmojiLocale = 'zh-CN' | 'en-US';
|
|
22
|
+
export interface EmojiLocaleMessages {
|
|
23
|
+
locale: EmojiLocale;
|
|
24
|
+
ui: {
|
|
25
|
+
pickerButton: string;
|
|
26
|
+
searchPlaceholder: string;
|
|
27
|
+
noResults: string;
|
|
28
|
+
loadMore: string;
|
|
29
|
+
clear: string;
|
|
30
|
+
style: string;
|
|
31
|
+
};
|
|
32
|
+
categories: Record<string, string>;
|
|
33
|
+
styles: Record<string, string>;
|
|
34
|
+
presets: Record<EmojiPresetKey, Pick<EmojiPreset, 'label' | 'description'>>;
|
|
35
|
+
}
|
|
36
|
+
export interface StyleOption {
|
|
37
|
+
name: string;
|
|
38
|
+
value: string;
|
|
39
|
+
}
|
|
40
|
+
export interface EmojiCollectionOptions {
|
|
41
|
+
categories?: string[];
|
|
42
|
+
preset?: EmojiPresetKey;
|
|
43
|
+
emojiNames?: string[];
|
|
44
|
+
}
|
|
45
|
+
export interface EmojiQueryOptions extends EmojiCollectionOptions {
|
|
46
|
+
selectedCategory?: string;
|
|
47
|
+
search?: string;
|
|
48
|
+
limit?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface EmojiQueryResult {
|
|
51
|
+
items: EmojiItem[];
|
|
52
|
+
total: number;
|
|
53
|
+
hasMore: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface EmojiPickerState {
|
|
56
|
+
isOpen: boolean;
|
|
57
|
+
baseUrl: string;
|
|
58
|
+
selectedStyle: string;
|
|
59
|
+
selectedEmojiCategory: string;
|
|
60
|
+
searchQuery: string;
|
|
61
|
+
selectedEmoji: EmojiItemWithStyle | null;
|
|
62
|
+
renderLimit: number;
|
|
63
|
+
}
|
|
64
|
+
export interface EmojiPickerStateStore {
|
|
65
|
+
getState: () => EmojiPickerState;
|
|
66
|
+
setOpen: (value: boolean) => EmojiPickerState;
|
|
67
|
+
setBaseUrl: (value: string) => EmojiPickerState;
|
|
68
|
+
setStyle: (value: string) => EmojiPickerState;
|
|
69
|
+
setCategory: (value: string) => EmojiPickerState;
|
|
70
|
+
setSearchQuery: (value: string) => EmojiPickerState;
|
|
71
|
+
selectEmoji: (emoji: EmojiItemWithStyle | null) => EmojiPickerState;
|
|
72
|
+
resetRenderLimit: (nextLimit?: number) => EmojiPickerState;
|
|
73
|
+
loadMore: (step?: number) => EmojiPickerState;
|
|
74
|
+
clearSelection: () => EmojiPickerState;
|
|
75
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@igeekfan/fluent-emoji-ms-core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/igeekfan/fluent-emoji-ms.git",
|
|
17
|
+
"directory": "packages/core"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"typescript": "^5.1.6",
|
|
24
|
+
"vite": "^4.4.8",
|
|
25
|
+
"vitest": "^3.2.4"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "pnpm exec vite build && pnpm exec tsc -p tsconfig.build.json",
|
|
29
|
+
"test": "pnpm exec vitest run"
|
|
30
|
+
}
|
|
31
|
+
}
|