@atlaskit/emoji 69.5.0 → 69.5.2
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 +14 -0
- package/afm-cc/tsconfig.json +2 -2
- package/dist/cjs/util/analytics/analytics.js +1 -1
- package/dist/es2019/util/analytics/analytics.js +1 -1
- package/dist/esm/util/analytics/analytics.js +1 -1
- package/dist/types/api/EmojiResource.d.ts +25 -25
- package/dist/types/api/media/SiteEmojiResource.d.ts +1 -1
- package/dist/types/components/common/Emoji.d.ts +37 -37
- package/dist/types/components/common/EmojiActions.d.ts +10 -10
- package/dist/types/components/common/EmojiDeletePreview.d.ts +3 -3
- package/dist/types/components/common/EmojiErrorMessage.d.ts +1 -1
- package/dist/types/components/common/EmojiPlaceholder.d.ts +3 -3
- package/dist/types/components/common/EmojiRadioButton.d.ts +2 -2
- package/dist/types/components/common/EmojiUploadPicker.d.ts +4 -4
- package/dist/types/components/common/EmojiUploadPreview.d.ts +3 -3
- package/dist/types/components/common/FileChooser.d.ts +3 -3
- package/dist/types/components/common/LoadingEmojiComponent.d.ts +1 -1
- package/dist/types/components/common/Popup.d.ts +3 -3
- package/dist/types/components/common/ResourcedEmojiComponent.d.ts +23 -23
- package/dist/types/components/common/RetryableButton.d.ts +4 -4
- package/dist/types/components/common/Scrollable.d.ts +2 -2
- package/dist/types/components/common/TonePreviewButton.d.ts +2 -2
- package/dist/types/components/common/ToneSelector.d.ts +1 -1
- package/dist/types/components/common/UfoErrorBoundary.d.ts +1 -1
- package/dist/types/components/common/internal-types.d.ts +1 -1
- package/dist/types/components/picker/CategorySelector.d.ts +1 -1
- package/dist/types/components/picker/EmojiPicker.d.ts +4 -4
- package/dist/types/components/picker/EmojiPickerCategoryHeading.d.ts +1 -1
- package/dist/types/components/picker/EmojiPickerComponent.d.ts +5 -5
- package/dist/types/components/picker/EmojiPickerEmojiRow.d.ts +5 -5
- package/dist/types/components/picker/EmojiPickerList.d.ts +20 -20
- package/dist/types/components/picker/EmojiPickerListSearch.d.ts +2 -2
- package/dist/types/components/picker/EmojiPickerTabPanel.d.ts +1 -1
- package/dist/types/components/picker/VirtualList.d.ts +10 -10
- package/dist/types/components/typeahead/EmojiTypeAhead.d.ts +3 -3
- package/dist/types/components/typeahead/EmojiTypeAheadComponent.d.ts +12 -12
- package/dist/types/components/typeahead/EmojiTypeAheadItem.d.ts +3 -3
- package/dist/types/components/typeahead/EmojiTypeAheadList.d.ts +1 -1
- package/dist/types/components/typeahead/EmojiTypeAheadListContainer.d.ts +1 -1
- package/dist/types/components/uploader/EmojiUploadComponent.d.ts +2 -2
- package/dist/types/context/EmojiPickerListContext.d.ts +1 -1
- package/dist/types/types.d.ts +75 -75
- package/dist/types/util/analytics/analytics.d.ts +3 -3
- package/dist/types/util/analytics/samplingUfo.d.ts +2 -2
- package/dist/types/util/image.d.ts +1 -1
- package/dist/types/util/keymaps.d.ts +2 -2
- package/dist/types-ts4.5/api/EmojiResource.d.ts +25 -25
- package/dist/types-ts4.5/api/media/SiteEmojiResource.d.ts +1 -1
- package/dist/types-ts4.5/components/common/Emoji.d.ts +37 -37
- package/dist/types-ts4.5/components/common/EmojiActions.d.ts +10 -10
- package/dist/types-ts4.5/components/common/EmojiDeletePreview.d.ts +3 -3
- package/dist/types-ts4.5/components/common/EmojiErrorMessage.d.ts +1 -1
- package/dist/types-ts4.5/components/common/EmojiPlaceholder.d.ts +3 -3
- package/dist/types-ts4.5/components/common/EmojiRadioButton.d.ts +2 -2
- package/dist/types-ts4.5/components/common/EmojiUploadPicker.d.ts +4 -4
- package/dist/types-ts4.5/components/common/EmojiUploadPreview.d.ts +3 -3
- package/dist/types-ts4.5/components/common/FileChooser.d.ts +3 -3
- package/dist/types-ts4.5/components/common/LoadingEmojiComponent.d.ts +1 -1
- package/dist/types-ts4.5/components/common/Popup.d.ts +3 -3
- package/dist/types-ts4.5/components/common/ResourcedEmojiComponent.d.ts +23 -23
- package/dist/types-ts4.5/components/common/RetryableButton.d.ts +4 -4
- package/dist/types-ts4.5/components/common/Scrollable.d.ts +2 -2
- package/dist/types-ts4.5/components/common/TonePreviewButton.d.ts +2 -2
- package/dist/types-ts4.5/components/common/ToneSelector.d.ts +1 -1
- package/dist/types-ts4.5/components/common/UfoErrorBoundary.d.ts +1 -1
- package/dist/types-ts4.5/components/common/internal-types.d.ts +1 -1
- package/dist/types-ts4.5/components/picker/CategorySelector.d.ts +1 -1
- package/dist/types-ts4.5/components/picker/EmojiPicker.d.ts +4 -4
- package/dist/types-ts4.5/components/picker/EmojiPickerCategoryHeading.d.ts +1 -1
- package/dist/types-ts4.5/components/picker/EmojiPickerComponent.d.ts +5 -5
- package/dist/types-ts4.5/components/picker/EmojiPickerEmojiRow.d.ts +5 -5
- package/dist/types-ts4.5/components/picker/EmojiPickerList.d.ts +20 -20
- package/dist/types-ts4.5/components/picker/EmojiPickerListSearch.d.ts +2 -2
- package/dist/types-ts4.5/components/picker/EmojiPickerTabPanel.d.ts +1 -1
- package/dist/types-ts4.5/components/picker/VirtualList.d.ts +10 -10
- package/dist/types-ts4.5/components/typeahead/EmojiTypeAhead.d.ts +3 -3
- package/dist/types-ts4.5/components/typeahead/EmojiTypeAheadComponent.d.ts +12 -12
- package/dist/types-ts4.5/components/typeahead/EmojiTypeAheadItem.d.ts +3 -3
- package/dist/types-ts4.5/components/typeahead/EmojiTypeAheadList.d.ts +1 -1
- package/dist/types-ts4.5/components/typeahead/EmojiTypeAheadListContainer.d.ts +1 -1
- package/dist/types-ts4.5/components/uploader/EmojiUploadComponent.d.ts +2 -2
- package/dist/types-ts4.5/context/EmojiPickerListContext.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +75 -75
- package/dist/types-ts4.5/util/analytics/analytics.d.ts +3 -3
- package/dist/types-ts4.5/util/analytics/samplingUfo.d.ts +2 -2
- package/dist/types-ts4.5/util/image.d.ts +1 -1
- package/dist/types-ts4.5/util/keymaps.d.ts +2 -2
- package/package.json +3 -4
|
@@ -4,9 +4,9 @@ import type { CategoryGroupKey } from './categories';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const RENDER_EMOJI_PICKER_CATEGORY_HEADING_TESTID = "render-emoji-picker-categorty-heading";
|
|
6
6
|
export interface Props {
|
|
7
|
+
className?: string;
|
|
7
8
|
id: CategoryGroupKey;
|
|
8
9
|
title: string;
|
|
9
|
-
className?: string;
|
|
10
10
|
}
|
|
11
11
|
declare const EmojiPickerCategoryHeading: ({ id, title, className }: Props) => JSX.Element;
|
|
12
12
|
export default EmojiPickerCategoryHeading;
|
|
@@ -4,19 +4,19 @@ export interface PickerRefHandler {
|
|
|
4
4
|
(ref: any): any;
|
|
5
5
|
}
|
|
6
6
|
export interface Props {
|
|
7
|
+
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* Flag to disable tone selector.
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
+
hideToneSelector?: boolean;
|
|
11
12
|
/**
|
|
12
13
|
* Callback performed when picker reference is being set.
|
|
13
14
|
*/
|
|
14
15
|
onPickerRef?: PickerRefHandler;
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
+
* Callback to be executed when user selects an emoji.
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
|
-
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
19
|
+
onSelection?: OnEmojiEvent;
|
|
20
20
|
size?: PickerSize;
|
|
21
21
|
}
|
|
22
22
|
declare const _default: import("react").MemoExoticComponent<({ onSelection, onPickerRef, hideToneSelector, createAnalyticsEvent, size, }: Props) => JSX.Element>;
|
|
@@ -4,12 +4,12 @@ import type { CategoryGroupKey } from './categories';
|
|
|
4
4
|
export interface Props {
|
|
5
5
|
category: CategoryGroupKey;
|
|
6
6
|
emojis: EmojiDescription[];
|
|
7
|
-
title: string;
|
|
8
|
-
showDelete: boolean;
|
|
9
|
-
onSelected?: OnEmojiEvent;
|
|
10
|
-
onMouseMove?: OnEmojiEvent;
|
|
11
|
-
onFocus?: OnEmojiEvent;
|
|
12
7
|
onDelete?: OnEmojiEvent;
|
|
8
|
+
onFocus?: OnEmojiEvent;
|
|
9
|
+
onMouseMove?: OnEmojiEvent;
|
|
10
|
+
onSelected?: OnEmojiEvent;
|
|
11
|
+
showDelete: boolean;
|
|
12
|
+
title: string;
|
|
13
13
|
virtualItemContext?: VirtualItemContext;
|
|
14
14
|
}
|
|
15
15
|
declare const _default: import("react").MemoExoticComponent<({ emojis, onSelected, onMouseMove, onFocus, title, showDelete, onDelete, virtualItemContext, }: Props) => JSX.Element>;
|
|
@@ -11,40 +11,40 @@ export interface OnSearch {
|
|
|
11
11
|
(query: string): void;
|
|
12
12
|
}
|
|
13
13
|
export interface Props {
|
|
14
|
-
|
|
14
|
+
activeCategoryId?: CategoryId | null;
|
|
15
15
|
currentUser?: User;
|
|
16
|
-
|
|
16
|
+
emojis: EmojiDescription[];
|
|
17
|
+
emojiToDelete?: EmojiDescription;
|
|
18
|
+
initialUploadName?: string;
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
onCategoryActivated?: OnCategory;
|
|
21
|
+
onCloseDelete: () => void;
|
|
22
|
+
onDeleteEmoji: OnDeleteEmoji;
|
|
17
23
|
onEmojiActive?: OnEmojiEvent;
|
|
18
24
|
onEmojiDelete?: OnEmojiEvent;
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
onEmojiSelected?: OnEmojiEvent;
|
|
26
|
+
onFileChooserClicked?: () => void;
|
|
27
|
+
onOpenUpload: () => void;
|
|
21
28
|
onSearch?: OnSearch;
|
|
22
|
-
loading?: boolean;
|
|
23
|
-
query?: string;
|
|
24
|
-
initialUploadName?: string;
|
|
25
29
|
onToneSelected?: OnToneSelected;
|
|
26
30
|
onToneSelectorCancelled?: OnToneSelectorCancelled;
|
|
27
|
-
toneEmoji?: EmojiDescriptionWithVariations;
|
|
28
|
-
uploading: boolean;
|
|
29
|
-
emojiToDelete?: EmojiDescription;
|
|
30
|
-
uploadErrorMessage?: Message;
|
|
31
|
-
uploadEnabled: boolean;
|
|
32
|
-
onUploadEmoji: OnUploadEmoji;
|
|
33
31
|
onUploadCancelled: () => void;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
onOpenUpload: () => void;
|
|
32
|
+
onUploadEmoji: OnUploadEmoji;
|
|
33
|
+
query?: string;
|
|
34
|
+
selectedTone?: ToneSelection;
|
|
38
35
|
size?: PickerSize;
|
|
39
|
-
|
|
36
|
+
toneEmoji?: EmojiDescriptionWithVariations;
|
|
37
|
+
uploadEnabled: boolean;
|
|
38
|
+
uploadErrorMessage?: Message;
|
|
39
|
+
uploading: boolean;
|
|
40
40
|
}
|
|
41
41
|
export interface State {
|
|
42
42
|
}
|
|
43
43
|
export type PickerListRef = {
|
|
44
44
|
reveal: (category: CategoryId) => void;
|
|
45
45
|
scrollToBottom: () => void;
|
|
46
|
-
scrollToTop: () => void;
|
|
47
|
-
scrollToRow: (index?: number) => void;
|
|
48
46
|
scrollToRecentlyUploaded: (uploadedEmoji: EmojiDescription) => void;
|
|
47
|
+
scrollToRow: (index?: number) => void;
|
|
48
|
+
scrollToTop: () => void;
|
|
49
49
|
};
|
|
50
50
|
export declare const EmojiPickerVirtualListInternal: React.ForwardRefExoticComponent<Props & React.RefAttributes<PickerListRef>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Styles } from '../../types';
|
|
2
2
|
export interface Props {
|
|
3
|
-
style?: Styles;
|
|
4
|
-
query?: string;
|
|
5
3
|
isVisible?: boolean;
|
|
6
4
|
onChange: (value: string) => void;
|
|
5
|
+
query?: string;
|
|
7
6
|
resultsCount: number;
|
|
7
|
+
style?: Styles;
|
|
8
8
|
}
|
|
9
9
|
export declare const emojiPickerSearchTestId = "emoji-picker-search";
|
|
10
10
|
export declare const EmojiPickerListSearch: (props: Props) => JSX.Element;
|
|
@@ -9,11 +9,11 @@ import { type WrappedComponentProps } from 'react-intl-next';
|
|
|
9
9
|
* ticket: COLLAB-2317
|
|
10
10
|
*/
|
|
11
11
|
interface EmojiPickerTabPanelProps extends WrappedComponentProps {
|
|
12
|
+
children?: React.ReactNode;
|
|
12
13
|
/**
|
|
13
14
|
* Indicate whether the panel shows search results or full emojis list
|
|
14
15
|
*/
|
|
15
16
|
showSearchResults: boolean;
|
|
16
|
-
children?: React.ReactNode;
|
|
17
17
|
}
|
|
18
18
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<React.PropsWithChildren<EmojiPickerTabPanelProps>>> & {
|
|
19
19
|
WrappedComponent: React.ComponentType<React.PropsWithChildren<EmojiPickerTabPanelProps>>;
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import type { VirtualItem as VirtualItemContext } from '@tanstack/react-virtual';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
type Props = {
|
|
4
|
-
|
|
5
|
-
rowHeight: (index: number) => number;
|
|
6
|
-
rowRenderer: (context: VirtualItemContext) => JSX.Element;
|
|
4
|
+
height: number;
|
|
7
5
|
onRowsRendered: (indexes: {
|
|
8
6
|
startIndex: number;
|
|
9
7
|
}) => void;
|
|
8
|
+
overscanRowCount: number;
|
|
10
9
|
rowCount: number;
|
|
10
|
+
rowHeight: (index: number) => number;
|
|
11
|
+
rowRenderer: (context: VirtualItemContext) => JSX.Element;
|
|
11
12
|
scrollToAlignment: 'start' | 'end';
|
|
12
13
|
width: number;
|
|
13
|
-
height: number;
|
|
14
14
|
};
|
|
15
15
|
export type ListRef = {
|
|
16
|
+
/**
|
|
17
|
+
* Scroll to a emoji in virtual list and focus on it
|
|
18
|
+
* @param rIndex row index of virtual list
|
|
19
|
+
* @param cIndex column index of virtual list
|
|
20
|
+
*/
|
|
21
|
+
scrollToEmojiAndFocus: (rIndex: number, cIndex: number) => void;
|
|
16
22
|
/**
|
|
17
23
|
* Scroll to the row by row index
|
|
18
24
|
* @param index row index of virtual list
|
|
@@ -24,12 +30,6 @@ export type ListRef = {
|
|
|
24
30
|
* @returns
|
|
25
31
|
*/
|
|
26
32
|
scrollToRowAndFocusLastEmoji: (index?: number) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Scroll to a emoji in virtual list and focus on it
|
|
29
|
-
* @param rIndex row index of virtual list
|
|
30
|
-
* @param cIndex column index of virtual list
|
|
31
|
-
*/
|
|
32
|
-
scrollToEmojiAndFocus: (rIndex: number, cIndex: number) => void;
|
|
33
33
|
/**
|
|
34
34
|
* Update the focus index of virtual list, which will manage tabIndex via EmojiPickerListContext
|
|
35
35
|
* @param rIndex row index of virtual list
|
|
@@ -5,12 +5,12 @@ import type { RelativePosition } from '../../types';
|
|
|
5
5
|
import LoadingEmojiComponent, { type Props as LoadingProps, type State as LoadingState } from '../common/LoadingEmojiComponent';
|
|
6
6
|
import type { EmojiTypeAheadBaseProps, Props as ComponentProps } from './EmojiTypeAheadComponent';
|
|
7
7
|
export interface Props extends EmojiTypeAheadBaseProps, LoadingProps {
|
|
8
|
+
offsetX?: number;
|
|
9
|
+
offsetY?: number;
|
|
10
|
+
position?: RelativePosition;
|
|
8
11
|
/** CSS selector, or target HTML element */
|
|
9
12
|
target?: string | HTMLElement;
|
|
10
|
-
position?: RelativePosition;
|
|
11
13
|
zIndex?: number | string;
|
|
12
|
-
offsetX?: number;
|
|
13
|
-
offsetY?: number;
|
|
14
14
|
}
|
|
15
15
|
export default class EmojiTypeahead extends LoadingEmojiComponent<Props, LoadingState> {
|
|
16
16
|
static AsyncLoadedComponent?: ComponentClass<ComponentProps>;
|
|
@@ -7,27 +7,27 @@ export interface OnLifecycle {
|
|
|
7
7
|
(): void;
|
|
8
8
|
}
|
|
9
9
|
export interface EmojiTypeAheadBaseProps {
|
|
10
|
-
|
|
11
|
-
* Callback to be executed when user selects an emoji.
|
|
12
|
-
*/
|
|
13
|
-
onSelection?: OnEmojiEvent;
|
|
14
|
-
/**
|
|
15
|
-
* Search query.
|
|
16
|
-
*/
|
|
17
|
-
query?: string;
|
|
10
|
+
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
18
11
|
/**
|
|
19
12
|
* Number of results to be displayed in the search results list
|
|
20
13
|
*/
|
|
21
14
|
listLimit?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Callback to be executed when typeahead component disappears
|
|
17
|
+
*/
|
|
18
|
+
onClose?: OnLifecycle;
|
|
22
19
|
/**
|
|
23
20
|
* Callback to be executed when typeahead component is being shown
|
|
24
21
|
*/
|
|
25
22
|
onOpen?: OnLifecycle;
|
|
26
23
|
/**
|
|
27
|
-
* Callback to be executed when
|
|
24
|
+
* Callback to be executed when user selects an emoji.
|
|
28
25
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
onSelection?: OnEmojiEvent;
|
|
27
|
+
/**
|
|
28
|
+
* Search query.
|
|
29
|
+
*/
|
|
30
|
+
query?: string;
|
|
31
31
|
}
|
|
32
32
|
export interface Props extends EmojiTypeAheadBaseProps {
|
|
33
33
|
/**
|
|
@@ -36,9 +36,9 @@ export interface Props extends EmojiTypeAheadBaseProps {
|
|
|
36
36
|
emojiProvider: EmojiProvider;
|
|
37
37
|
}
|
|
38
38
|
export interface State {
|
|
39
|
-
visible: boolean;
|
|
40
39
|
emojis: EmojiDescription[];
|
|
41
40
|
loading: boolean;
|
|
41
|
+
visible: boolean;
|
|
42
42
|
}
|
|
43
43
|
export default class EmojiTypeAheadComponent extends PureComponent<Props, State> {
|
|
44
44
|
static defaultProps: {
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import type { EmojiDescription, EmojiProvider, OnEmojiEvent } from '../../types';
|
|
7
7
|
export interface Props {
|
|
8
|
-
onMouseMove: OnEmojiEvent;
|
|
9
|
-
onSelection: OnEmojiEvent;
|
|
10
|
-
selected: boolean;
|
|
11
8
|
emoji: EmojiDescription;
|
|
12
9
|
emojiProvider?: EmojiProvider;
|
|
13
10
|
forwardedRef?: React.Ref<HTMLDivElement>;
|
|
11
|
+
onMouseMove: OnEmojiEvent;
|
|
12
|
+
onSelection: OnEmojiEvent;
|
|
13
|
+
selected: boolean;
|
|
14
14
|
}
|
|
15
15
|
export declare function EmojiTypeAheadItemInternal(props: Props): JSX.Element;
|
|
16
16
|
declare const EmojiTypeAheadItem: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -2,8 +2,8 @@ import React, { PureComponent } from 'react';
|
|
|
2
2
|
import type { EmojiDescription, OnEmojiEvent } from '../../types';
|
|
3
3
|
export interface Props {
|
|
4
4
|
emojis: EmojiDescription[];
|
|
5
|
-
onEmojiSelected?: OnEmojiEvent;
|
|
6
5
|
loading?: boolean;
|
|
6
|
+
onEmojiSelected?: OnEmojiEvent;
|
|
7
7
|
}
|
|
8
8
|
export interface State {
|
|
9
9
|
selectedIndex: number;
|
|
@@ -4,10 +4,10 @@ export interface UploadRefHandler {
|
|
|
4
4
|
(ref: HTMLDivElement): void;
|
|
5
5
|
}
|
|
6
6
|
export interface Props {
|
|
7
|
-
emojiProvider: EmojiProvider;
|
|
8
|
-
onUploaderRef?: UploadRefHandler;
|
|
9
7
|
createAnalyticsEvent?: CreateUIAnalyticsEvent;
|
|
10
8
|
disableFocusLock?: boolean;
|
|
9
|
+
emojiProvider: EmojiProvider;
|
|
10
|
+
onUploaderRef?: UploadRefHandler;
|
|
11
11
|
}
|
|
12
12
|
declare const _default: import("react").MemoExoticComponent<(props: Props) => JSX.Element>;
|
|
13
13
|
export default _default;
|
|
@@ -3,8 +3,8 @@ import type { EmojiPickerListContextType } from '../components/common/internal-t
|
|
|
3
3
|
export declare const EmojiPickerListContext: React.Context<EmojiPickerListContextType>;
|
|
4
4
|
export interface EmojiPickerListContextProviderProps {
|
|
5
5
|
initialEmojisFocus: {
|
|
6
|
-
rowIndex: number;
|
|
7
6
|
columnIndex: number;
|
|
7
|
+
rowIndex: number;
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
export declare const EmojiPickerListContextProvider: (props: React.PropsWithChildren<EmojiPickerListContextProviderProps>) => React.JSX.Element;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -10,7 +10,22 @@ export interface EmojiProvider extends Provider<string, EmojiSearchResult, any,
|
|
|
10
10
|
*
|
|
11
11
|
* Will allow emoji to render site emojis without needing to fail first
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Returns a list of all the non-standard categories with emojis in the EmojiRepository
|
|
15
|
+
* e.g. 'FREQUENT', 'ATLASSIAN' and 'CUSTOM'
|
|
16
|
+
*/
|
|
17
|
+
calculateDynamicCategories?(): Promise<string[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Deletes the given emoji from the site emoji service
|
|
20
|
+
* No changes are made if it is not a media emoji, no siteEmojiResource has been initialised
|
|
21
|
+
* or the user is not authorised.
|
|
22
|
+
* It should also be removed from the EmojiResource so it cannot be returned via search
|
|
23
|
+
*
|
|
24
|
+
* Optional.
|
|
25
|
+
*
|
|
26
|
+
* @return a boolean indicating whether the delete was successful
|
|
27
|
+
*/
|
|
28
|
+
deleteSiteEmoji(emoji: EmojiDescription): Promise<boolean>;
|
|
14
29
|
/**
|
|
15
30
|
* Returns the first fetched emoji matching the emojiId.id.
|
|
16
31
|
*
|
|
@@ -18,11 +33,9 @@ export interface EmojiProvider extends Provider<string, EmojiSearchResult, any,
|
|
|
18
33
|
*/
|
|
19
34
|
fetchByEmojiId(emojiId: EmojiId, optimistic: boolean): OptionalEmojiDescriptionWithVariations | Promise<OptionalEmojiDescriptionWithVariations>;
|
|
20
35
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* Will load media api images before returning.
|
|
36
|
+
* Fetches and returns emojiResource
|
|
24
37
|
*/
|
|
25
|
-
|
|
38
|
+
fetchEmojiProvider(force?: boolean): Promise<EmojiRepository | undefined>;
|
|
26
39
|
/**
|
|
27
40
|
* Returns the first matching emoji matching the emojiId.id.
|
|
28
41
|
*
|
|
@@ -36,6 +49,12 @@ export interface EmojiProvider extends Provider<string, EmojiSearchResult, any,
|
|
|
36
49
|
* the media api images before returning.
|
|
37
50
|
*/
|
|
38
51
|
findById(id: string): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
|
|
52
|
+
/**
|
|
53
|
+
* Returns the first matching emoji matching the shortName, or null if none found.
|
|
54
|
+
*
|
|
55
|
+
* Will load media api images before returning.
|
|
56
|
+
*/
|
|
57
|
+
findByShortName(shortName: string): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
|
|
39
58
|
/**
|
|
40
59
|
* Finds emojis belonging to specified category.
|
|
41
60
|
*
|
|
@@ -46,6 +65,10 @@ export interface EmojiProvider extends Provider<string, EmojiSearchResult, any,
|
|
|
46
65
|
* Returns a map matching ascii representations to their corresponding EmojiDescription.
|
|
47
66
|
*/
|
|
48
67
|
getAsciiMap(): Promise<Map<string, EmojiDescription>>;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the logged user passed by the Product
|
|
70
|
+
*/
|
|
71
|
+
getCurrentUser(): OptionalUser;
|
|
49
72
|
/**
|
|
50
73
|
* Returns, in a Promise, an array of the most frequently used emoji, ordered from most frequent to least frequent.
|
|
51
74
|
* If there is no frequently used data then an empty array should be returned.
|
|
@@ -53,24 +76,16 @@ export interface EmojiProvider extends Provider<string, EmojiSearchResult, any,
|
|
|
53
76
|
* @param options supply options to be applied to the request.
|
|
54
77
|
*/
|
|
55
78
|
getFrequentlyUsed(options?: SearchOptions): Promise<EmojiDescription[]>;
|
|
79
|
+
getMediaEmojiDescriptionURLWithInlineToken(emoji: EmojiDescription): Promise<EmojiDescription>;
|
|
56
80
|
/**
|
|
57
|
-
*
|
|
58
|
-
* If no recordConfig is configured then a resolved promise should be returned
|
|
59
|
-
*
|
|
60
|
-
* Optional.
|
|
81
|
+
* Returns a constructed URL to fetch emoji media asset if 'optimisticImageApi' config has been provided
|
|
61
82
|
*/
|
|
62
|
-
|
|
83
|
+
getOptimisticImageURL(emojiId: EmojiId): string | undefined;
|
|
63
84
|
/**
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* or the user is not authorised.
|
|
67
|
-
* It should also be removed from the EmojiResource so it cannot be returned via search
|
|
68
|
-
*
|
|
69
|
-
* Optional.
|
|
70
|
-
*
|
|
71
|
-
* @return a boolean indicating whether the delete was successful
|
|
85
|
+
* Used by the picker and typeahead to obtain a skin tone preference
|
|
86
|
+
* if the user has previously selected one via the Tone Selector
|
|
72
87
|
*/
|
|
73
|
-
|
|
88
|
+
getSelectedTone(): ToneSelection;
|
|
74
89
|
/**
|
|
75
90
|
* Load media emoji that may require authentication to download, producing
|
|
76
91
|
* a new EmojiDescription to be used for rendering, if necessary.
|
|
@@ -86,6 +101,12 @@ export interface EmojiProvider extends Provider<string, EmojiSearchResult, any,
|
|
|
86
101
|
* if not a custom emoji.
|
|
87
102
|
*/
|
|
88
103
|
loadMediaEmoji(emoji: EmojiDescription, useAlt?: boolean): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
|
|
104
|
+
/**
|
|
105
|
+
* @return a boolean indicating whether providers should be fetched on-demand only, and automatic fetches prevented
|
|
106
|
+
*
|
|
107
|
+
* Optional.
|
|
108
|
+
*/
|
|
109
|
+
onlyFetchOnDemand?(): boolean;
|
|
89
110
|
/**
|
|
90
111
|
* Indicates if media emoji should be rendered optimistically,
|
|
91
112
|
* i.e. assume the url can be rendered directly from the URL, and
|
|
@@ -95,38 +116,17 @@ export interface EmojiProvider extends Provider<string, EmojiSearchResult, any,
|
|
|
95
116
|
*/
|
|
96
117
|
optimisticMediaRendering(emoji: EmojiDescription, useAlt?: boolean): boolean;
|
|
97
118
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
119
|
+
* Records an emoji selection, for example for using in tracking recent emoji.
|
|
120
|
+
* If no recordConfig is configured then a resolved promise should be returned
|
|
121
|
+
*
|
|
122
|
+
* Optional.
|
|
100
123
|
*/
|
|
101
|
-
|
|
124
|
+
recordSelection?(emoji: EmojiDescription): Promise<any>;
|
|
102
125
|
/**
|
|
103
126
|
* Used by Tone Selector to indicate to the provider that the user
|
|
104
127
|
* has selected a skin tone preference that should be remembered
|
|
105
128
|
*/
|
|
106
129
|
setSelectedTone(tone: ToneSelection): void;
|
|
107
|
-
/**
|
|
108
|
-
* Returns a list of all the non-standard categories with emojis in the EmojiRepository
|
|
109
|
-
* e.g. 'FREQUENT', 'ATLASSIAN' and 'CUSTOM'
|
|
110
|
-
*/
|
|
111
|
-
calculateDynamicCategories?(): Promise<string[]>;
|
|
112
|
-
/**
|
|
113
|
-
* Returns the logged user passed by the Product
|
|
114
|
-
*/
|
|
115
|
-
getCurrentUser(): OptionalUser;
|
|
116
|
-
/**
|
|
117
|
-
* Fetches and returns emojiResource
|
|
118
|
-
*/
|
|
119
|
-
fetchEmojiProvider(force?: boolean): Promise<EmojiRepository | undefined>;
|
|
120
|
-
/**
|
|
121
|
-
* Returns a constructed URL to fetch emoji media asset if 'optimisticImageApi' config has been provided
|
|
122
|
-
*/
|
|
123
|
-
getOptimisticImageURL(emojiId: EmojiId): string | undefined;
|
|
124
|
-
/**
|
|
125
|
-
* @return a boolean indicating whether providers should be fetched on-demand only, and automatic fetches prevented
|
|
126
|
-
*
|
|
127
|
-
* Optional.
|
|
128
|
-
*/
|
|
129
|
-
onlyFetchOnDemand?(): boolean;
|
|
130
130
|
}
|
|
131
131
|
export interface UploadingEmojiProvider extends EmojiProvider {
|
|
132
132
|
/**
|
|
@@ -135,6 +135,10 @@ export interface UploadingEmojiProvider extends EmojiProvider {
|
|
|
135
135
|
* Waits until resources have loaded before returning.
|
|
136
136
|
*/
|
|
137
137
|
isUploadSupported(): Promise<boolean>;
|
|
138
|
+
/**
|
|
139
|
+
* Allows the preloading of data (e.g. authentication tokens) to speed the uploading of emoji.
|
|
140
|
+
*/
|
|
141
|
+
prepareForUpload(): Promise<void>;
|
|
138
142
|
/**
|
|
139
143
|
* Uploads an emoji to the configured repository.
|
|
140
144
|
*
|
|
@@ -143,10 +147,6 @@ export interface UploadingEmojiProvider extends EmojiProvider {
|
|
|
143
147
|
* The last search will be re-run to ensure the new emoji is considered in the search.
|
|
144
148
|
*/
|
|
145
149
|
uploadCustomEmoji(upload: EmojiUpload, retry?: boolean): Promise<EmojiDescription>;
|
|
146
|
-
/**
|
|
147
|
-
* Allows the preloading of data (e.g. authentication tokens) to speed the uploading of emoji.
|
|
148
|
-
*/
|
|
149
|
-
prepareForUpload(): Promise<void>;
|
|
150
150
|
}
|
|
151
151
|
export type RelativePosition = 'above' | 'below' | 'auto';
|
|
152
152
|
export type PickerSize = 'small' | 'medium' | 'large';
|
|
@@ -161,15 +161,15 @@ export interface Styles {
|
|
|
161
161
|
* fallback behaviour will be to attempt to find a matching emoji by shortName.
|
|
162
162
|
*/
|
|
163
163
|
export interface EmojiId {
|
|
164
|
-
shortName: string;
|
|
165
|
-
id?: string;
|
|
166
164
|
fallback?: string;
|
|
165
|
+
id?: string;
|
|
166
|
+
shortName: string;
|
|
167
167
|
}
|
|
168
168
|
export interface SpriteSheet {
|
|
169
|
-
url: string;
|
|
170
|
-
row: number;
|
|
171
169
|
column: number;
|
|
172
170
|
height: number;
|
|
171
|
+
row: number;
|
|
172
|
+
url: string;
|
|
173
173
|
width: number;
|
|
174
174
|
}
|
|
175
175
|
export interface EmojiImageRepresentation {
|
|
@@ -178,8 +178,8 @@ export interface EmojiImageRepresentation {
|
|
|
178
178
|
}
|
|
179
179
|
export interface SpriteImageRepresentation extends EmojiImageRepresentation {
|
|
180
180
|
x: number;
|
|
181
|
-
y: number;
|
|
182
181
|
xIndex: number;
|
|
182
|
+
y: number;
|
|
183
183
|
yIndex: number;
|
|
184
184
|
}
|
|
185
185
|
/**
|
|
@@ -203,16 +203,16 @@ export interface MediaApiRepresentation extends EmojiImageRepresentation {
|
|
|
203
203
|
}
|
|
204
204
|
export type EmojiRepresentation = SpriteRepresentation | ImageRepresentation | MediaApiRepresentation | undefined;
|
|
205
205
|
export interface EmojiDescription extends EmojiId {
|
|
206
|
-
|
|
207
|
-
order?: number;
|
|
208
|
-
type: string;
|
|
209
|
-
category: string;
|
|
206
|
+
altRepresentation?: EmojiRepresentation;
|
|
210
207
|
ascii?: string[];
|
|
208
|
+
category: string;
|
|
211
209
|
createdDate?: string;
|
|
212
210
|
creatorUserId?: string;
|
|
211
|
+
name?: string;
|
|
212
|
+
order?: number;
|
|
213
213
|
representation: EmojiRepresentation;
|
|
214
|
-
altRepresentation?: EmojiRepresentation;
|
|
215
214
|
searchable: boolean;
|
|
215
|
+
type: string;
|
|
216
216
|
}
|
|
217
217
|
export interface EmojiDescriptionWithVariations extends EmojiDescription {
|
|
218
218
|
skinVariations?: EmojiDescription[];
|
|
@@ -229,19 +229,19 @@ export type OptionalEmojiDescription = EmojiDescription | undefined;
|
|
|
229
229
|
export type OptionalEmojiDescriptionWithVariations = EmojiDescriptionWithVariations | undefined;
|
|
230
230
|
export type EmojiServiceRepresentation = SpriteServiceRepresentation | ImageRepresentation;
|
|
231
231
|
export interface EmojiServiceDescription {
|
|
232
|
-
|
|
233
|
-
shortName: string;
|
|
234
|
-
name?: string;
|
|
235
|
-
order?: number;
|
|
236
|
-
fallback?: string;
|
|
232
|
+
altRepresentations?: AltRepresentations;
|
|
237
233
|
ascii?: string[];
|
|
234
|
+
category: string;
|
|
238
235
|
createdDate?: string;
|
|
239
236
|
creatorUserId?: string;
|
|
240
|
-
|
|
241
|
-
|
|
237
|
+
fallback?: string;
|
|
238
|
+
id: string;
|
|
239
|
+
name?: string;
|
|
240
|
+
order?: number;
|
|
242
241
|
representation: EmojiServiceRepresentation;
|
|
243
|
-
altRepresentations?: AltRepresentations;
|
|
244
242
|
searchable: boolean;
|
|
243
|
+
shortName: string;
|
|
244
|
+
type: string;
|
|
245
245
|
}
|
|
246
246
|
export interface EmojiServiceDescriptionWithVariations extends EmojiServiceDescription {
|
|
247
247
|
skinVariations?: EmojiServiceDescription[];
|
|
@@ -257,15 +257,15 @@ export interface SpriteSheets {
|
|
|
257
257
|
* (indicated by urls beginning with the url of the token.)
|
|
258
258
|
*/
|
|
259
259
|
export interface MediaApiToken {
|
|
260
|
-
url: string;
|
|
261
260
|
clientId: string;
|
|
262
|
-
jwt: string;
|
|
263
261
|
collectionName: string;
|
|
264
262
|
expiresAt: number;
|
|
263
|
+
jwt: string;
|
|
264
|
+
url: string;
|
|
265
265
|
}
|
|
266
266
|
export interface EmojiMeta {
|
|
267
|
-
spriteSheets?: SpriteSheets;
|
|
268
267
|
mediaApiToken?: MediaApiToken;
|
|
268
|
+
spriteSheets?: SpriteSheets;
|
|
269
269
|
}
|
|
270
270
|
/**
|
|
271
271
|
* The expected response from an Emoji service.
|
|
@@ -279,9 +279,9 @@ export interface EmojiResponse {
|
|
|
279
279
|
mediaApiToken?: MediaApiToken;
|
|
280
280
|
}
|
|
281
281
|
export interface CategoryDescription {
|
|
282
|
+
icon: any;
|
|
282
283
|
id: string;
|
|
283
284
|
name: keyof typeof messages;
|
|
284
|
-
icon: any;
|
|
285
285
|
order: number;
|
|
286
286
|
}
|
|
287
287
|
export interface OnToneSelected {
|
|
@@ -306,8 +306,8 @@ export declare enum SearchSourceTypes {
|
|
|
306
306
|
TYPEAHEAD = "typeahead"
|
|
307
307
|
}
|
|
308
308
|
export interface SearchOptions {
|
|
309
|
-
skinTone?: number;
|
|
310
309
|
limit?: number;
|
|
310
|
+
skinTone?: number;
|
|
311
311
|
sort?: SearchSort;
|
|
312
312
|
source?: SearchSourceTypes;
|
|
313
313
|
}
|
|
@@ -317,12 +317,12 @@ export interface EmojiSearchResult {
|
|
|
317
317
|
}
|
|
318
318
|
export type ToneSelection = number | undefined;
|
|
319
319
|
export interface EmojiUpload {
|
|
320
|
+
dataURL: string;
|
|
321
|
+
filename: string;
|
|
322
|
+
height: number;
|
|
320
323
|
name: string;
|
|
321
324
|
shortName: string;
|
|
322
|
-
filename: string;
|
|
323
|
-
dataURL: string;
|
|
324
325
|
width: number;
|
|
325
|
-
height: number;
|
|
326
326
|
}
|
|
327
327
|
export interface User {
|
|
328
328
|
id: string;
|
|
@@ -12,10 +12,10 @@ interface Duration {
|
|
|
12
12
|
export declare const openedPickerEvent: () => AnalyticsEventPayload;
|
|
13
13
|
export declare const closedPickerEvent: (attributes: Duration) => AnalyticsEventPayload;
|
|
14
14
|
interface EmojiAttributes {
|
|
15
|
-
emojiId: string;
|
|
16
15
|
baseEmojiId?: string;
|
|
17
|
-
skinToneModifier?: string;
|
|
18
16
|
category: string;
|
|
17
|
+
emojiId: string;
|
|
18
|
+
skinToneModifier?: string;
|
|
19
19
|
type: string;
|
|
20
20
|
}
|
|
21
21
|
export declare const pickerClickedEvent: (attributes: {
|
|
@@ -25,8 +25,8 @@ export declare const categoryClickedEvent: (attributes: {
|
|
|
25
25
|
category: string;
|
|
26
26
|
}) => AnalyticsEventPayload;
|
|
27
27
|
export declare const pickerSearchedEvent: (attributes: {
|
|
28
|
-
queryLength: number;
|
|
29
28
|
numMatches: number;
|
|
29
|
+
queryLength: number;
|
|
30
30
|
}) => AnalyticsEventPayload;
|
|
31
31
|
export declare const toneSelectedEvent: (attributes: {
|
|
32
32
|
skinToneModifier: string;
|
|
@@ -6,13 +6,13 @@ interface SamplingInstancesRecord {
|
|
|
6
6
|
[key: string]: boolean;
|
|
7
7
|
}
|
|
8
8
|
interface UFOExperienceSampledRecord {
|
|
9
|
-
sampledInstance: SamplingInstancesRecord;
|
|
10
9
|
sampled: boolean;
|
|
10
|
+
sampledInstance: SamplingInstancesRecord;
|
|
11
11
|
}
|
|
12
12
|
export interface WithSamplingUFOExperience extends Omit<UFOExperience, 'start'> {
|
|
13
13
|
start: (options: {
|
|
14
|
-
samplingRate: number;
|
|
15
14
|
samplingFunc?: SamplingFunc;
|
|
15
|
+
samplingRate: number;
|
|
16
16
|
startTime?: number;
|
|
17
17
|
}) => Promise<void>;
|
|
18
18
|
}
|