@atlaskit/emoji 65.0.0 → 65.2.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/CHANGELOG.md +36 -0
- package/dist/cjs/components/common/CachingEmoji.js +84 -151
- package/dist/cjs/components/common/Emoji.js +2 -2
- package/dist/cjs/components/common/EmojiActions.js +129 -175
- package/dist/cjs/components/common/EmojiErrorMessage.js +23 -59
- package/dist/cjs/components/common/EmojiPreviewComponent.js +1 -0
- package/dist/cjs/components/common/EmojiUploadPicker.js +235 -293
- package/dist/cjs/components/common/FileChooser.js +34 -71
- package/dist/cjs/components/common/Popup.js +105 -154
- package/dist/cjs/components/common/ResourcedEmojiComponent.js +10 -5
- package/dist/cjs/components/common/RetryableButton.js +43 -64
- package/dist/cjs/components/common/ToneSelector.js +50 -89
- package/dist/cjs/components/common/styles.js +14 -16
- package/dist/cjs/components/hooks.js +16 -0
- package/dist/cjs/components/picker/EmojiPickerCategoryHeading.js +16 -48
- package/dist/cjs/components/picker/EmojiPickerComponent.js +496 -508
- package/dist/cjs/components/picker/EmojiPickerEmojiRow.js +33 -60
- package/dist/cjs/components/picker/EmojiPickerFooter.js +13 -46
- package/dist/cjs/components/picker/styles.js +16 -13
- package/dist/cjs/components/uploader/EmojiUploadComponent.js +124 -109
- package/dist/cjs/hooks/useEmojiContext.js +16 -0
- package/dist/cjs/hooks/usePrevious.js +16 -0
- package/dist/cjs/index.js +16 -0
- package/dist/cjs/util/constants.js +3 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/common/CachingEmoji.js +65 -112
- package/dist/es2019/components/common/Emoji.js +2 -2
- package/dist/es2019/components/common/EmojiActions.js +124 -150
- package/dist/es2019/components/common/EmojiErrorMessage.js +22 -26
- package/dist/es2019/components/common/EmojiPreviewComponent.js +1 -0
- package/dist/es2019/components/common/EmojiUploadPicker.js +190 -253
- package/dist/es2019/components/common/FileChooser.js +37 -40
- package/dist/es2019/components/common/Popup.js +89 -109
- package/dist/es2019/components/common/ResourcedEmojiComponent.js +5 -4
- package/dist/es2019/components/common/RetryableButton.js +43 -34
- package/dist/es2019/components/common/ToneSelector.js +46 -59
- package/dist/es2019/components/common/styles.js +9 -9
- package/dist/es2019/components/hooks.js +8 -0
- package/dist/es2019/components/picker/EmojiPickerCategoryHeading.js +13 -17
- package/dist/es2019/components/picker/EmojiPickerComponent.js +417 -497
- package/dist/es2019/components/picker/EmojiPickerEmojiRow.js +32 -35
- package/dist/es2019/components/picker/EmojiPickerFooter.js +11 -19
- package/dist/es2019/components/picker/styles.js +16 -14
- package/dist/es2019/components/uploader/EmojiUploadComponent.js +81 -91
- package/dist/es2019/hooks/useEmojiContext.js +3 -0
- package/dist/es2019/hooks/usePrevious.js +8 -0
- package/dist/es2019/index.js +4 -1
- package/dist/es2019/util/constants.js +1 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/common/CachingEmoji.js +86 -156
- package/dist/esm/components/common/Emoji.js +2 -2
- package/dist/esm/components/common/EmojiActions.js +129 -176
- package/dist/esm/components/common/EmojiErrorMessage.js +21 -56
- package/dist/esm/components/common/EmojiPreviewComponent.js +1 -0
- package/dist/esm/components/common/EmojiUploadPicker.js +233 -299
- package/dist/esm/components/common/FileChooser.js +34 -70
- package/dist/esm/components/common/Popup.js +104 -155
- package/dist/esm/components/common/ResourcedEmojiComponent.js +8 -4
- package/dist/esm/components/common/RetryableButton.js +40 -60
- package/dist/esm/components/common/ToneSelector.js +50 -87
- package/dist/esm/components/common/styles.js +10 -10
- package/dist/esm/components/hooks.js +8 -0
- package/dist/esm/components/picker/EmojiPickerCategoryHeading.js +14 -43
- package/dist/esm/components/picker/EmojiPickerComponent.js +486 -526
- package/dist/esm/components/picker/EmojiPickerEmojiRow.js +31 -59
- package/dist/esm/components/picker/EmojiPickerFooter.js +14 -47
- package/dist/esm/components/picker/styles.js +16 -14
- package/dist/esm/components/uploader/EmojiUploadComponent.js +119 -113
- package/dist/esm/hooks/useEmojiContext.js +5 -0
- package/dist/esm/hooks/usePrevious.js +8 -0
- package/dist/esm/index.js +4 -1
- package/dist/esm/util/constants.js +1 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/api/EmojiResource.d.ts +2 -3
- package/dist/types/components/common/CachingEmoji.d.ts +3 -13
- package/dist/types/components/common/Emoji.d.ts +1 -2
- package/dist/types/components/common/EmojiActions.d.ts +6 -17
- package/dist/types/components/common/EmojiErrorMessage.d.ts +3 -6
- package/dist/types/components/common/EmojiPreviewComponent.d.ts +2 -2
- package/dist/types/components/common/EmojiUploadPicker.d.ts +3 -27
- package/dist/types/components/common/FileChooser.d.ts +3 -5
- package/dist/types/components/common/LoadingEmojiComponent.d.ts +3 -0
- package/dist/types/components/common/Popup.d.ts +3 -20
- package/dist/types/components/common/ResourcedEmojiComponent.d.ts +23 -11
- package/dist/types/components/common/RetryableButton.d.ts +3 -7
- package/dist/types/components/common/ToneSelector.d.ts +4 -10
- package/dist/types/components/common/setSkinToneAriaLabelText.d.ts +1 -1
- package/dist/types/components/common/styles.d.ts +1 -3
- package/dist/types/components/hooks.d.ts +1 -0
- package/dist/types/components/picker/CategorySelector.d.ts +1 -1
- package/dist/types/components/picker/EmojiPicker.d.ts +12 -3
- package/dist/types/components/picker/EmojiPickerCategoryHeading.d.ts +3 -4
- package/dist/types/components/picker/EmojiPickerComponent.d.ts +14 -76
- package/dist/types/components/picker/EmojiPickerEmojiRow.d.ts +3 -4
- package/dist/types/components/picker/EmojiPickerFooter.d.ts +3 -5
- package/dist/types/components/picker/styles.d.ts +1 -1
- package/dist/types/components/typeahead/EmojiTypeAheadComponent.d.ts +18 -0
- package/dist/types/components/uploader/EmojiUploadComponent.d.ts +3 -17
- package/dist/types/components/uploader/EmojiUploader.d.ts +5 -7
- package/dist/types/hooks/useEmojiContext.d.ts +1 -0
- package/dist/types/hooks/usePrevious.d.ts +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/types.d.ts +2 -1
- package/dist/types/util/constants.d.ts +1 -0
- package/docs/0-intro.tsx +35 -27
- package/docs/1-resourced-emoji.tsx +74 -0
- package/docs/2-emoji-picker.tsx +56 -0
- package/docs/3-typeahead.tsx +20 -0
- package/docs/4-emoji-provider.tsx +98 -0
- package/local-config-example.ts +3 -1
- package/package.json +19 -6
- package/dist/cjs/components/common/EmojiPreview.js +0 -194
- package/dist/es2019/components/common/EmojiPreview.js +0 -152
- package/dist/esm/components/common/EmojiPreview.js +0 -170
- package/dist/types/components/common/EmojiPreview.d.ts +0 -31
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { MessageDescriptor, WrappedComponentProps } from 'react-intl-next';
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
3
|
import { EmojiUpload, Message } from '../../types';
|
|
5
|
-
import { UploadStatus } from './internal-types';
|
|
6
4
|
export interface OnUploadEmoji {
|
|
7
|
-
(upload: EmojiUpload, retry: boolean): void;
|
|
5
|
+
(upload: EmojiUpload, retry: boolean, onSuccessHandler?: () => void): void;
|
|
8
6
|
}
|
|
9
7
|
export interface Props {
|
|
10
8
|
onUploadEmoji: OnUploadEmoji;
|
|
@@ -13,29 +11,7 @@ export interface Props {
|
|
|
13
11
|
errorMessage?: Message;
|
|
14
12
|
initialUploadName?: string;
|
|
15
13
|
}
|
|
16
|
-
|
|
17
|
-
previewImage?: string;
|
|
18
|
-
name?: string;
|
|
19
|
-
filename?: string;
|
|
20
|
-
uploadStatus?: UploadStatus;
|
|
21
|
-
chooseEmojiErrorMessage?: MessageDescriptor;
|
|
22
|
-
}
|
|
23
|
-
export declare class EmojiUploadPicker extends PureComponent<Props & WrappedComponentProps, State> {
|
|
24
|
-
state: State;
|
|
25
|
-
constructor(props: Props & WrappedComponentProps);
|
|
26
|
-
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
27
|
-
private onNameChange;
|
|
28
|
-
private onAddEmoji;
|
|
29
|
-
private errorOnUpload;
|
|
30
|
-
private onFileLoad;
|
|
31
|
-
private cancelChooseFile;
|
|
32
|
-
private onChooseFile;
|
|
33
|
-
clearUploadPicker: () => void;
|
|
34
|
-
render(): JSX.Element;
|
|
35
|
-
}
|
|
36
|
-
declare const _default: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<Props & WrappedComponentProps<"intl">>, "intl"> & {
|
|
37
|
-
forwardedRef?: React.Ref<any> | undefined;
|
|
38
|
-
} & React.RefAttributes<any>> & {
|
|
14
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
39
15
|
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
40
16
|
};
|
|
41
17
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC, ChangeEventHandler } from 'react';
|
|
2
2
|
export interface Props {
|
|
3
3
|
label: string;
|
|
4
4
|
ariaDescribedBy?: string;
|
|
@@ -7,7 +7,5 @@ export interface Props {
|
|
|
7
7
|
accept?: string;
|
|
8
8
|
isDisabled?: boolean;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
render(): JSX.Element;
|
|
13
|
-
}
|
|
10
|
+
declare const FileChooser: FC<Props>;
|
|
11
|
+
export default FileChooser;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactElement, FC } from 'react';
|
|
2
2
|
import { RelativePosition } from '../../types';
|
|
3
3
|
export interface Props {
|
|
4
4
|
target: string | Element;
|
|
@@ -8,22 +8,5 @@ export interface Props {
|
|
|
8
8
|
zIndex?: string | number;
|
|
9
9
|
children: ReactElement<any>;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
private debounced;
|
|
14
|
-
static defaultProps: {
|
|
15
|
-
relativePosition: string;
|
|
16
|
-
offsetX: number;
|
|
17
|
-
offsetY: number;
|
|
18
|
-
zIndex: number;
|
|
19
|
-
};
|
|
20
|
-
componentDidMount(): void;
|
|
21
|
-
componentDidUpdate(): void;
|
|
22
|
-
componentWillUnmount(): void;
|
|
23
|
-
applyBelowPosition(): void;
|
|
24
|
-
applyAbovePosition(): void;
|
|
25
|
-
applyAbsolutePosition(): void;
|
|
26
|
-
private handleResize;
|
|
27
|
-
renderContent(): void;
|
|
28
|
-
render(): JSX.Element;
|
|
29
|
-
}
|
|
11
|
+
declare const Popup: FC<Props>;
|
|
12
|
+
export default Popup;
|
|
@@ -1,36 +1,48 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { EmojiId
|
|
4
|
-
import { State as LoadingState } from './LoadingEmojiComponent';
|
|
2
|
+
import { EmojiResource } from '../../api/EmojiResource';
|
|
3
|
+
import { EmojiId } from '../../types';
|
|
5
4
|
export interface BaseResourcedEmojiProps {
|
|
5
|
+
/**
|
|
6
|
+
* Emoji to display
|
|
7
|
+
*/
|
|
6
8
|
emojiId: EmojiId;
|
|
9
|
+
/**
|
|
10
|
+
* Allows to show the tooltip.
|
|
11
|
+
* Defaults to `false`.
|
|
12
|
+
*/
|
|
7
13
|
showTooltip?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Scales the emoji proportionally to provided hight.
|
|
16
|
+
* Defaults to `undefined`.
|
|
17
|
+
*/
|
|
8
18
|
fitToHeight?: number;
|
|
9
19
|
/**
|
|
10
20
|
* Optimistic will call the fetch interface first and not wait for the entire emoji collection
|
|
11
21
|
* to be available before rendering. This is useful for views or pages that show a select set of
|
|
12
22
|
* emojis.
|
|
23
|
+
* Defaults to `false`.
|
|
13
24
|
*/
|
|
14
25
|
optimistic?: boolean;
|
|
15
26
|
/**
|
|
16
27
|
* Custom Fallback allows a custom element or string to be rendered if an emoji fails to be fetched or found.
|
|
17
28
|
* By default it takes the fallback or shortName inside emojiId, but if this prop is set it override the internal
|
|
18
29
|
* fallbacks
|
|
19
|
-
*
|
|
20
|
-
*
|
|
30
|
+
* customFallback<Element | string> else emojiId.fallback else emojiId.shortName.
|
|
31
|
+
* Defaults to `undefined`.
|
|
21
32
|
*/
|
|
22
33
|
customFallback?: JSX.Element | string;
|
|
23
34
|
/**
|
|
24
35
|
* Will attempt to render a highly condensed version of the emoji with an image url before showing the meta version.
|
|
25
|
-
* All
|
|
36
|
+
* All that is required for optimistic images to render is an emojiId, imageUrl and sizing props.
|
|
37
|
+
* Defaults to `undefined`.
|
|
26
38
|
*/
|
|
27
39
|
optimisticImageURL?: string;
|
|
28
40
|
}
|
|
29
41
|
export interface Props extends BaseResourcedEmojiProps {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
loaded: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* EmojiResource instance that handles fetching of emoji data.
|
|
44
|
+
*/
|
|
45
|
+
emojiProvider: EmojiResource;
|
|
35
46
|
}
|
|
36
47
|
export declare const ResourcedEmojiComponent: FC<Props>;
|
|
48
|
+
export default ResourcedEmojiComponent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
export interface Props {
|
|
3
3
|
label: string;
|
|
4
4
|
appearance: string;
|
|
@@ -6,9 +6,5 @@ export interface Props {
|
|
|
6
6
|
onSubmit: () => void;
|
|
7
7
|
loading: boolean;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
renderLoading(): JSX.Element;
|
|
12
|
-
renderRetry(): JSX.Element;
|
|
13
|
-
render(): JSX.Element;
|
|
14
|
-
}
|
|
9
|
+
declare const RetryableButton: FC<Props>;
|
|
10
|
+
export default RetryableButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
2
|
import { EmojiDescriptionWithVariations, OnToneSelected } from '../../types';
|
|
3
3
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
4
4
|
export interface Props {
|
|
@@ -6,13 +6,7 @@ export interface Props {
|
|
|
6
6
|
onToneSelected: OnToneSelected;
|
|
7
7
|
previewEmojiId?: string;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
UNSAFE_componentWillMount(): void;
|
|
13
|
-
firstToneButtonRef: React.RefObject<HTMLButtonElement>;
|
|
14
|
-
private onToneSelectedHandler;
|
|
15
|
-
render(): JSX.Element;
|
|
16
|
-
}
|
|
17
|
-
declare const ToneSelector: React.ForwardRefExoticComponent<Omit<Props & WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
9
|
+
declare type PropsWithAnalyticsEventsPropsType = Props & WithAnalyticsEventsProps;
|
|
10
|
+
export declare const ToneSelectorInternal: FC<PropsWithAnalyticsEventsPropsType>;
|
|
11
|
+
declare const ToneSelector: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<PropsWithAnalyticsEventsPropsType>, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
18
12
|
export default ToneSelector;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const setSkinToneAriaLabelText: (tone
|
|
1
|
+
export declare const setSkinToneAriaLabelText: (tone?: string | undefined) => string | undefined;
|
|
@@ -14,15 +14,12 @@ export declare const placeholderContainer: import("@emotion/utils").SerializedSt
|
|
|
14
14
|
export declare const placeholderContainerAnimated: import("@emotion/utils").SerializedStyles;
|
|
15
15
|
export declare const emojiButton: import("@emotion/utils").SerializedStyles;
|
|
16
16
|
export declare const hiddenToneButton: import("@emotion/utils").SerializedStyles;
|
|
17
|
-
export declare const buttons = "emoji-common-buttons";
|
|
18
|
-
export declare const toneSelectorContainer = "emoji-common-tone-selector-container";
|
|
19
17
|
export declare const emojiPickerAddEmoji = "emoji-picker-add-emoji";
|
|
20
18
|
export declare const previewText: import("@emotion/utils").SerializedStyles;
|
|
21
19
|
export declare const emojiName: import("@emotion/utils").SerializedStyles;
|
|
22
20
|
export declare const emojiShortName: import("@emotion/utils").SerializedStyles;
|
|
23
21
|
export declare const preview: import("@emotion/utils").SerializedStyles;
|
|
24
22
|
export declare const previewImg: import("@emotion/utils").SerializedStyles;
|
|
25
|
-
export declare const emojiPreview: import("@emotion/utils").SerializedStyles;
|
|
26
23
|
export declare const emojiScrollable: import("@emotion/utils").SerializedStyles;
|
|
27
24
|
export declare const emojiUpload: import("@emotion/utils").SerializedStyles;
|
|
28
25
|
export declare const uploadChooseFileMessage: import("@emotion/utils").SerializedStyles;
|
|
@@ -49,3 +46,4 @@ export declare const uploadRetryButton: import("@emotion/utils").SerializedStyle
|
|
|
49
46
|
export declare const uploadEmojiButton: import("@emotion/utils").SerializedStyles;
|
|
50
47
|
export declare const cancelButton: import("@emotion/utils").SerializedStyles;
|
|
51
48
|
export declare const buttonSpinner: import("@emotion/utils").SerializedStyles;
|
|
49
|
+
export declare const emojiActionsWrapper: import("@emotion/utils").SerializedStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useDidMount(): boolean;
|
|
@@ -4,7 +4,7 @@ import { CategoryDescription, OnCategory } from '../../types';
|
|
|
4
4
|
import { CategoryGroupKey, CategoryId } from './categories';
|
|
5
5
|
export interface Props {
|
|
6
6
|
dynamicCategories?: CategoryId[];
|
|
7
|
-
activeCategoryId?: CategoryId;
|
|
7
|
+
activeCategoryId?: CategoryId | null;
|
|
8
8
|
disableCategories?: boolean;
|
|
9
9
|
onCategorySelected?: OnCategory;
|
|
10
10
|
}
|
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
2
|
-
import { ComponentClass } from 'react';
|
|
2
|
+
import { ComponentClass, FC } from 'react';
|
|
3
3
|
import { EmojiProvider } from '../../api/EmojiResource';
|
|
4
4
|
import { OnEmojiEvent } from '../../types';
|
|
5
5
|
import LoadingEmojiComponent, { Props as LoadingProps, State as LoadingState } from '../common/LoadingEmojiComponent';
|
|
6
6
|
import { PickerRefHandler, Props as ComponentProps } from './EmojiPickerComponent';
|
|
7
7
|
export interface Props extends LoadingProps {
|
|
8
|
+
/**
|
|
9
|
+
* Callback to be executed on emoji selection.
|
|
10
|
+
*/
|
|
8
11
|
onSelection?: OnEmojiEvent;
|
|
12
|
+
/**
|
|
13
|
+
* Callback to handle picker reference.
|
|
14
|
+
*/
|
|
9
15
|
onPickerRef?: PickerRefHandler;
|
|
16
|
+
/**
|
|
17
|
+
* Flag to disable tone selector.
|
|
18
|
+
*/
|
|
10
19
|
hideToneSelector?: boolean;
|
|
11
20
|
}
|
|
12
21
|
export declare class EmojiPickerInternal extends LoadingEmojiComponent<Props & WithAnalyticsEventsProps, LoadingState> {
|
|
13
|
-
static AsyncLoadedComponent?:
|
|
22
|
+
static AsyncLoadedComponent?: FC<ComponentProps>;
|
|
14
23
|
state: {
|
|
15
|
-
asyncLoadedComponent:
|
|
24
|
+
asyncLoadedComponent: FC<ComponentProps> | undefined;
|
|
16
25
|
};
|
|
17
26
|
constructor(props: Props);
|
|
18
27
|
asyncLoadComponent(): void;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
export interface Props {
|
|
3
3
|
id: string;
|
|
4
4
|
title: string;
|
|
5
5
|
className?: string;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
7
|
+
declare const EmojiPickerCategoryHeading: FC<Props>;
|
|
8
|
+
export default EmojiPickerCategoryHeading;
|
|
@@ -1,90 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
import { MessageDescriptor } from 'react-intl-next';
|
|
1
|
+
/// <reference types="react" />
|
|
3
2
|
import { EmojiProvider } from '../../api/EmojiResource';
|
|
4
|
-
import {
|
|
5
|
-
import { CategoryId } from './categories';
|
|
3
|
+
import { OnEmojiEvent } from '../../types';
|
|
6
4
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
5
|
export interface PickerRefHandler {
|
|
8
6
|
(ref: any): any;
|
|
9
7
|
}
|
|
10
8
|
export interface Props {
|
|
9
|
+
/**
|
|
10
|
+
* EmojiResource instance that handles emoji meta data.
|
|
11
|
+
*/
|
|
11
12
|
emojiProvider: EmojiProvider;
|
|
12
|
-
onSelection?: OnEmojiEvent;
|
|
13
|
-
onPickerRef?: PickerRefHandler;
|
|
14
|
-
hideToneSelector?: boolean;
|
|
15
|
-
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
16
|
-
}
|
|
17
|
-
export interface State {
|
|
18
|
-
filteredEmojis: EmojiDescription[];
|
|
19
|
-
searchEmojis: EmojiDescription[];
|
|
20
|
-
frequentlyUsedEmojis?: EmojiDescription[];
|
|
21
|
-
selectedEmoji?: EmojiDescription;
|
|
22
|
-
activeCategory?: CategoryId;
|
|
23
|
-
disableCategories?: boolean;
|
|
24
|
-
dynamicCategories: CategoryId[];
|
|
25
|
-
selectedTone?: ToneSelection;
|
|
26
|
-
toneEmoji?: OptionalEmojiDescriptionWithVariations;
|
|
27
|
-
query: string;
|
|
28
|
-
uploadErrorMessage?: MessageDescriptor;
|
|
29
|
-
uploadSupported: boolean;
|
|
30
|
-
uploading: boolean;
|
|
31
|
-
emojiToDelete?: EmojiDescription;
|
|
32
|
-
loading: boolean;
|
|
33
|
-
}
|
|
34
|
-
export default class EmojiPickerComponent extends PureComponent<Props, State> {
|
|
35
|
-
static defaultProps: {
|
|
36
|
-
onSelection: () => void;
|
|
37
|
-
};
|
|
38
|
-
constructor(props: Props);
|
|
39
|
-
openTime: number;
|
|
40
|
-
UNSAFE_componentWillMount(): void;
|
|
41
|
-
componentDidMount(): void;
|
|
42
|
-
componentWillUnmount(): void;
|
|
43
|
-
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
44
|
-
componentDidUpdate(prevProps: Props): void;
|
|
45
|
-
onEmojiActive: (_emojiId: EmojiId, emoji?: EmojiDescription | undefined) => void;
|
|
46
|
-
onCategoryActivated: (category: CategoryId | null) => void;
|
|
47
|
-
onCategorySelected: (categoryId: CategoryId | null) => void;
|
|
48
|
-
onFileChooserClicked: () => void;
|
|
49
|
-
private fireAnalytics;
|
|
50
|
-
private calculateElapsedTime;
|
|
51
|
-
private onUploadSupported;
|
|
52
|
-
private onSearch;
|
|
53
|
-
private onSearchResult;
|
|
54
|
-
private onFrequentEmojiResult;
|
|
55
13
|
/**
|
|
56
|
-
*
|
|
57
|
-
* also include a special category of most frequently used emoji (if there are any). This method decides if we are in this 'no search'
|
|
58
|
-
* state and appends the frequent emoji if necessary.
|
|
59
|
-
*
|
|
60
|
-
* @param searchEmoji the emoji last received from the EmojiRepository after a search (may be empty)
|
|
61
|
-
* @param frequentEmoji the frequently used emoji last received from the EmojiRepository (may be empty)
|
|
14
|
+
* Callback to be executed when user selects an emoji.
|
|
62
15
|
*/
|
|
63
|
-
|
|
16
|
+
onSelection?: OnEmojiEvent;
|
|
64
17
|
/**
|
|
65
|
-
*
|
|
66
|
-
* or the frequently used emoji have updated.)
|
|
18
|
+
* Callback performed when picker reference is being set.
|
|
67
19
|
*/
|
|
68
|
-
|
|
69
|
-
private onDynamicCategoryChange;
|
|
70
|
-
private onProviderChange;
|
|
71
|
-
private onToneSelected;
|
|
72
|
-
private onToneSelectorCancelled;
|
|
20
|
+
onPickerRef?: PickerRefHandler;
|
|
73
21
|
/**
|
|
74
|
-
*
|
|
75
|
-
* by category, in the picker. This differs from when there is a query in which case we expect to receive a sorted result matching
|
|
76
|
-
* the search.
|
|
22
|
+
* Flag to disable tone selector.
|
|
77
23
|
*/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
private onUploadEmoji;
|
|
81
|
-
private onTriggerDelete;
|
|
82
|
-
private onCloseDelete;
|
|
83
|
-
private onDeleteEmoji;
|
|
84
|
-
private scrollToEndOfList;
|
|
85
|
-
private onUploadCancelled;
|
|
86
|
-
private getDynamicCategories;
|
|
87
|
-
private handlePickerRef;
|
|
88
|
-
private onSelectWrapper;
|
|
89
|
-
render(): JSX.Element;
|
|
24
|
+
hideToneSelector?: boolean;
|
|
25
|
+
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
90
26
|
}
|
|
27
|
+
declare const _default: import("react").MemoExoticComponent<({ emojiProvider, onSelection, onPickerRef, hideToneSelector, createAnalyticsEvent, }: Props) => JSX.Element>;
|
|
28
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { EmojiDescription, OnEmojiEvent } from '../../types';
|
|
3
3
|
export interface Props {
|
|
4
4
|
emojis: EmojiDescription[];
|
|
@@ -8,6 +8,5 @@ export interface Props {
|
|
|
8
8
|
onMouseMove?: OnEmojiEvent;
|
|
9
9
|
onDelete?: OnEmojiEvent;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
11
|
+
declare const _default: import("react").NamedExoticComponent<Props>;
|
|
12
|
+
export default _default;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { EmojiDescription } from '../../types';
|
|
3
3
|
export interface Props {
|
|
4
4
|
selectedEmoji?: EmojiDescription;
|
|
5
|
-
isUploading: boolean;
|
|
6
|
-
}
|
|
7
|
-
export default class EmojiPickerFooter extends PureComponent<Props, {}> {
|
|
8
|
-
render(): JSX.Element | null;
|
|
9
5
|
}
|
|
6
|
+
declare const _default: import("react").MemoExoticComponent<({ selectedEmoji }: Props) => JSX.Element>;
|
|
7
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const emojiPicker: import("@emotion/utils").SerializedStyles;
|
|
1
|
+
export declare const emojiPicker: (hasPreview?: boolean | undefined) => import("@emotion/utils").SerializedStyles;
|
|
2
2
|
export declare const addButton = "emoji-picker-add-button";
|
|
3
3
|
export declare const categorySelector: import("@emotion/utils").SerializedStyles;
|
|
4
4
|
export declare const active: import("@emotion/utils").SerializedStyles;
|
|
@@ -6,14 +6,32 @@ export interface OnLifecycle {
|
|
|
6
6
|
(): void;
|
|
7
7
|
}
|
|
8
8
|
export interface EmojiTypeAheadBaseProps {
|
|
9
|
+
/**
|
|
10
|
+
* Callback to be executed when user selects an emoji.
|
|
11
|
+
*/
|
|
9
12
|
onSelection?: OnEmojiEvent;
|
|
13
|
+
/**
|
|
14
|
+
* Search query.
|
|
15
|
+
*/
|
|
10
16
|
query?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Number of results to be displayed in the search results list
|
|
19
|
+
*/
|
|
11
20
|
listLimit?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Callback to be executed when typeahead component is being shown
|
|
23
|
+
*/
|
|
12
24
|
onOpen?: OnLifecycle;
|
|
25
|
+
/**
|
|
26
|
+
* Callback to be executed when typeahead component disappears
|
|
27
|
+
*/
|
|
13
28
|
onClose?: OnLifecycle;
|
|
14
29
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
15
30
|
}
|
|
16
31
|
export interface Props extends EmojiTypeAheadBaseProps {
|
|
32
|
+
/**
|
|
33
|
+
* EmojiResource instance that handles fetching of emoji data.
|
|
34
|
+
*/
|
|
17
35
|
emojiProvider: EmojiProvider;
|
|
18
36
|
}
|
|
19
37
|
export interface State {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { MessageDescriptor } from 'react-intl-next';
|
|
1
|
+
/// <reference types="react" />
|
|
3
2
|
import { EmojiProvider } from '../../api/EmojiResource';
|
|
4
3
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
4
|
export interface UploadRefHandler {
|
|
@@ -10,18 +9,5 @@ export interface Props {
|
|
|
10
9
|
onUploaderRef?: UploadRefHandler;
|
|
11
10
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
12
11
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
export default class EmojiUploadComponent extends PureComponent<Props, State> {
|
|
17
|
-
private ref?;
|
|
18
|
-
constructor(props: Props);
|
|
19
|
-
componentWillUnmount(): void;
|
|
20
|
-
private onUploadEmoji;
|
|
21
|
-
private prepareForUpload;
|
|
22
|
-
onFileChooserClicked: () => void;
|
|
23
|
-
private onUploadCancelled;
|
|
24
|
-
private onUploaderRef;
|
|
25
|
-
private fireAnalytics;
|
|
26
|
-
render(): JSX.Element;
|
|
27
|
-
}
|
|
12
|
+
declare const _default: import("react").NamedExoticComponent<Props>;
|
|
13
|
+
export default _default;
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ComponentClass } from 'react';
|
|
1
|
+
import React, { FC } from 'react';
|
|
3
2
|
import LoadingEmojiComponent, { Props as LoadingProps, State as LoadingState } from '../common/LoadingEmojiComponent';
|
|
4
|
-
import {
|
|
3
|
+
import { Props as ComponentProps } from './EmojiUploadComponent';
|
|
5
4
|
import { EmojiProvider } from '../../api/EmojiResource';
|
|
6
5
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
6
|
export interface Props extends LoadingProps {
|
|
8
|
-
onUploaderRef?: UploadRefHandler;
|
|
9
7
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
10
8
|
}
|
|
11
9
|
export declare class EmojiUploaderInternal extends LoadingEmojiComponent<Props, LoadingState> {
|
|
12
|
-
static AsyncLoadedComponent?:
|
|
10
|
+
static AsyncLoadedComponent?: FC<ComponentProps>;
|
|
13
11
|
state: {
|
|
14
|
-
asyncLoadedComponent: React.
|
|
12
|
+
asyncLoadedComponent: React.FC<ComponentProps> | undefined;
|
|
15
13
|
};
|
|
16
14
|
constructor(props: Props);
|
|
17
15
|
asyncLoadComponent(): void;
|
|
18
|
-
renderLoaded(loadedEmojiProvider: EmojiProvider, EmojiUploadComponent:
|
|
16
|
+
renderLoaded(loadedEmojiProvider: EmojiProvider, EmojiUploadComponent: FC<ComponentProps>): JSX.Element;
|
|
19
17
|
}
|
|
20
18
|
declare type EmojiUploader = EmojiUploaderInternal;
|
|
21
19
|
declare const EmojiUploader: React.ForwardRefExoticComponent<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useEmojiContext: () => import("../context/EmojiContext").EmojiContextType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function usePrevious<T>(value: T | null | undefined): T | null | undefined;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -16,7 +16,9 @@ import { toEmojiId, toOptionalEmojiId } from './util/type-helpers';
|
|
|
16
16
|
import { recordSelectionFailedSli, recordSelectionSucceededSli, ufoExperiences, withSampling, WithSamplingUFOExperience } from './util/analytics';
|
|
17
17
|
import { customCategory, defaultEmojiHeight, emojiPickerWidth, emojiPickerHeight } from './util/constants';
|
|
18
18
|
import { UsageFrequencyTracker } from './api/internal/UsageFrequencyTracker';
|
|
19
|
-
|
|
19
|
+
import { useEmojiContext } from './hooks/useEmojiContext';
|
|
20
|
+
import { EmojiContextProvider } from './context/EmojiContextProvider';
|
|
21
|
+
export { AbstractResource, Emoji, EmojiPlaceholder, EmojiLoader, EmojiPicker, EmojiUploader, EmojiResource, EmojiRepository, EmojiTypeAhead, EmojiImage, ResourcedEmoji, EmojiContextProvider, useEmojiContext, denormaliseEmojiServiceResponse, toEmojiId, toOptionalEmojiId, recordSelectionFailedSli, recordSelectionSucceededSli, ufoExperiences, withSampling, emojiPickerWidth, emojiPickerHeight, defaultEmojiHeight, customCategory, UsageFrequencyTracker, EmojiTypeAheadItem, };
|
|
20
22
|
export type { EmojiProvider, UploadingEmojiProvider, EmojiResourceConfig, WithSamplingUFOExperience, };
|
|
21
23
|
export { SearchSort, UfoExperienceName, UfoComponentName, } from './types';
|
|
22
24
|
export type { CategoryId, EmojiRepresentation, EmojiServiceRepresentation, Message, OptionalEmojiDescription, OptionalEmojiDescriptionWithVariations, OptionalUser, RelativePosition, ToneSelection, AltRepresentations, CategoryDescription, EmojiDescription, EmojiDescriptionWithVariations, EmojiId, EmojiImageRepresentation, EmojiMeta, EmojiResponse, EmojiSearchResult, EmojiServiceDescription, EmojiServiceDescriptionWithVariations, EmojiServiceResponse, EmojiUpload, EmojiVariationDescription, ImageRepresentation, MediaApiRepresentation, MediaApiToken, OnCategory, OnEmojiEvent, OnToneSelected, OnToneSelectorCancelled, SearchOptions, SpriteImageRepresentation, SpriteRepresentation, SpriteServiceRepresentation, SpriteSheet, SpriteSheets, Styles, User, } from './types';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -272,7 +272,7 @@ export interface CategoryDescription {
|
|
|
272
272
|
order: number;
|
|
273
273
|
}
|
|
274
274
|
export interface OnToneSelected {
|
|
275
|
-
(variation:
|
|
275
|
+
(variation: ToneValueType): void;
|
|
276
276
|
}
|
|
277
277
|
export interface OnToneSelectorCancelled {
|
|
278
278
|
(): void;
|
|
@@ -348,3 +348,4 @@ export declare enum UfoEmojiTimings {
|
|
|
348
348
|
ONLOAD_START = "emoji-onload_start",
|
|
349
349
|
ONLOAD_END = "emoji-onload_end"
|
|
350
350
|
}
|
|
351
|
+
export declare type ToneValueType = number;
|
|
@@ -14,6 +14,7 @@ export declare const MAX_ORDINAL = 100000;
|
|
|
14
14
|
export declare const defaultEmojiHeight = 20;
|
|
15
15
|
export declare const emojiPickerWidth = 350;
|
|
16
16
|
export declare const emojiPickerHeight = 295;
|
|
17
|
+
export declare const emojiPickerHeightWithPreview = 348;
|
|
17
18
|
export declare const localStoragePrefix = "fabric.emoji";
|
|
18
19
|
export declare const selectedToneStorageKey: string;
|
|
19
20
|
export declare const defaultCategories: CategoryId[];
|