@atlaskit/emoji 65.2.0 → 66.0.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 +12 -0
- package/admin/package.json +8 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/types.d.ts +6 -0
- package/dist/types-ts4.0/admin.d.ts +1 -0
- package/dist/types-ts4.0/api/EmojiLoader.d.ts +13 -0
- package/dist/types-ts4.0/api/EmojiRepository.d.ts +72 -0
- package/dist/types-ts4.0/api/EmojiRepositoryRegex.d.ts +1 -0
- package/dist/types-ts4.0/api/EmojiResource.d.ts +123 -0
- package/dist/types-ts4.0/api/EmojiUtils.d.ts +24 -0
- package/dist/types-ts4.0/api/internal/Comparators.d.ts +109 -0
- package/dist/types-ts4.0/api/internal/UsageFrequencyTracker.d.ts +46 -0
- package/dist/types-ts4.0/api/media/MediaEmojiCache.d.ts +53 -0
- package/dist/types-ts4.0/api/media/MediaImageLoader.d.ts +21 -0
- package/dist/types-ts4.0/api/media/SiteEmojiResource.d.ts +46 -0
- package/dist/types-ts4.0/api/media/TokenManager.d.ts +13 -0
- package/dist/types-ts4.0/components/common/CachingEmoji.d.ts +20 -0
- package/dist/types-ts4.0/components/common/DeleteButton.d.ts +4 -0
- package/dist/types-ts4.0/components/common/Emoji.d.ts +56 -0
- package/dist/types-ts4.0/components/common/EmojiActions.d.ts +31 -0
- package/dist/types-ts4.0/components/common/EmojiButton.d.ts +12 -0
- package/dist/types-ts4.0/components/common/EmojiDeletePreview.d.ts +20 -0
- package/dist/types-ts4.0/components/common/EmojiErrorMessage.d.ts +10 -0
- package/dist/types-ts4.0/components/common/EmojiImage.d.ts +13 -0
- package/dist/types-ts4.0/components/common/EmojiPlaceholder.d.ts +11 -0
- package/dist/types-ts4.0/components/common/EmojiPreviewComponent.d.ts +7 -0
- package/dist/types-ts4.0/components/common/EmojiUploadPicker.d.ts +17 -0
- package/dist/types-ts4.0/components/common/EmojiUploadPreview.d.ts +16 -0
- package/dist/types-ts4.0/components/common/FileChooser.d.ts +11 -0
- package/dist/types-ts4.0/components/common/LoadingEmojiComponent.d.ts +32 -0
- package/dist/types-ts4.0/components/common/Popup.d.ts +12 -0
- package/dist/types-ts4.0/components/common/RecordSelectionDefault.d.ts +12 -0
- package/dist/types-ts4.0/components/common/ResourcedEmoji.d.ts +18 -0
- package/dist/types-ts4.0/components/common/ResourcedEmojiComponent.d.ts +48 -0
- package/dist/types-ts4.0/components/common/RetryableButton.d.ts +10 -0
- package/dist/types-ts4.0/components/common/Scrollable.d.ts +19 -0
- package/dist/types-ts4.0/components/common/ToneSelector.d.ts +12 -0
- package/dist/types-ts4.0/components/common/UfoErrorBoundary.d.ts +8 -0
- package/dist/types-ts4.0/components/common/UploadEmoji.d.ts +5 -0
- package/dist/types-ts4.0/components/common/internal-types.d.ts +11 -0
- package/dist/types-ts4.0/components/common/setSkinToneAriaLabelText.d.ts +1 -0
- package/dist/types-ts4.0/components/common/styles.d.ts +49 -0
- package/dist/types-ts4.0/components/hooks.d.ts +1 -0
- package/dist/types-ts4.0/components/i18n.d.ts +172 -0
- package/dist/types-ts4.0/components/picker/CategorySelector.d.ts +21 -0
- package/dist/types-ts4.0/components/picker/CategoryTracker.d.ts +17 -0
- package/dist/types-ts4.0/components/picker/EmojiPicker.d.ts +32 -0
- package/dist/types-ts4.0/components/picker/EmojiPickerCategoryHeading.d.ts +8 -0
- package/dist/types-ts4.0/components/picker/EmojiPickerComponent.d.ts +28 -0
- package/dist/types-ts4.0/components/picker/EmojiPickerEmojiRow.d.ts +12 -0
- package/dist/types-ts4.0/components/picker/EmojiPickerFooter.d.ts +7 -0
- package/dist/types-ts4.0/components/picker/EmojiPickerList.d.ts +72 -0
- package/dist/types-ts4.0/components/picker/EmojiPickerListSearch.d.ts +12 -0
- package/dist/types-ts4.0/components/picker/EmojiPickerSizes.d.ts +11 -0
- package/dist/types-ts4.0/components/picker/EmojiPickerVirtualItems.d.ts +41 -0
- package/dist/types-ts4.0/components/picker/categories.d.ts +7 -0
- package/dist/types-ts4.0/components/picker/styles.d.ts +18 -0
- package/dist/types-ts4.0/components/typeahead/EmojiTypeAhead.d.ts +27 -0
- package/dist/types-ts4.0/components/typeahead/EmojiTypeAheadComponent.d.ts +72 -0
- package/dist/types-ts4.0/components/typeahead/EmojiTypeAheadItem.d.ts +14 -0
- package/dist/types-ts4.0/components/typeahead/EmojiTypeAheadList.d.ts +35 -0
- package/dist/types-ts4.0/components/typeahead/styles.d.ts +10 -0
- package/dist/types-ts4.0/components/uploader/EmojiUploadComponent.d.ts +13 -0
- package/dist/types-ts4.0/components/uploader/EmojiUploader.d.ts +20 -0
- package/dist/types-ts4.0/components/uploader/styles.d.ts +2 -0
- package/dist/types-ts4.0/context/EmojiContext.d.ts +4 -0
- package/dist/types-ts4.0/context/EmojiContextProvider.d.ts +7 -0
- package/dist/types-ts4.0/context/LegacyEmojiContextProvider.d.ts +22 -0
- package/dist/types-ts4.0/element.d.ts +3 -0
- package/dist/types-ts4.0/hooks/useEmojiContext.d.ts +1 -0
- package/dist/types-ts4.0/hooks/usePrevious.d.ts +1 -0
- package/dist/types-ts4.0/i18n/cs.d.ts +43 -0
- package/dist/types-ts4.0/i18n/da.d.ts +43 -0
- package/dist/types-ts4.0/i18n/de.d.ts +43 -0
- package/dist/types-ts4.0/i18n/en.d.ts +33 -0
- package/dist/types-ts4.0/i18n/en_GB.d.ts +33 -0
- package/dist/types-ts4.0/i18n/en_ZZ.d.ts +43 -0
- package/dist/types-ts4.0/i18n/es.d.ts +43 -0
- package/dist/types-ts4.0/i18n/et.d.ts +39 -0
- package/dist/types-ts4.0/i18n/fi.d.ts +43 -0
- package/dist/types-ts4.0/i18n/fr.d.ts +43 -0
- package/dist/types-ts4.0/i18n/hu.d.ts +43 -0
- package/dist/types-ts4.0/i18n/index.d.ts +35 -0
- package/dist/types-ts4.0/i18n/is.d.ts +33 -0
- package/dist/types-ts4.0/i18n/it.d.ts +43 -0
- package/dist/types-ts4.0/i18n/ja.d.ts +43 -0
- package/dist/types-ts4.0/i18n/ko.d.ts +43 -0
- package/dist/types-ts4.0/i18n/languages.d.ts +27 -0
- package/dist/types-ts4.0/i18n/nb.d.ts +43 -0
- package/dist/types-ts4.0/i18n/nl.d.ts +43 -0
- package/dist/types-ts4.0/i18n/pl.d.ts +43 -0
- package/dist/types-ts4.0/i18n/pt_BR.d.ts +43 -0
- package/dist/types-ts4.0/i18n/pt_PT.d.ts +39 -0
- package/dist/types-ts4.0/i18n/ro.d.ts +33 -0
- package/dist/types-ts4.0/i18n/ru.d.ts +43 -0
- package/dist/types-ts4.0/i18n/sk.d.ts +39 -0
- package/dist/types-ts4.0/i18n/sv.d.ts +43 -0
- package/dist/types-ts4.0/i18n/th.d.ts +43 -0
- package/dist/types-ts4.0/i18n/tr.d.ts +43 -0
- package/dist/types-ts4.0/i18n/uk.d.ts +43 -0
- package/dist/types-ts4.0/i18n/vi.d.ts +43 -0
- package/dist/types-ts4.0/i18n/zh.d.ts +43 -0
- package/dist/types-ts4.0/i18n/zh_TW.d.ts +43 -0
- package/dist/types-ts4.0/index.d.ts +25 -0
- package/dist/types-ts4.0/picker.d.ts +1 -0
- package/dist/types-ts4.0/resource.d.ts +5 -0
- package/dist/types-ts4.0/typeahead.d.ts +2 -0
- package/dist/types-ts4.0/types.d.ts +357 -0
- package/dist/types-ts4.0/util/DuplicateLimitedQueue.d.ts +91 -0
- package/dist/types-ts4.0/util/StoredDuplicateLimitedQueue.d.ts +46 -0
- package/dist/types-ts4.0/util/analytics/analytics.d.ts +61 -0
- package/dist/types-ts4.0/util/analytics/index.d.ts +6 -0
- package/dist/types-ts4.0/util/analytics/samplingUfo.d.ts +31 -0
- package/dist/types-ts4.0/util/analytics/ufoExperiences.d.ts +14 -0
- package/dist/types-ts4.0/util/analytics/useSampledUFOComponentExperience.d.ts +8 -0
- package/dist/types-ts4.0/util/browser-support.d.ts +1 -0
- package/dist/types-ts4.0/util/constants.d.ts +25 -0
- package/dist/types-ts4.0/util/filters.d.ts +8 -0
- package/dist/types-ts4.0/util/image.d.ts +10 -0
- package/dist/types-ts4.0/util/logger.d.ts +4 -0
- package/dist/types-ts4.0/util/mouse.d.ts +8 -0
- package/dist/types-ts4.0/util/shared-styles.d.ts +11 -0
- package/dist/types-ts4.0/util/storage-available.d.ts +3 -0
- package/dist/types-ts4.0/util/type-helpers.d.ts +23 -0
- package/dist/types-ts4.0/util/useInView.d.ts +7 -0
- package/dist/types-ts4.0/utils.d.ts +3 -0
- package/element/package.json +8 -1
- package/package.json +15 -8
- package/picker/package.json +8 -1
- package/resource/package.json +8 -1
- package/typeahead/package.json +8 -1
- package/types/package.json +8 -1
- package/utils/package.json +8 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import { CategoryDescription, OnCategory } from '../../types';
|
|
4
|
+
import { CategoryGroupKey, CategoryId } from './categories';
|
|
5
|
+
export interface Props {
|
|
6
|
+
dynamicCategories?: CategoryId[];
|
|
7
|
+
activeCategoryId?: CategoryId | null;
|
|
8
|
+
disableCategories?: boolean;
|
|
9
|
+
onCategorySelected?: OnCategory;
|
|
10
|
+
}
|
|
11
|
+
export interface State {
|
|
12
|
+
categories: CategoryId[];
|
|
13
|
+
}
|
|
14
|
+
export declare type CategoryMap = {
|
|
15
|
+
[id: string]: CategoryDescription;
|
|
16
|
+
};
|
|
17
|
+
export declare const sortCategories: (c1: CategoryGroupKey, c2: CategoryGroupKey) => number;
|
|
18
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
19
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
20
|
+
};
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { List as VirtualList } from 'react-virtualized/dist/commonjs/List';
|
|
2
|
+
import { CategoryId } from './categories';
|
|
3
|
+
/**
|
|
4
|
+
* Mapping between CategoryId and row
|
|
5
|
+
*
|
|
6
|
+
* Tracks which category is visible based on
|
|
7
|
+
* scrollTop, and virtual rows.
|
|
8
|
+
*/
|
|
9
|
+
export default class CategoryTracker {
|
|
10
|
+
private categoryToRow;
|
|
11
|
+
private rowToCategory;
|
|
12
|
+
constructor();
|
|
13
|
+
reset(): void;
|
|
14
|
+
add(category: CategoryId, row: number): void;
|
|
15
|
+
getRow(category: CategoryId): number | undefined;
|
|
16
|
+
findNearestCategoryAbove(startIndex: number, list?: VirtualList): CategoryId | undefined;
|
|
17
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
2
|
+
import { ComponentClass, FC } from 'react';
|
|
3
|
+
import { EmojiProvider } from '../../api/EmojiResource';
|
|
4
|
+
import { OnEmojiEvent } from '../../types';
|
|
5
|
+
import LoadingEmojiComponent, { Props as LoadingProps, State as LoadingState } from '../common/LoadingEmojiComponent';
|
|
6
|
+
import { PickerRefHandler, Props as ComponentProps } from './EmojiPickerComponent';
|
|
7
|
+
export interface Props extends LoadingProps {
|
|
8
|
+
/**
|
|
9
|
+
* Callback to be executed on emoji selection.
|
|
10
|
+
*/
|
|
11
|
+
onSelection?: OnEmojiEvent;
|
|
12
|
+
/**
|
|
13
|
+
* Callback to handle picker reference.
|
|
14
|
+
*/
|
|
15
|
+
onPickerRef?: PickerRefHandler;
|
|
16
|
+
/**
|
|
17
|
+
* Flag to disable tone selector.
|
|
18
|
+
*/
|
|
19
|
+
hideToneSelector?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare class EmojiPickerInternal extends LoadingEmojiComponent<Props & WithAnalyticsEventsProps, LoadingState> {
|
|
22
|
+
static AsyncLoadedComponent?: FC<ComponentProps>;
|
|
23
|
+
state: {
|
|
24
|
+
asyncLoadedComponent: FC<ComponentProps> | undefined;
|
|
25
|
+
};
|
|
26
|
+
constructor(props: Props);
|
|
27
|
+
asyncLoadComponent(): void;
|
|
28
|
+
renderLoading(): JSX.Element | null;
|
|
29
|
+
renderLoaded(loadedEmojiProvider: EmojiProvider, EmojiPickerComponent: ComponentClass<ComponentProps>): JSX.Element;
|
|
30
|
+
}
|
|
31
|
+
declare const EmojiPicker: import("react").ForwardRefExoticComponent<Omit<Props & WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any>>;
|
|
32
|
+
export default EmojiPicker;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { EmojiProvider } from '../../api/EmojiResource';
|
|
3
|
+
import { OnEmojiEvent } from '../../types';
|
|
4
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
|
+
export interface PickerRefHandler {
|
|
6
|
+
(ref: any): any;
|
|
7
|
+
}
|
|
8
|
+
export interface Props {
|
|
9
|
+
/**
|
|
10
|
+
* EmojiResource instance that handles emoji meta data.
|
|
11
|
+
*/
|
|
12
|
+
emojiProvider: EmojiProvider;
|
|
13
|
+
/**
|
|
14
|
+
* Callback to be executed when user selects an emoji.
|
|
15
|
+
*/
|
|
16
|
+
onSelection?: OnEmojiEvent;
|
|
17
|
+
/**
|
|
18
|
+
* Callback performed when picker reference is being set.
|
|
19
|
+
*/
|
|
20
|
+
onPickerRef?: PickerRefHandler;
|
|
21
|
+
/**
|
|
22
|
+
* Flag to disable tone selector.
|
|
23
|
+
*/
|
|
24
|
+
hideToneSelector?: boolean;
|
|
25
|
+
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
26
|
+
}
|
|
27
|
+
declare const _default: import("react").MemoExoticComponent<({ emojiProvider, onSelection, onPickerRef, hideToneSelector, createAnalyticsEvent, }: Props) => JSX.Element>;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { EmojiDescription, OnEmojiEvent } from '../../types';
|
|
3
|
+
export interface Props {
|
|
4
|
+
emojis: EmojiDescription[];
|
|
5
|
+
title: string;
|
|
6
|
+
showDelete: boolean;
|
|
7
|
+
onSelected?: OnEmojiEvent;
|
|
8
|
+
onMouseMove?: OnEmojiEvent;
|
|
9
|
+
onDelete?: OnEmojiEvent;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import("react").NamedExoticComponent<Props>;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { EmojiDescription } from '../../types';
|
|
3
|
+
export interface Props {
|
|
4
|
+
selectedEmoji?: EmojiDescription;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import("react").MemoExoticComponent<({ selectedEmoji }: Props) => JSX.Element>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { PureComponent } from 'react';
|
|
2
|
+
import { EmojiDescription, EmojiDescriptionWithVariations, Message, OnCategory, OnEmojiEvent, OnToneSelected, OnToneSelectorCancelled, ToneSelection, User } from '../../types';
|
|
3
|
+
import { CategoryId } from './categories';
|
|
4
|
+
import { OnUploadEmoji } from '../common/EmojiUploadPicker';
|
|
5
|
+
import { OnDeleteEmoji } from '../common/EmojiDeletePreview';
|
|
6
|
+
export interface OnSearch {
|
|
7
|
+
(query: string): void;
|
|
8
|
+
}
|
|
9
|
+
export interface Props {
|
|
10
|
+
emojis: EmojiDescription[];
|
|
11
|
+
currentUser?: User;
|
|
12
|
+
onEmojiSelected?: OnEmojiEvent;
|
|
13
|
+
onEmojiActive?: OnEmojiEvent;
|
|
14
|
+
onEmojiDelete?: OnEmojiEvent;
|
|
15
|
+
onCategoryActivated?: OnCategory;
|
|
16
|
+
selectedTone?: ToneSelection;
|
|
17
|
+
onSearch?: OnSearch;
|
|
18
|
+
loading?: boolean;
|
|
19
|
+
query?: string;
|
|
20
|
+
initialUploadName?: string;
|
|
21
|
+
onToneSelected?: OnToneSelected;
|
|
22
|
+
onToneSelectorCancelled?: OnToneSelectorCancelled;
|
|
23
|
+
toneEmoji?: EmojiDescriptionWithVariations;
|
|
24
|
+
uploading: boolean;
|
|
25
|
+
emojiToDelete?: EmojiDescription;
|
|
26
|
+
uploadErrorMessage?: Message;
|
|
27
|
+
uploadEnabled: boolean;
|
|
28
|
+
onUploadEmoji: OnUploadEmoji;
|
|
29
|
+
onUploadCancelled: () => void;
|
|
30
|
+
onDeleteEmoji: OnDeleteEmoji;
|
|
31
|
+
onCloseDelete: () => void;
|
|
32
|
+
onFileChooserClicked?: () => void;
|
|
33
|
+
onOpenUpload: () => void;
|
|
34
|
+
}
|
|
35
|
+
export interface State {
|
|
36
|
+
}
|
|
37
|
+
export default class EmojiPickerVirtualList extends PureComponent<Props, State> {
|
|
38
|
+
static defaultProps: {
|
|
39
|
+
onEmojiSelected: () => void;
|
|
40
|
+
onEmojiActive: () => void;
|
|
41
|
+
onEmojiDelete: () => void;
|
|
42
|
+
onCategoryActivated: () => void;
|
|
43
|
+
onSearch: () => void;
|
|
44
|
+
};
|
|
45
|
+
private allEmojiGroups;
|
|
46
|
+
private activeCategoryId;
|
|
47
|
+
private virtualItems;
|
|
48
|
+
private categoryTracker;
|
|
49
|
+
constructor(props: Props);
|
|
50
|
+
UNSAFE_componentWillUpdate(nextProps: Props, nextState: State): void;
|
|
51
|
+
private onEmojiMouseEnter;
|
|
52
|
+
private onSearch;
|
|
53
|
+
/**
|
|
54
|
+
* Scrolls to a category in the list view
|
|
55
|
+
*/
|
|
56
|
+
reveal(category: CategoryId): void;
|
|
57
|
+
scrollToBottom(): void;
|
|
58
|
+
private buildVirtualItemFromGroup;
|
|
59
|
+
private buildVirtualItems;
|
|
60
|
+
private addToCategoryMap;
|
|
61
|
+
private groupByCategory;
|
|
62
|
+
private buildEmojiGroupedByCategory;
|
|
63
|
+
private repaintList;
|
|
64
|
+
/**
|
|
65
|
+
* Checks if list is showing a new CategoryId
|
|
66
|
+
* to inform selector to change active category
|
|
67
|
+
*/
|
|
68
|
+
private checkCategoryIdChange;
|
|
69
|
+
private rowSize;
|
|
70
|
+
private renderRow;
|
|
71
|
+
render(): JSX.Element;
|
|
72
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
+
import { Styles } from '../../types';
|
|
4
|
+
export interface Props {
|
|
5
|
+
style?: Styles;
|
|
6
|
+
query?: string;
|
|
7
|
+
onChange: any;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
10
|
+
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
11
|
+
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const sizes: {
|
|
2
|
+
listHeight: number;
|
|
3
|
+
listWidth: number;
|
|
4
|
+
searchHeight: number;
|
|
5
|
+
categoryHeadingHeight: number;
|
|
6
|
+
emojiRowHeight: number;
|
|
7
|
+
addEmojiHeight: number;
|
|
8
|
+
loadingRowHeight: number;
|
|
9
|
+
uploadActionHeight: number;
|
|
10
|
+
emojiPerRow: number;
|
|
11
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Props as CategoryHeadingProps } from './EmojiPickerCategoryHeading';
|
|
3
|
+
import { Props as EmojiRowProps } from './EmojiPickerEmojiRow';
|
|
4
|
+
export interface RenderItem {
|
|
5
|
+
(context?: VirtualRenderContext): ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export interface VirtualItem<P> {
|
|
8
|
+
height: number;
|
|
9
|
+
props: P;
|
|
10
|
+
renderItem: RenderItem;
|
|
11
|
+
}
|
|
12
|
+
export declare abstract class AbstractItem<P> implements VirtualItem<P> {
|
|
13
|
+
readonly height: number;
|
|
14
|
+
readonly props: P;
|
|
15
|
+
constructor(props: P, height: number);
|
|
16
|
+
abstract renderItem: RenderItem;
|
|
17
|
+
}
|
|
18
|
+
export declare class EmojisRowItem extends AbstractItem<EmojiRowProps> {
|
|
19
|
+
constructor(props: EmojiRowProps);
|
|
20
|
+
renderItem: () => JSX.Element;
|
|
21
|
+
}
|
|
22
|
+
export declare class LoadingItem extends AbstractItem<{}> {
|
|
23
|
+
constructor();
|
|
24
|
+
renderItem: () => JSX.Element;
|
|
25
|
+
}
|
|
26
|
+
export declare class CategoryHeadingItem extends AbstractItem<CategoryHeadingProps> {
|
|
27
|
+
constructor(props: CategoryHeadingProps);
|
|
28
|
+
renderItem: () => JSX.Element;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* These are the values provided by react-virtualized.
|
|
32
|
+
*/
|
|
33
|
+
export interface VirtualRenderContext {
|
|
34
|
+
index: number;
|
|
35
|
+
isScrolling: boolean;
|
|
36
|
+
isVisible: boolean;
|
|
37
|
+
key: any;
|
|
38
|
+
parent: any;
|
|
39
|
+
style: any;
|
|
40
|
+
}
|
|
41
|
+
export declare const virtualItemRenderer: (rows: VirtualItem<any>[], context: VirtualRenderContext) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CategoryDescription } from '../../types';
|
|
2
|
+
export declare type CategoryId = 'FREQUENT' | 'PEOPLE' | 'NATURE' | 'FOODS' | 'ACTIVITY' | 'PLACES' | 'OBJECTS' | 'SYMBOLS' | 'FLAGS' | 'ATLASSIAN' | 'CUSTOM';
|
|
3
|
+
export declare type CategoryGroupKey = CategoryId | 'USER_CUSTOM' | 'SEARCH';
|
|
4
|
+
export declare type CategoryDescriptionMap = {
|
|
5
|
+
[key in CategoryGroupKey]: CategoryDescription;
|
|
6
|
+
};
|
|
7
|
+
export declare const CategoryDescriptionMap: CategoryDescriptionMap;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const emojiPicker: (hasPreview?: boolean | undefined) => import("@emotion/utils").SerializedStyles;
|
|
2
|
+
export declare const addButton = "emoji-picker-add-button";
|
|
3
|
+
export declare const categorySelector: import("@emotion/utils").SerializedStyles;
|
|
4
|
+
export declare const active: import("@emotion/utils").SerializedStyles;
|
|
5
|
+
export declare const disable: import("@emotion/utils").SerializedStyles;
|
|
6
|
+
export declare const categoryStyles: import("@emotion/utils").SerializedStyles;
|
|
7
|
+
export declare const emojiPickerList: import("@emotion/utils").SerializedStyles;
|
|
8
|
+
export declare const virtualList: import("@emotion/utils").SerializedStyles;
|
|
9
|
+
export declare const searchIcon: import("@emotion/utils").SerializedStyles;
|
|
10
|
+
export declare const input: import("@emotion/utils").SerializedStyles;
|
|
11
|
+
export declare const pickerSearch: import("@emotion/utils").SerializedStyles;
|
|
12
|
+
export declare const emojiPickerSpinner: import("@emotion/utils").SerializedStyles;
|
|
13
|
+
export declare const emojiPickerRow: import("@emotion/utils").SerializedStyles;
|
|
14
|
+
export declare const emojiCategoryTitle: import("@emotion/utils").SerializedStyles;
|
|
15
|
+
export declare const emojiItem: import("@emotion/utils").SerializedStyles;
|
|
16
|
+
export declare const emojiPickerFooter: import("@emotion/utils").SerializedStyles;
|
|
17
|
+
export declare const emojiPickerFooterWithTopShadow: import("@emotion/utils").SerializedStyles;
|
|
18
|
+
export declare const emojiActionsContainerWithBottomShadow: import("@emotion/utils").SerializedStyles;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentClass } from 'react';
|
|
3
|
+
import { EmojiProvider } from '../../api/EmojiResource';
|
|
4
|
+
import { RelativePosition } from '../../types';
|
|
5
|
+
import LoadingEmojiComponent, { Props as LoadingProps, State as LoadingState } from '../common/LoadingEmojiComponent';
|
|
6
|
+
import { EmojiTypeAheadBaseProps, Props as ComponentProps } from './EmojiTypeAheadComponent';
|
|
7
|
+
export interface Props extends EmojiTypeAheadBaseProps, LoadingProps {
|
|
8
|
+
/** CSS selector, or target HTML element */
|
|
9
|
+
target?: string | HTMLElement;
|
|
10
|
+
position?: RelativePosition;
|
|
11
|
+
zIndex?: number | string;
|
|
12
|
+
offsetX?: number;
|
|
13
|
+
offsetY?: number;
|
|
14
|
+
}
|
|
15
|
+
export default class EmojiTypeahead extends LoadingEmojiComponent<Props, LoadingState> {
|
|
16
|
+
static AsyncLoadedComponent?: ComponentClass<ComponentProps>;
|
|
17
|
+
state: {
|
|
18
|
+
asyncLoadedComponent: React.ComponentClass<ComponentProps, any> | undefined;
|
|
19
|
+
};
|
|
20
|
+
constructor(props: Props);
|
|
21
|
+
selectNext: () => void;
|
|
22
|
+
selectPrevious: () => void;
|
|
23
|
+
chooseCurrentSelection: () => void;
|
|
24
|
+
count: () => number;
|
|
25
|
+
asyncLoadComponent(): void;
|
|
26
|
+
renderLoaded(loadedEmojiProvider: EmojiProvider, EmojiTypeAheadComponent: ComponentClass<ComponentProps>): JSX.Element | null;
|
|
27
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { PureComponent } from 'react';
|
|
2
|
+
import { EmojiProvider } from '../../api/EmojiResource';
|
|
3
|
+
import { EmojiDescription, OnEmojiEvent } from '../../types';
|
|
4
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
|
+
export interface OnLifecycle {
|
|
6
|
+
(): void;
|
|
7
|
+
}
|
|
8
|
+
export interface EmojiTypeAheadBaseProps {
|
|
9
|
+
/**
|
|
10
|
+
* Callback to be executed when user selects an emoji.
|
|
11
|
+
*/
|
|
12
|
+
onSelection?: OnEmojiEvent;
|
|
13
|
+
/**
|
|
14
|
+
* Search query.
|
|
15
|
+
*/
|
|
16
|
+
query?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Number of results to be displayed in the search results list
|
|
19
|
+
*/
|
|
20
|
+
listLimit?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Callback to be executed when typeahead component is being shown
|
|
23
|
+
*/
|
|
24
|
+
onOpen?: OnLifecycle;
|
|
25
|
+
/**
|
|
26
|
+
* Callback to be executed when typeahead component disappears
|
|
27
|
+
*/
|
|
28
|
+
onClose?: OnLifecycle;
|
|
29
|
+
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
30
|
+
}
|
|
31
|
+
export interface Props extends EmojiTypeAheadBaseProps {
|
|
32
|
+
/**
|
|
33
|
+
* EmojiResource instance that handles fetching of emoji data.
|
|
34
|
+
*/
|
|
35
|
+
emojiProvider: EmojiProvider;
|
|
36
|
+
}
|
|
37
|
+
export interface State {
|
|
38
|
+
visible: boolean;
|
|
39
|
+
emojis: EmojiDescription[];
|
|
40
|
+
loading: boolean;
|
|
41
|
+
}
|
|
42
|
+
export default class EmojiTypeAheadComponent extends PureComponent<Props, State> {
|
|
43
|
+
static defaultProps: {
|
|
44
|
+
onSelection: () => void;
|
|
45
|
+
onOpen: () => void;
|
|
46
|
+
onClose: () => void;
|
|
47
|
+
listLimit: number;
|
|
48
|
+
};
|
|
49
|
+
private emojiListRef;
|
|
50
|
+
private openTime;
|
|
51
|
+
private renderStartTime;
|
|
52
|
+
private selectedTone;
|
|
53
|
+
private pressed;
|
|
54
|
+
private sessionId;
|
|
55
|
+
private selected;
|
|
56
|
+
constructor(props: Props);
|
|
57
|
+
componentDidMount(): void;
|
|
58
|
+
componentWillUnmount(): void;
|
|
59
|
+
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
60
|
+
selectNext: () => void;
|
|
61
|
+
selectPrevious: () => void;
|
|
62
|
+
chooseCurrentSelection: () => void;
|
|
63
|
+
count: () => number;
|
|
64
|
+
getTone: (tone?: number | undefined) => string | undefined;
|
|
65
|
+
private fireAnalyticsEvent;
|
|
66
|
+
private onSearch;
|
|
67
|
+
private onSearchResult;
|
|
68
|
+
private fireSelectionEvent;
|
|
69
|
+
private onProviderChange;
|
|
70
|
+
private onEmojiListRef;
|
|
71
|
+
render(): JSX.Element;
|
|
72
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PureComponent } from 'react';
|
|
3
|
+
import { EmojiDescription, OnEmojiEvent } from '../../types';
|
|
4
|
+
export interface Props {
|
|
5
|
+
onMouseMove: OnEmojiEvent;
|
|
6
|
+
onSelection: OnEmojiEvent;
|
|
7
|
+
selected: boolean;
|
|
8
|
+
emoji: EmojiDescription;
|
|
9
|
+
}
|
|
10
|
+
export default class EmojiTypeAheadItem extends PureComponent<Props, {}> {
|
|
11
|
+
onEmojiSelected: React.MouseEventHandler<HTMLDivElement>;
|
|
12
|
+
onEmojiMenuItemMouseMove: React.MouseEventHandler<HTMLDivElement>;
|
|
13
|
+
render(): JSX.Element;
|
|
14
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PureComponent } from 'react';
|
|
2
|
+
import { EmojiDescription, OnEmojiEvent } from '../../types';
|
|
3
|
+
export interface Props {
|
|
4
|
+
emojis: EmojiDescription[];
|
|
5
|
+
onEmojiSelected?: OnEmojiEvent;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface State {
|
|
9
|
+
selectedIndex: number;
|
|
10
|
+
selectedKey?: string;
|
|
11
|
+
}
|
|
12
|
+
export default class EmojiTypeAheadList extends PureComponent<Props, State> {
|
|
13
|
+
private lastMousePosition?;
|
|
14
|
+
private scrollable?;
|
|
15
|
+
private items;
|
|
16
|
+
static defaultProps: {
|
|
17
|
+
onEmojiSelected: () => void;
|
|
18
|
+
};
|
|
19
|
+
constructor(props: Props);
|
|
20
|
+
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
21
|
+
componentDidUpdate(): void;
|
|
22
|
+
selectNext: () => void;
|
|
23
|
+
selectPrevious: () => void;
|
|
24
|
+
chooseCurrentSelection: () => void;
|
|
25
|
+
private revealItem;
|
|
26
|
+
private selectIndexNewEmoji;
|
|
27
|
+
private selectIndex;
|
|
28
|
+
private selectByEmojiId;
|
|
29
|
+
private selectIndexOnHover;
|
|
30
|
+
private itemSelected;
|
|
31
|
+
private renderItems;
|
|
32
|
+
private isSelectedEmoji;
|
|
33
|
+
render(): JSX.Element;
|
|
34
|
+
private handleScrollableRef;
|
|
35
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const emojiTypeAhead = "emoji-typeahead-element";
|
|
2
|
+
export declare const typeAheadListContainer = "emoji-typeahead-list-container";
|
|
3
|
+
export declare const typeaheadSelected = "emoji-typeahead-selected";
|
|
4
|
+
export declare const typeAheadList: import("@emotion/utils").SerializedStyles;
|
|
5
|
+
export declare const typeAheadEmpty: import("@emotion/utils").SerializedStyles;
|
|
6
|
+
export declare const selected: import("@emotion/utils").SerializedStyles;
|
|
7
|
+
export declare const typeAheadItem: import("@emotion/utils").SerializedStyles;
|
|
8
|
+
export declare const typeAheadItemRow: import("@emotion/utils").SerializedStyles;
|
|
9
|
+
export declare const emojiTypeAheadSpinnerContainer: import("@emotion/utils").SerializedStyles;
|
|
10
|
+
export declare const emojiTypeAheadSpinner: import("@emotion/utils").SerializedStyles;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { EmojiProvider } from '../../api/EmojiResource';
|
|
3
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
4
|
+
export interface UploadRefHandler {
|
|
5
|
+
(ref: HTMLDivElement): void;
|
|
6
|
+
}
|
|
7
|
+
export interface Props {
|
|
8
|
+
emojiProvider: EmojiProvider;
|
|
9
|
+
onUploaderRef?: UploadRefHandler;
|
|
10
|
+
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import("react").NamedExoticComponent<Props>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import LoadingEmojiComponent, { Props as LoadingProps, State as LoadingState } from '../common/LoadingEmojiComponent';
|
|
3
|
+
import { Props as ComponentProps } from './EmojiUploadComponent';
|
|
4
|
+
import { EmojiProvider } from '../../api/EmojiResource';
|
|
5
|
+
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
6
|
+
export interface Props extends LoadingProps {
|
|
7
|
+
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
8
|
+
}
|
|
9
|
+
export declare class EmojiUploaderInternal extends LoadingEmojiComponent<Props, LoadingState> {
|
|
10
|
+
static AsyncLoadedComponent?: FC<ComponentProps>;
|
|
11
|
+
state: {
|
|
12
|
+
asyncLoadedComponent: React.FC<ComponentProps> | undefined;
|
|
13
|
+
};
|
|
14
|
+
constructor(props: Props);
|
|
15
|
+
asyncLoadComponent(): void;
|
|
16
|
+
renderLoaded(loadedEmojiProvider: EmojiProvider, EmojiUploadComponent: FC<ComponentProps>): JSX.Element;
|
|
17
|
+
}
|
|
18
|
+
declare type EmojiUploader = EmojiUploaderInternal;
|
|
19
|
+
declare const EmojiUploader: React.ForwardRefExoticComponent<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any>>;
|
|
20
|
+
export default EmojiUploader;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { EmojiContext as InternalEmojiContextType } from '../components/common/internal-types';
|
|
3
|
+
export declare type EmojiContextType = InternalEmojiContextType | null;
|
|
4
|
+
export declare const EmojiContext: import("react").Context<EmojiContextType>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React, { Component } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { EmojiContext } from '../components/common/internal-types';
|
|
4
|
+
export interface LegacyEmojiContextProviderProps {
|
|
5
|
+
emojiContextValue?: EmojiContext;
|
|
6
|
+
}
|
|
7
|
+
interface LegacyEmojiContextProviderState {
|
|
8
|
+
prioritisedContextValue?: EmojiContext;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Legacy Context Priority Passthrough ...
|
|
12
|
+
* If component finds legacy context, then use it, otherwise use the passed through context
|
|
13
|
+
*/
|
|
14
|
+
export default class LegacyEmojiContextProvider extends Component<LegacyEmojiContextProviderProps, LegacyEmojiContextProviderState> {
|
|
15
|
+
static contextTypes: {
|
|
16
|
+
emoji: PropTypes.Requireable<object>;
|
|
17
|
+
};
|
|
18
|
+
context: EmojiContext;
|
|
19
|
+
constructor(props: LegacyEmojiContextProviderProps, context: EmojiContext);
|
|
20
|
+
render(): React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -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;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'fabric.emoji.add.custom.emoji.label': string;
|
|
3
|
+
'fabric.emoji.add.label': string;
|
|
4
|
+
'fabric.emoji.cancel.label': string;
|
|
5
|
+
'fabric.emoji.categories.search.results': string;
|
|
6
|
+
'fabric.emoji.category.activity': string;
|
|
7
|
+
'fabric.emoji.category.all.uploads': string;
|
|
8
|
+
'fabric.emoji.category.flags': string;
|
|
9
|
+
'fabric.emoji.category.foods': string;
|
|
10
|
+
'fabric.emoji.category.frequent': string;
|
|
11
|
+
'fabric.emoji.category.nature': string;
|
|
12
|
+
'fabric.emoji.category.objects': string;
|
|
13
|
+
'fabric.emoji.category.people': string;
|
|
14
|
+
'fabric.emoji.category.places': string;
|
|
15
|
+
'fabric.emoji.category.productivity': string;
|
|
16
|
+
'fabric.emoji.category.symbols': string;
|
|
17
|
+
'fabric.emoji.category.user.uploads': string;
|
|
18
|
+
'fabric.emoji.choose.file.screenReaderDescription': string;
|
|
19
|
+
'fabric.emoji.choose.file.title': string;
|
|
20
|
+
'fabric.emoji.delete.description': string;
|
|
21
|
+
'fabric.emoji.delete.label': string;
|
|
22
|
+
'fabric.emoji.delete.title': string;
|
|
23
|
+
'fabric.emoji.error.delete.failed': string;
|
|
24
|
+
'fabric.emoji.error.image.too.big': string;
|
|
25
|
+
'fabric.emoji.error.invalid.image': string;
|
|
26
|
+
'fabric.emoji.error.upload.failed': string;
|
|
27
|
+
'fabric.emoji.image.requirements': string;
|
|
28
|
+
'fabric.emoji.name.ariaLabel': string;
|
|
29
|
+
'fabric.emoji.placeholder': string;
|
|
30
|
+
'fabric.emoji.preview': string;
|
|
31
|
+
'fabric.emoji.preview.title': string;
|
|
32
|
+
'fabric.emoji.retry.label': string;
|
|
33
|
+
'fabric.emoji.search.label': string;
|
|
34
|
+
'fabric.emoji.search.placeholder': string;
|
|
35
|
+
'fabric.emoji.select.skin.tone.ariaLabel': string;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* NOTE:
|
|
39
|
+
*
|
|
40
|
+
* This file is automatically generated by Traduki 2.0.
|
|
41
|
+
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
42
|
+
*/
|
|
43
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'fabric.emoji.add.custom.emoji.label': string;
|
|
3
|
+
'fabric.emoji.add.label': string;
|
|
4
|
+
'fabric.emoji.cancel.label': string;
|
|
5
|
+
'fabric.emoji.categories.search.results': string;
|
|
6
|
+
'fabric.emoji.category.activity': string;
|
|
7
|
+
'fabric.emoji.category.all.uploads': string;
|
|
8
|
+
'fabric.emoji.category.flags': string;
|
|
9
|
+
'fabric.emoji.category.foods': string;
|
|
10
|
+
'fabric.emoji.category.frequent': string;
|
|
11
|
+
'fabric.emoji.category.nature': string;
|
|
12
|
+
'fabric.emoji.category.objects': string;
|
|
13
|
+
'fabric.emoji.category.people': string;
|
|
14
|
+
'fabric.emoji.category.places': string;
|
|
15
|
+
'fabric.emoji.category.productivity': string;
|
|
16
|
+
'fabric.emoji.category.symbols': string;
|
|
17
|
+
'fabric.emoji.category.user.uploads': string;
|
|
18
|
+
'fabric.emoji.choose.file.screenReaderDescription': string;
|
|
19
|
+
'fabric.emoji.choose.file.title': string;
|
|
20
|
+
'fabric.emoji.delete.description': string;
|
|
21
|
+
'fabric.emoji.delete.label': string;
|
|
22
|
+
'fabric.emoji.delete.title': string;
|
|
23
|
+
'fabric.emoji.error.delete.failed': string;
|
|
24
|
+
'fabric.emoji.error.image.too.big': string;
|
|
25
|
+
'fabric.emoji.error.invalid.image': string;
|
|
26
|
+
'fabric.emoji.error.upload.failed': string;
|
|
27
|
+
'fabric.emoji.image.requirements': string;
|
|
28
|
+
'fabric.emoji.name.ariaLabel': string;
|
|
29
|
+
'fabric.emoji.placeholder': string;
|
|
30
|
+
'fabric.emoji.preview': string;
|
|
31
|
+
'fabric.emoji.preview.title': string;
|
|
32
|
+
'fabric.emoji.retry.label': string;
|
|
33
|
+
'fabric.emoji.search.label': string;
|
|
34
|
+
'fabric.emoji.search.placeholder': string;
|
|
35
|
+
'fabric.emoji.select.skin.tone.ariaLabel': string;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* NOTE:
|
|
39
|
+
*
|
|
40
|
+
* This file is automatically generated by Traduki 2.0.
|
|
41
|
+
* DO NOT CHANGE IT BY HAND or your changes will be lost.
|
|
42
|
+
*/
|
|
43
|
+
export default _default;
|