emoji-picker-react 4.0.0-rc.2 → 4.0.0-rc.3
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/components/context/PickerContext.d.ts +1 -1
- package/dist/components/emoji/Emoji.d.ts +1 -1
- package/dist/config/cdnUrls.d.ts +1 -1
- package/dist/config/config.d.ts +1 -14
- package/dist/config/useConfig.d.ts +1 -3
- package/dist/data/skinToneVariations.d.ts +1 -8
- package/dist/dataUtils/emojiSelectors.d.ts +1 -2
- package/dist/dataUtils/recentlyUsed.d.ts +1 -1
- package/dist/emoji-picker-react.cjs.development.js +26 -32
- package/dist/emoji-picker-react.cjs.development.js.map +1 -1
- package/dist/emoji-picker-react.cjs.production.min.js +1 -1
- package/dist/emoji-picker-react.cjs.production.min.js.map +1 -1
- package/dist/emoji-picker-react.esm.js +21 -21
- package/dist/emoji-picker-react.esm.js.map +1 -1
- package/dist/hooks/preloadEmoji.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/types/exposedTypes.d.ts +20 -2
- package/package.json +1 -1
- package/src/components/context/PickerContext.tsx +1 -1
- package/src/components/emoji/Emoji.tsx +1 -1
- package/src/components/main/PickerMain.tsx +1 -1
- package/src/config/cdnUrls.ts +1 -1
- package/src/config/config.ts +1 -15
- package/src/config/useConfig.ts +1 -3
- package/src/data/skinToneVariations.ts +1 -8
- package/src/dataUtils/emojiSelectors.ts +2 -2
- package/src/dataUtils/recentlyUsed.ts +1 -2
- package/src/hooks/preloadEmoji.ts +1 -1
- package/src/hooks/useMouseDownHandlers.ts +2 -3
- package/src/index.tsx +1 -0
- package/src/types/exposedTypes.ts +23 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { SkinTones } from '../../data/skinToneVariations';
|
|
3
2
|
import { DataEmoji } from '../../dataUtils/DataTypes';
|
|
4
3
|
import { FilterDict } from '../../hooks/useFilter';
|
|
4
|
+
import { SkinTones } from '../../types/exposedTypes';
|
|
5
5
|
export declare function PickerContextProvider({ children }: Props): JSX.Element;
|
|
6
6
|
declare type ReactState<T> = [T, React.Dispatch<React.SetStateAction<T>>];
|
|
7
7
|
declare type Props = Readonly<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { EmojiStyle } from '../../config/config';
|
|
3
2
|
import { DataEmoji } from '../../dataUtils/DataTypes';
|
|
3
|
+
import { EmojiStyle } from '../../types/exposedTypes';
|
|
4
4
|
import './Emoji.css';
|
|
5
5
|
declare type Props = Readonly<{
|
|
6
6
|
hidden?: boolean;
|
package/dist/config/cdnUrls.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { EmojiStyle } from
|
|
1
|
+
import { EmojiStyle } from "../types/exposedTypes";
|
|
2
2
|
export declare function cdnUrl(emojiStyle: EmojiStyle): string;
|
package/dist/config/config.d.ts
CHANGED
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import { SkinTones } from '../
|
|
2
|
-
import { EmojiClickData } from '../types/exposedTypes';
|
|
1
|
+
import { EmojiClickData, EmojiStyle, SkinTones, Theme } from '../types/exposedTypes';
|
|
3
2
|
import { CategoriesConfig } from './categoryConfig';
|
|
4
|
-
export declare enum EmojiStyle {
|
|
5
|
-
NATIVE = "native",
|
|
6
|
-
APPLE = "apple",
|
|
7
|
-
TWITTER = "twitter",
|
|
8
|
-
GOOGLE = "google",
|
|
9
|
-
FACEBOOK = "facebook"
|
|
10
|
-
}
|
|
11
|
-
export declare enum Theme {
|
|
12
|
-
DARK = "dark",
|
|
13
|
-
LIGHT = "light",
|
|
14
|
-
AUTO = "auto"
|
|
15
|
-
}
|
|
16
3
|
export declare function mergeConfig(userConfig?: PickerConfig): {
|
|
17
4
|
categories: CategoriesConfig;
|
|
18
5
|
searchPlaceHolder: string;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { SkinTones } from '../
|
|
2
|
-
import { EmojiClickData } from '../types/exposedTypes';
|
|
1
|
+
import { EmojiClickData, EmojiStyle, SkinTones } from '../types/exposedTypes';
|
|
3
2
|
import { CategoriesConfig } from './categoryConfig';
|
|
4
|
-
import { EmojiStyle } from './config';
|
|
5
3
|
export declare function useSearchPlaceHolderConfig(): string;
|
|
6
4
|
export declare function useDefaultSkinToneConfig(): SkinTones;
|
|
7
5
|
export declare function useSkinTonesDisabledConfig(): boolean;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
NEUTRAL = "neutral",
|
|
3
|
-
LIGHT = "1f3fb",
|
|
4
|
-
MEDIUM_LIGHT = "1f3fc",
|
|
5
|
-
MEDIUM = "1f3fd",
|
|
6
|
-
MEDIUM_DARK = "1f3fe",
|
|
7
|
-
DARK = "1f3ff"
|
|
8
|
-
}
|
|
1
|
+
import { SkinTones } from '../types/exposedTypes';
|
|
9
2
|
declare const skinToneVariations: SkinTones[];
|
|
10
3
|
export default skinToneVariations;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Categories } from './../config/categoryConfig';
|
|
2
|
-
import { EmojiStyle } from '../config/config';
|
|
3
2
|
import { DataEmoji, DataEmojis } from './DataTypes';
|
|
4
|
-
import { SkinTones } from '../
|
|
3
|
+
import { EmojiStyle, SkinTones } from '../types/exposedTypes';
|
|
5
4
|
export declare function emojiNames(emoji: DataEmoji): string[];
|
|
6
5
|
export declare function emojiName(emoji: DataEmoji): string;
|
|
7
6
|
export declare function emojiUrl(emojiStyle: EmojiStyle, emoji: DataEmoji, skinTone?: string): string;
|
|
@@ -83,7 +83,19 @@ function categoryNameFromDom($category) {
|
|
|
83
83
|
return (_$category$getAttribu = $category == null ? void 0 : $category.getAttribute('data-name')) != null ? _$category$getAttribu : null;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
(function (EmojiStyle) {
|
|
87
|
+
EmojiStyle["NATIVE"] = "native";
|
|
88
|
+
EmojiStyle["APPLE"] = "apple";
|
|
89
|
+
EmojiStyle["TWITTER"] = "twitter";
|
|
90
|
+
EmojiStyle["GOOGLE"] = "google";
|
|
91
|
+
EmojiStyle["FACEBOOK"] = "facebook";
|
|
92
|
+
})(exports.EmojiStyle || (exports.EmojiStyle = {}));
|
|
93
|
+
|
|
94
|
+
(function (Theme) {
|
|
95
|
+
Theme["DARK"] = "dark";
|
|
96
|
+
Theme["LIGHT"] = "light";
|
|
97
|
+
Theme["AUTO"] = "auto";
|
|
98
|
+
})(exports.Theme || (exports.Theme = {}));
|
|
87
99
|
|
|
88
100
|
(function (SkinTones) {
|
|
89
101
|
SkinTones["NEUTRAL"] = "neutral";
|
|
@@ -92,9 +104,7 @@ var SkinTones;
|
|
|
92
104
|
SkinTones["MEDIUM"] = "1f3fd";
|
|
93
105
|
SkinTones["MEDIUM_DARK"] = "1f3fe";
|
|
94
106
|
SkinTones["DARK"] = "1f3ff";
|
|
95
|
-
})(SkinTones || (SkinTones = {}));
|
|
96
|
-
|
|
97
|
-
var skinToneVariations = [SkinTones.NEUTRAL, SkinTones.LIGHT, SkinTones.MEDIUM_LIGHT, SkinTones.MEDIUM, SkinTones.MEDIUM_DARK, SkinTones.DARK];
|
|
107
|
+
})(exports.SkinTones || (exports.SkinTones = {}));
|
|
98
108
|
|
|
99
109
|
var _configByCategory;
|
|
100
110
|
|
|
@@ -176,24 +186,6 @@ function getBaseConfigByCategory(category) {
|
|
|
176
186
|
return configByCategory[category];
|
|
177
187
|
}
|
|
178
188
|
|
|
179
|
-
var EmojiStyle;
|
|
180
|
-
|
|
181
|
-
(function (EmojiStyle) {
|
|
182
|
-
EmojiStyle["NATIVE"] = "native";
|
|
183
|
-
EmojiStyle["APPLE"] = "apple";
|
|
184
|
-
EmojiStyle["TWITTER"] = "twitter";
|
|
185
|
-
EmojiStyle["GOOGLE"] = "google";
|
|
186
|
-
EmojiStyle["FACEBOOK"] = "facebook";
|
|
187
|
-
})(EmojiStyle || (EmojiStyle = {}));
|
|
188
|
-
|
|
189
|
-
var Theme;
|
|
190
|
-
|
|
191
|
-
(function (Theme) {
|
|
192
|
-
Theme["DARK"] = "dark";
|
|
193
|
-
Theme["LIGHT"] = "light";
|
|
194
|
-
Theme["AUTO"] = "auto";
|
|
195
|
-
})(Theme || (Theme = {}));
|
|
196
|
-
|
|
197
189
|
function mergeConfig(userConfig) {
|
|
198
190
|
if (userConfig === void 0) {
|
|
199
191
|
userConfig = {};
|
|
@@ -208,15 +200,15 @@ function basePickerConfig() {
|
|
|
208
200
|
return {
|
|
209
201
|
autoFocusSearch: true,
|
|
210
202
|
categories: baseCategoriesConfig,
|
|
211
|
-
defaultSkinTone: SkinTones.NEUTRAL,
|
|
212
|
-
emojiStyle: EmojiStyle.APPLE,
|
|
203
|
+
defaultSkinTone: exports.SkinTones.NEUTRAL,
|
|
204
|
+
emojiStyle: exports.EmojiStyle.APPLE,
|
|
213
205
|
onEmojiClick: function defaultOnClickHandler( // @ts-ignore
|
|
214
206
|
event, // @ts-ignore
|
|
215
207
|
emoji) {},
|
|
216
208
|
searchPlaceHolder: 'Search',
|
|
217
209
|
showPreview: true,
|
|
218
210
|
skinTonesDisabled: false,
|
|
219
|
-
theme: Theme.LIGHT
|
|
211
|
+
theme: exports.Theme.LIGHT
|
|
220
212
|
};
|
|
221
213
|
}
|
|
222
214
|
|
|
@@ -396,7 +388,7 @@ function PickerContextProvider(_ref) {
|
|
|
396
388
|
var PickerContext = /*#__PURE__*/React.createContext({
|
|
397
389
|
searchTerm: ['', function () {}],
|
|
398
390
|
activeCategoryState: [null, function () {}],
|
|
399
|
-
activeSkinTone: [SkinTones.NEUTRAL, function () {}],
|
|
391
|
+
activeSkinTone: [exports.SkinTones.NEUTRAL, function () {}],
|
|
400
392
|
emojisThatFailedToLoadState: [/*#__PURE__*/new Set(), function () {}],
|
|
401
393
|
isPastInitialLoad: true,
|
|
402
394
|
emojiVariationPickerState: [null, function () {}],
|
|
@@ -530,16 +522,16 @@ var CDN_URL_TWITTER = 'https://cdn.jsdelivr.net/npm/emoji-datasource-twitter/img
|
|
|
530
522
|
var CDN_URL_GOOGLE = 'https://cdn.jsdelivr.net/npm/emoji-datasource-google/img/google/64/';
|
|
531
523
|
function cdnUrl(emojiStyle) {
|
|
532
524
|
switch (emojiStyle) {
|
|
533
|
-
case EmojiStyle.TWITTER:
|
|
525
|
+
case exports.EmojiStyle.TWITTER:
|
|
534
526
|
return CDN_URL_TWITTER;
|
|
535
527
|
|
|
536
|
-
case EmojiStyle.GOOGLE:
|
|
528
|
+
case exports.EmojiStyle.GOOGLE:
|
|
537
529
|
return CDN_URL_GOOGLE;
|
|
538
530
|
|
|
539
|
-
case EmojiStyle.FACEBOOK:
|
|
531
|
+
case exports.EmojiStyle.FACEBOOK:
|
|
540
532
|
return CDN_URL_FACEBOOK;
|
|
541
533
|
|
|
542
|
-
case EmojiStyle.APPLE:
|
|
534
|
+
case exports.EmojiStyle.APPLE:
|
|
543
535
|
default:
|
|
544
536
|
return CDN_URL_APPLE;
|
|
545
537
|
}
|
|
@@ -6284,6 +6276,8 @@ var emojis = {
|
|
|
6284
6276
|
}]
|
|
6285
6277
|
};
|
|
6286
6278
|
|
|
6279
|
+
var skinToneVariations = [exports.SkinTones.NEUTRAL, exports.SkinTones.LIGHT, exports.SkinTones.MEDIUM_LIGHT, exports.SkinTones.MEDIUM, exports.SkinTones.MEDIUM_DARK, exports.SkinTones.DARK];
|
|
6280
|
+
|
|
6287
6281
|
var _window;
|
|
6288
6282
|
var EmojiProperties;
|
|
6289
6283
|
|
|
@@ -6870,7 +6864,7 @@ function Emoji(_ref) {
|
|
|
6870
6864
|
}),
|
|
6871
6865
|
"data-unified": unified,
|
|
6872
6866
|
"data-original": emojiUnified(emoji)
|
|
6873
|
-
}, emojiStyle === EmojiStyle.NATIVE ? React.createElement(NativeEmoji, Object.assign({}, base)) : React.createElement(EmojiImg, Object.assign({}, base, {
|
|
6867
|
+
}, emojiStyle === exports.EmojiStyle.NATIVE ? React.createElement(NativeEmoji, Object.assign({}, base)) : React.createElement(EmojiImg, Object.assign({}, base, {
|
|
6874
6868
|
emoji: emoji,
|
|
6875
6869
|
emojiStyle: emojiStyle
|
|
6876
6870
|
})));
|
|
@@ -7411,7 +7405,7 @@ function PickerRootElement(_ref2) {
|
|
|
7411
7405
|
return React.createElement("aside", {
|
|
7412
7406
|
className: clsx('EmojiPickerReact', 'epr-main', {
|
|
7413
7407
|
'epr-search-active': searchModeActive,
|
|
7414
|
-
'epr-dark-theme': theme === Theme.DARK
|
|
7408
|
+
'epr-dark-theme': theme === exports.Theme.DARK
|
|
7415
7409
|
}),
|
|
7416
7410
|
ref: PickerMainRef
|
|
7417
7411
|
}, children);
|