@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.
Files changed (135) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/admin/package.json +8 -1
  3. package/dist/cjs/version.json +1 -1
  4. package/dist/es2019/version.json +1 -1
  5. package/dist/esm/version.json +1 -1
  6. package/dist/types/types.d.ts +6 -0
  7. package/dist/types-ts4.0/admin.d.ts +1 -0
  8. package/dist/types-ts4.0/api/EmojiLoader.d.ts +13 -0
  9. package/dist/types-ts4.0/api/EmojiRepository.d.ts +72 -0
  10. package/dist/types-ts4.0/api/EmojiRepositoryRegex.d.ts +1 -0
  11. package/dist/types-ts4.0/api/EmojiResource.d.ts +123 -0
  12. package/dist/types-ts4.0/api/EmojiUtils.d.ts +24 -0
  13. package/dist/types-ts4.0/api/internal/Comparators.d.ts +109 -0
  14. package/dist/types-ts4.0/api/internal/UsageFrequencyTracker.d.ts +46 -0
  15. package/dist/types-ts4.0/api/media/MediaEmojiCache.d.ts +53 -0
  16. package/dist/types-ts4.0/api/media/MediaImageLoader.d.ts +21 -0
  17. package/dist/types-ts4.0/api/media/SiteEmojiResource.d.ts +46 -0
  18. package/dist/types-ts4.0/api/media/TokenManager.d.ts +13 -0
  19. package/dist/types-ts4.0/components/common/CachingEmoji.d.ts +20 -0
  20. package/dist/types-ts4.0/components/common/DeleteButton.d.ts +4 -0
  21. package/dist/types-ts4.0/components/common/Emoji.d.ts +56 -0
  22. package/dist/types-ts4.0/components/common/EmojiActions.d.ts +31 -0
  23. package/dist/types-ts4.0/components/common/EmojiButton.d.ts +12 -0
  24. package/dist/types-ts4.0/components/common/EmojiDeletePreview.d.ts +20 -0
  25. package/dist/types-ts4.0/components/common/EmojiErrorMessage.d.ts +10 -0
  26. package/dist/types-ts4.0/components/common/EmojiImage.d.ts +13 -0
  27. package/dist/types-ts4.0/components/common/EmojiPlaceholder.d.ts +11 -0
  28. package/dist/types-ts4.0/components/common/EmojiPreviewComponent.d.ts +7 -0
  29. package/dist/types-ts4.0/components/common/EmojiUploadPicker.d.ts +17 -0
  30. package/dist/types-ts4.0/components/common/EmojiUploadPreview.d.ts +16 -0
  31. package/dist/types-ts4.0/components/common/FileChooser.d.ts +11 -0
  32. package/dist/types-ts4.0/components/common/LoadingEmojiComponent.d.ts +32 -0
  33. package/dist/types-ts4.0/components/common/Popup.d.ts +12 -0
  34. package/dist/types-ts4.0/components/common/RecordSelectionDefault.d.ts +12 -0
  35. package/dist/types-ts4.0/components/common/ResourcedEmoji.d.ts +18 -0
  36. package/dist/types-ts4.0/components/common/ResourcedEmojiComponent.d.ts +48 -0
  37. package/dist/types-ts4.0/components/common/RetryableButton.d.ts +10 -0
  38. package/dist/types-ts4.0/components/common/Scrollable.d.ts +19 -0
  39. package/dist/types-ts4.0/components/common/ToneSelector.d.ts +12 -0
  40. package/dist/types-ts4.0/components/common/UfoErrorBoundary.d.ts +8 -0
  41. package/dist/types-ts4.0/components/common/UploadEmoji.d.ts +5 -0
  42. package/dist/types-ts4.0/components/common/internal-types.d.ts +11 -0
  43. package/dist/types-ts4.0/components/common/setSkinToneAriaLabelText.d.ts +1 -0
  44. package/dist/types-ts4.0/components/common/styles.d.ts +49 -0
  45. package/dist/types-ts4.0/components/hooks.d.ts +1 -0
  46. package/dist/types-ts4.0/components/i18n.d.ts +172 -0
  47. package/dist/types-ts4.0/components/picker/CategorySelector.d.ts +21 -0
  48. package/dist/types-ts4.0/components/picker/CategoryTracker.d.ts +17 -0
  49. package/dist/types-ts4.0/components/picker/EmojiPicker.d.ts +32 -0
  50. package/dist/types-ts4.0/components/picker/EmojiPickerCategoryHeading.d.ts +8 -0
  51. package/dist/types-ts4.0/components/picker/EmojiPickerComponent.d.ts +28 -0
  52. package/dist/types-ts4.0/components/picker/EmojiPickerEmojiRow.d.ts +12 -0
  53. package/dist/types-ts4.0/components/picker/EmojiPickerFooter.d.ts +7 -0
  54. package/dist/types-ts4.0/components/picker/EmojiPickerList.d.ts +72 -0
  55. package/dist/types-ts4.0/components/picker/EmojiPickerListSearch.d.ts +12 -0
  56. package/dist/types-ts4.0/components/picker/EmojiPickerSizes.d.ts +11 -0
  57. package/dist/types-ts4.0/components/picker/EmojiPickerVirtualItems.d.ts +41 -0
  58. package/dist/types-ts4.0/components/picker/categories.d.ts +7 -0
  59. package/dist/types-ts4.0/components/picker/styles.d.ts +18 -0
  60. package/dist/types-ts4.0/components/typeahead/EmojiTypeAhead.d.ts +27 -0
  61. package/dist/types-ts4.0/components/typeahead/EmojiTypeAheadComponent.d.ts +72 -0
  62. package/dist/types-ts4.0/components/typeahead/EmojiTypeAheadItem.d.ts +14 -0
  63. package/dist/types-ts4.0/components/typeahead/EmojiTypeAheadList.d.ts +35 -0
  64. package/dist/types-ts4.0/components/typeahead/styles.d.ts +10 -0
  65. package/dist/types-ts4.0/components/uploader/EmojiUploadComponent.d.ts +13 -0
  66. package/dist/types-ts4.0/components/uploader/EmojiUploader.d.ts +20 -0
  67. package/dist/types-ts4.0/components/uploader/styles.d.ts +2 -0
  68. package/dist/types-ts4.0/context/EmojiContext.d.ts +4 -0
  69. package/dist/types-ts4.0/context/EmojiContextProvider.d.ts +7 -0
  70. package/dist/types-ts4.0/context/LegacyEmojiContextProvider.d.ts +22 -0
  71. package/dist/types-ts4.0/element.d.ts +3 -0
  72. package/dist/types-ts4.0/hooks/useEmojiContext.d.ts +1 -0
  73. package/dist/types-ts4.0/hooks/usePrevious.d.ts +1 -0
  74. package/dist/types-ts4.0/i18n/cs.d.ts +43 -0
  75. package/dist/types-ts4.0/i18n/da.d.ts +43 -0
  76. package/dist/types-ts4.0/i18n/de.d.ts +43 -0
  77. package/dist/types-ts4.0/i18n/en.d.ts +33 -0
  78. package/dist/types-ts4.0/i18n/en_GB.d.ts +33 -0
  79. package/dist/types-ts4.0/i18n/en_ZZ.d.ts +43 -0
  80. package/dist/types-ts4.0/i18n/es.d.ts +43 -0
  81. package/dist/types-ts4.0/i18n/et.d.ts +39 -0
  82. package/dist/types-ts4.0/i18n/fi.d.ts +43 -0
  83. package/dist/types-ts4.0/i18n/fr.d.ts +43 -0
  84. package/dist/types-ts4.0/i18n/hu.d.ts +43 -0
  85. package/dist/types-ts4.0/i18n/index.d.ts +35 -0
  86. package/dist/types-ts4.0/i18n/is.d.ts +33 -0
  87. package/dist/types-ts4.0/i18n/it.d.ts +43 -0
  88. package/dist/types-ts4.0/i18n/ja.d.ts +43 -0
  89. package/dist/types-ts4.0/i18n/ko.d.ts +43 -0
  90. package/dist/types-ts4.0/i18n/languages.d.ts +27 -0
  91. package/dist/types-ts4.0/i18n/nb.d.ts +43 -0
  92. package/dist/types-ts4.0/i18n/nl.d.ts +43 -0
  93. package/dist/types-ts4.0/i18n/pl.d.ts +43 -0
  94. package/dist/types-ts4.0/i18n/pt_BR.d.ts +43 -0
  95. package/dist/types-ts4.0/i18n/pt_PT.d.ts +39 -0
  96. package/dist/types-ts4.0/i18n/ro.d.ts +33 -0
  97. package/dist/types-ts4.0/i18n/ru.d.ts +43 -0
  98. package/dist/types-ts4.0/i18n/sk.d.ts +39 -0
  99. package/dist/types-ts4.0/i18n/sv.d.ts +43 -0
  100. package/dist/types-ts4.0/i18n/th.d.ts +43 -0
  101. package/dist/types-ts4.0/i18n/tr.d.ts +43 -0
  102. package/dist/types-ts4.0/i18n/uk.d.ts +43 -0
  103. package/dist/types-ts4.0/i18n/vi.d.ts +43 -0
  104. package/dist/types-ts4.0/i18n/zh.d.ts +43 -0
  105. package/dist/types-ts4.0/i18n/zh_TW.d.ts +43 -0
  106. package/dist/types-ts4.0/index.d.ts +25 -0
  107. package/dist/types-ts4.0/picker.d.ts +1 -0
  108. package/dist/types-ts4.0/resource.d.ts +5 -0
  109. package/dist/types-ts4.0/typeahead.d.ts +2 -0
  110. package/dist/types-ts4.0/types.d.ts +357 -0
  111. package/dist/types-ts4.0/util/DuplicateLimitedQueue.d.ts +91 -0
  112. package/dist/types-ts4.0/util/StoredDuplicateLimitedQueue.d.ts +46 -0
  113. package/dist/types-ts4.0/util/analytics/analytics.d.ts +61 -0
  114. package/dist/types-ts4.0/util/analytics/index.d.ts +6 -0
  115. package/dist/types-ts4.0/util/analytics/samplingUfo.d.ts +31 -0
  116. package/dist/types-ts4.0/util/analytics/ufoExperiences.d.ts +14 -0
  117. package/dist/types-ts4.0/util/analytics/useSampledUFOComponentExperience.d.ts +8 -0
  118. package/dist/types-ts4.0/util/browser-support.d.ts +1 -0
  119. package/dist/types-ts4.0/util/constants.d.ts +25 -0
  120. package/dist/types-ts4.0/util/filters.d.ts +8 -0
  121. package/dist/types-ts4.0/util/image.d.ts +10 -0
  122. package/dist/types-ts4.0/util/logger.d.ts +4 -0
  123. package/dist/types-ts4.0/util/mouse.d.ts +8 -0
  124. package/dist/types-ts4.0/util/shared-styles.d.ts +11 -0
  125. package/dist/types-ts4.0/util/storage-available.d.ts +3 -0
  126. package/dist/types-ts4.0/util/type-helpers.d.ts +23 -0
  127. package/dist/types-ts4.0/util/useInView.d.ts +7 -0
  128. package/dist/types-ts4.0/utils.d.ts +3 -0
  129. package/element/package.json +8 -1
  130. package/package.json +15 -8
  131. package/picker/package.json +8 -1
  132. package/resource/package.json +8 -1
  133. package/typeahead/package.json +8 -1
  134. package/types/package.json +8 -1
  135. package/utils/package.json +8 -1
@@ -0,0 +1,56 @@
1
+ /// <reference types="react" />
2
+ import { EmojiDescription, OnEmojiEvent } from '../../types';
3
+ export interface Props {
4
+ /**
5
+ * The emoji to render
6
+ */
7
+ emoji: EmojiDescription;
8
+ /**
9
+ * Show the emoji as selected
10
+ */
11
+ selected?: boolean;
12
+ /**
13
+ * Automatically show the emoji as selected based on mouse hover.
14
+ * CSS, fast, does not require a re-render, but selected state not
15
+ * externally controlled via props.
16
+ */
17
+ selectOnHover?: boolean;
18
+ /**
19
+ * Called when an emoji is selected
20
+ */
21
+ onSelected?: OnEmojiEvent;
22
+ /**
23
+ * Called when the mouse moves over the emoji.
24
+ */
25
+ onMouseMove?: OnEmojiEvent;
26
+ /**
27
+ * Called when an emoji is deleted
28
+ */
29
+ onDelete?: OnEmojiEvent;
30
+ /**
31
+ * Callback for if an emoji image fails to load.
32
+ */
33
+ onLoadError?: OnEmojiEvent<HTMLImageElement>;
34
+ /**
35
+ * Additional css classes, if required.
36
+ */
37
+ className?: string;
38
+ /**
39
+ * Show a tooltip on mouse hover.
40
+ */
41
+ showTooltip?: boolean;
42
+ /**
43
+ * Show a delete button on mouse hover
44
+ * Used only for custom emoji
45
+ */
46
+ showDelete?: boolean;
47
+ /**
48
+ * Fits emoji to height in pixels, keeping aspect ratio
49
+ */
50
+ fitToHeight?: number;
51
+ shouldBeInteractive?: boolean;
52
+ }
53
+ export declare const SpriteEmoji: (props: Props) => JSX.Element;
54
+ export declare const ImageEmoji: (props: Props) => JSX.Element;
55
+ export declare const Emoji: (props: Props) => JSX.Element;
56
+ export default Emoji;
@@ -0,0 +1,31 @@
1
+ import { FC } from 'react';
2
+ import { WrappedComponentProps } from 'react-intl-next';
3
+ import { EmojiDescription, EmojiDescriptionWithVariations, Message, OnToneSelected, OnToneSelectorCancelled, ToneSelection } from '../../types';
4
+ import { OnDeleteEmoji } from '../common/EmojiDeletePreview';
5
+ import { OnUploadEmoji } from '../common/EmojiUploadPicker';
6
+ export interface Props {
7
+ selectedTone?: ToneSelection;
8
+ onToneSelected?: OnToneSelected;
9
+ onToneSelectorCancelled?: OnToneSelectorCancelled;
10
+ toneEmoji?: EmojiDescriptionWithVariations;
11
+ uploading: boolean;
12
+ uploadEnabled: boolean;
13
+ emojiToDelete?: EmojiDescription;
14
+ initialUploadName?: string;
15
+ uploadErrorMessage?: Message;
16
+ onUploadCancelled: () => void;
17
+ onUploadEmoji: OnUploadEmoji;
18
+ onCloseDelete: () => void;
19
+ onDeleteEmoji: OnDeleteEmoji;
20
+ onFileChooserClicked?: () => void;
21
+ onOpenUpload: () => void;
22
+ query?: string;
23
+ onChange: any;
24
+ }
25
+ declare type PropsWithWrappedComponentPropsType = Props & WrappedComponentProps;
26
+ declare type EmojiActionsProps = PropsWithWrappedComponentPropsType;
27
+ export declare const EmojiActions: FC<EmojiActionsProps>;
28
+ declare const _default: FC<import("react-intl-next").WithIntlProps<PropsWithWrappedComponentPropsType>> & {
29
+ WrappedComponent: import("react").ComponentType<PropsWithWrappedComponentPropsType>;
30
+ };
31
+ export default _default;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { EmojiDescription } from '../../types';
3
+ export interface Props {
4
+ emoji: EmojiDescription;
5
+ onSelected?: () => void;
6
+ selectOnHover?: boolean;
7
+ ariaLabelText?: string;
8
+ ariaExpanded?: boolean;
9
+ shouldHideButton?: boolean;
10
+ }
11
+ export declare const EmojiButton: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
12
+ export default EmojiButton;
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import { WrappedComponentProps } from 'react-intl-next';
3
+ import { EmojiDescription } from '../../types';
4
+ export interface OnDeleteEmoji {
5
+ (emoji: EmojiDescription): Promise<boolean>;
6
+ }
7
+ export interface Props {
8
+ emoji: EmojiDescription;
9
+ onDeleteEmoji: OnDeleteEmoji;
10
+ onCloseDelete: () => void;
11
+ errorMessage?: string;
12
+ }
13
+ export interface State {
14
+ loading: boolean;
15
+ error: boolean;
16
+ }
17
+ declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
18
+ WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
19
+ };
20
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ import { Message } from '../../types';
3
+ import { SerializedStyles } from '@emotion/core';
4
+ export interface Props {
5
+ message: Message;
6
+ tooltip?: boolean;
7
+ messageStyles: SerializedStyles;
8
+ }
9
+ declare const EmojiErrorMessage: FC<Props>;
10
+ export default EmojiErrorMessage;
@@ -0,0 +1,13 @@
1
+ import { FC } from 'react';
2
+ import { EmojiId, EmojiImageRepresentation } from '../../types';
3
+ declare type EmojiImageType = {
4
+ emojiId: EmojiId;
5
+ imageUrl: string;
6
+ showImageBeforeLoad?: boolean;
7
+ maxSize?: number;
8
+ representation?: EmojiImageRepresentation;
9
+ showTooltip?: boolean;
10
+ onImageLoadError?: () => void;
11
+ };
12
+ export declare const EmojiImage: FC<EmojiImageType>;
13
+ export {};
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { EmojiImageRepresentation } from '../../types';
3
+ export interface Props {
4
+ shortName: string;
5
+ size?: number;
6
+ showTooltip?: boolean;
7
+ representation?: EmojiImageRepresentation;
8
+ loading?: boolean;
9
+ }
10
+ declare const EmojiPlaceholder: (props: Props) => JSX.Element;
11
+ export default EmojiPlaceholder;
@@ -0,0 +1,7 @@
1
+ import { EmojiDescription } from '../../types';
2
+ import { FC } from 'react';
3
+ declare type Props = {
4
+ emoji: EmojiDescription;
5
+ };
6
+ export declare const EmojiPreviewComponent: FC<Props>;
7
+ export {};
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { WrappedComponentProps } from 'react-intl-next';
3
+ import { EmojiUpload, Message } from '../../types';
4
+ export interface OnUploadEmoji {
5
+ (upload: EmojiUpload, retry: boolean, onSuccessHandler?: () => void): void;
6
+ }
7
+ export interface Props {
8
+ onUploadEmoji: OnUploadEmoji;
9
+ onUploadCancelled: () => void;
10
+ onFileChooserClicked?: () => void;
11
+ errorMessage?: Message;
12
+ initialUploadName?: string;
13
+ }
14
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
15
+ WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
16
+ };
17
+ export default _default;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { WrappedComponentProps } from 'react-intl-next';
3
+ import { Message } from '../../types';
4
+ import { UploadStatus } from './internal-types';
5
+ export interface EmojiUploadPreviewProps {
6
+ name: string;
7
+ previewImage: string;
8
+ uploadStatus?: UploadStatus;
9
+ errorMessage?: Message;
10
+ onUploadCancelled: () => void;
11
+ onAddEmoji: () => void;
12
+ }
13
+ declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<EmojiUploadPreviewProps & WrappedComponentProps<"intl">>> & {
14
+ WrappedComponent: import("react").ComponentType<EmojiUploadPreviewProps & WrappedComponentProps<"intl">>;
15
+ };
16
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { FC, ChangeEventHandler } from 'react';
2
+ export interface Props {
3
+ label: string;
4
+ ariaDescribedBy?: string;
5
+ onChange?: ChangeEventHandler<any>;
6
+ onClick?: () => void;
7
+ accept?: string;
8
+ isDisabled?: boolean;
9
+ }
10
+ declare const FileChooser: FC<Props>;
11
+ export default FileChooser;
@@ -0,0 +1,32 @@
1
+ import { Component, ComponentType } from 'react';
2
+ import { EmojiProvider } from '../../api/EmojiResource';
3
+ export interface Props {
4
+ /**
5
+ * Emoji Resource instance
6
+ */
7
+ emojiProvider: Promise<EmojiProvider>;
8
+ }
9
+ export interface State {
10
+ loadedEmojiProvider?: EmojiProvider;
11
+ asyncLoadedComponent?: ComponentType<any>;
12
+ }
13
+ /**
14
+ * A base class for components that don't want to start rendering
15
+ * until the EmojiProvider is resolved.
16
+ * Notes: super.componentDidMount and super.componentWillUnmount will need to be
17
+ * called explicitly if they are overridden on the child class.
18
+ */
19
+ export default abstract class LoadingEmojiComponent<P extends Props, S extends State> extends Component<P, S> {
20
+ private isUnmounted;
21
+ constructor(props: P, state: S);
22
+ componentDidMount(): void;
23
+ UNSAFE_componentWillReceiveProps(nextProps: Readonly<P>): void;
24
+ componentWillUnmount(): void;
25
+ private loadEmojiProvider;
26
+ private loaded;
27
+ abstract asyncLoadComponent(): void;
28
+ protected setAsyncState(asyncLoadedComponent: ComponentType<any>): void;
29
+ renderLoading(): JSX.Element | null;
30
+ abstract renderLoaded(loadedEmojiProvider: EmojiProvider, asyncLoadedComponent: ComponentType<any>): JSX.Element | null;
31
+ render(): JSX.Element | null;
32
+ }
@@ -0,0 +1,12 @@
1
+ import { ReactElement, FC } from 'react';
2
+ import { RelativePosition } from '../../types';
3
+ export interface Props {
4
+ target: string | Element;
5
+ relativePosition?: RelativePosition;
6
+ offsetX?: number;
7
+ offsetY?: number;
8
+ zIndex?: string | number;
9
+ children: ReactElement<any>;
10
+ }
11
+ declare const Popup: FC<Props>;
12
+ export default Popup;
@@ -0,0 +1,12 @@
1
+ import { EmojiInsertionAnalytic } from '../../util/analytics';
2
+ import { OnEmojiEvent } from '../../types';
3
+ import { EmojiProvider } from '../../api/EmojiResource';
4
+ /**
5
+ * A function that will wrap any configured Emoji 'onSelection' function to ensure recordSelection is always
6
+ * called.
7
+ *
8
+ * @param provider the EmojiProvider which will be called on each emoji selection
9
+ * @param onSelect the onSelect function that is explicitly configured on the Emoji component.
10
+ * @param fireAnalytics a function used to fire analytics events.
11
+ */
12
+ export declare const createRecordSelectionDefault: <T>(provider: EmojiProvider, onSelect?: OnEmojiEvent<T> | undefined, fireAnalytics?: ((producer: EmojiInsertionAnalytic) => void) | undefined) => OnEmojiEvent<T>;
@@ -0,0 +1,18 @@
1
+ import React, { FC } from 'react';
2
+ import { ComponentClass } from 'react';
3
+ import LoadingEmojiComponent, { Props as LoadingProps, State as LoadingState } from './LoadingEmojiComponent';
4
+ import EmojiProvider from '../../api/EmojiResource';
5
+ import { Props as ComponentProps, BaseResourcedEmojiProps } from './ResourcedEmojiComponent';
6
+ export interface Props extends BaseResourcedEmojiProps, LoadingProps {
7
+ }
8
+ export default class ResourcedEmoji extends LoadingEmojiComponent<Props, LoadingState> {
9
+ static AsyncLoadedComponent: FC<ComponentProps>;
10
+ state: {
11
+ asyncLoadedComponent: React.FC<ComponentProps>;
12
+ };
13
+ constructor(props: Props);
14
+ componentWillUnmount(): void;
15
+ asyncLoadComponent(): void;
16
+ renderLoading(): JSX.Element;
17
+ renderLoaded(loadedEmojiProvider: EmojiProvider, ResourcedEmojiComponent: ComponentClass<ComponentProps>): JSX.Element;
18
+ }
@@ -0,0 +1,48 @@
1
+ import { FC } from 'react';
2
+ import { EmojiResource } from '../../api/EmojiResource';
3
+ import { EmojiId } from '../../types';
4
+ export interface BaseResourcedEmojiProps {
5
+ /**
6
+ * Emoji to display
7
+ */
8
+ emojiId: EmojiId;
9
+ /**
10
+ * Allows to show the tooltip.
11
+ * Defaults to `false`.
12
+ */
13
+ showTooltip?: boolean;
14
+ /**
15
+ * Scales the emoji proportionally to provided hight.
16
+ * Defaults to `undefined`.
17
+ */
18
+ fitToHeight?: number;
19
+ /**
20
+ * Optimistic will call the fetch interface first and not wait for the entire emoji collection
21
+ * to be available before rendering. This is useful for views or pages that show a select set of
22
+ * emojis.
23
+ * Defaults to `false`.
24
+ */
25
+ optimistic?: boolean;
26
+ /**
27
+ * Custom Fallback allows a custom element or string to be rendered if an emoji fails to be fetched or found.
28
+ * By default it takes the fallback or shortName inside emojiId, but if this prop is set it override the internal
29
+ * fallbacks
30
+ * customFallback<Element | string> else emojiId.fallback else emojiId.shortName.
31
+ * Defaults to `undefined`.
32
+ */
33
+ customFallback?: JSX.Element | string;
34
+ /**
35
+ * Will attempt to render a highly condensed version of the emoji with an image url before showing the meta version.
36
+ * All that is required for optimistic images to render is an emojiId, imageUrl and sizing props.
37
+ * Defaults to `undefined`.
38
+ */
39
+ optimisticImageURL?: string;
40
+ }
41
+ export interface Props extends BaseResourcedEmojiProps {
42
+ /**
43
+ * EmojiResource instance that handles fetching of emoji data.
44
+ */
45
+ emojiProvider: EmojiResource;
46
+ }
47
+ export declare const ResourcedEmojiComponent: FC<Props>;
48
+ export default ResourcedEmojiComponent;
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ export interface Props {
3
+ label: string;
4
+ appearance: string;
5
+ error: boolean;
6
+ onSubmit: () => void;
7
+ loading: boolean;
8
+ }
9
+ declare const RetryableButton: FC<Props>;
10
+ export default RetryableButton;
@@ -0,0 +1,19 @@
1
+ import { MouseEventHandler, PureComponent, ReactNode, UIEvent } from 'react';
2
+ export interface OnScroll {
3
+ (element: Element, event: UIEvent<any>): void;
4
+ }
5
+ export interface Props {
6
+ className?: string;
7
+ maxHeight?: string;
8
+ children?: ReactNode;
9
+ onScroll?: OnScroll;
10
+ onMouseLeave?: MouseEventHandler<any>;
11
+ }
12
+ export default class Scrollable extends PureComponent<Props, {}> {
13
+ private scrollableDiv;
14
+ reveal: (child: HTMLElement, forceToTop?: boolean | undefined) => void;
15
+ scrollToBottom: () => void;
16
+ private handleScroll;
17
+ private handleRef;
18
+ render(): JSX.Element;
19
+ }
@@ -0,0 +1,12 @@
1
+ import React, { FC } from 'react';
2
+ import { EmojiDescriptionWithVariations, OnToneSelected } from '../../types';
3
+ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
4
+ export interface Props {
5
+ emoji: EmojiDescriptionWithVariations;
6
+ onToneSelected: OnToneSelected;
7
+ previewEmojiId?: string;
8
+ }
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>>;
12
+ export default ToneSelector;
@@ -0,0 +1,8 @@
1
+ import React, { ErrorInfo } from 'react';
2
+ import { UFOExperience } from '@atlaskit/ufo';
3
+ export declare class UfoErrorBoundary extends React.Component<{
4
+ experiences: UFOExperience[];
5
+ }> {
6
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
7
+ render(): React.ReactNode;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { MessageDescriptor } from 'react-intl-next';
2
+ import { EmojiProvider } from '../../api/EmojiResource';
3
+ import { EmojiDescription, EmojiUpload } from '../../types';
4
+ import { AnalyticsEventPayload } from '@atlaskit/analytics-next';
5
+ export declare const uploadEmoji: (upload: EmojiUpload, emojiProvider: EmojiProvider, errorSetter: (message: MessageDescriptor | undefined) => void, onSuccess: (emojiDescription: EmojiDescription) => void, fireAnalytics: (event: AnalyticsEventPayload) => void, retry: boolean) => void;
@@ -0,0 +1,11 @@
1
+ import { EmojiProvider } from '../../api/EmojiResource';
2
+ export interface EmojiContext {
3
+ emoji: {
4
+ emojiProvider: EmojiProvider;
5
+ };
6
+ }
7
+ export declare enum UploadStatus {
8
+ Waiting = 0,
9
+ Uploading = 1,
10
+ Error = 2
11
+ }
@@ -0,0 +1 @@
1
+ export declare const setSkinToneAriaLabelText: (tone?: string | undefined) => string | undefined;
@@ -0,0 +1,49 @@
1
+ export declare const commonSelectedStyles = "emoji-common-selected";
2
+ export declare const selectOnHoverStyles = "emoji-common-select-on-hover";
3
+ export declare const emojiSprite = "emoji-common-emoji-sprite";
4
+ export declare const emojiNodeStyles = "emoji-common-node";
5
+ export declare const emojiImage = "emoji-common-emoji-image";
6
+ export declare const emojiDeleteButton = "emoji-common-deleteButton";
7
+ export declare const emojiMainStyle = "emoji-common-main-styles";
8
+ export declare const deleteButton: import("@emotion/utils").SerializedStyles;
9
+ export declare const emojiToneSelectorContainer: import("@emotion/utils").SerializedStyles;
10
+ export declare const emojiStyles: import("@emotion/utils").SerializedStyles;
11
+ export declare const emojiContainer: import("@emotion/utils").SerializedStyles;
12
+ export declare const placeholder = "emoji-common-placeholder";
13
+ export declare const placeholderContainer: import("@emotion/utils").SerializedStyles;
14
+ export declare const placeholderContainerAnimated: import("@emotion/utils").SerializedStyles;
15
+ export declare const emojiButton: import("@emotion/utils").SerializedStyles;
16
+ export declare const hiddenToneButton: import("@emotion/utils").SerializedStyles;
17
+ export declare const emojiPickerAddEmoji = "emoji-picker-add-emoji";
18
+ export declare const previewText: import("@emotion/utils").SerializedStyles;
19
+ export declare const emojiName: import("@emotion/utils").SerializedStyles;
20
+ export declare const emojiShortName: import("@emotion/utils").SerializedStyles;
21
+ export declare const preview: import("@emotion/utils").SerializedStyles;
22
+ export declare const previewImg: import("@emotion/utils").SerializedStyles;
23
+ export declare const emojiScrollable: import("@emotion/utils").SerializedStyles;
24
+ export declare const emojiUpload: import("@emotion/utils").SerializedStyles;
25
+ export declare const uploadChooseFileMessage: import("@emotion/utils").SerializedStyles;
26
+ export declare const emojiUploadBottom: import("@emotion/utils").SerializedStyles;
27
+ export declare const uploadChooseFileRow: import("@emotion/utils").SerializedStyles;
28
+ export declare const uploadChooseFileEmojiName: import("@emotion/utils").SerializedStyles;
29
+ export declare const uploadChooseFileBrowse: import("@emotion/utils").SerializedStyles;
30
+ export declare const uploadPreviewFooter: import("@emotion/utils").SerializedStyles;
31
+ export declare const uploadPreview: import("@emotion/utils").SerializedStyles;
32
+ export declare const uploadPreviewText: import("@emotion/utils").SerializedStyles;
33
+ export declare const bigEmojiPreview: import("@emotion/utils").SerializedStyles;
34
+ export declare const uploadAddRow: import("@emotion/utils").SerializedStyles;
35
+ export declare const addCustomEmoji: import("@emotion/utils").SerializedStyles;
36
+ export declare const submitDelete = "emoji-submit-delete";
37
+ export declare const deletePreview: import("@emotion/utils").SerializedStyles;
38
+ export declare const deleteText: import("@emotion/utils").SerializedStyles;
39
+ export declare const previewButtonGroup: import("@emotion/utils").SerializedStyles;
40
+ export declare const deleteFooter: import("@emotion/utils").SerializedStyles;
41
+ export declare const emojiDeleteErrorMessage: import("@emotion/utils").SerializedStyles;
42
+ export declare const emojiChooseFileErrorMessage: import("@emotion/utils").SerializedStyles;
43
+ export declare const emojiPreviewErrorMessage: import("@emotion/utils").SerializedStyles;
44
+ export declare const addCustomEmojiButton: import("@emotion/utils").SerializedStyles;
45
+ export declare const uploadRetryButton: import("@emotion/utils").SerializedStyles;
46
+ export declare const uploadEmojiButton: import("@emotion/utils").SerializedStyles;
47
+ export declare const cancelButton: import("@emotion/utils").SerializedStyles;
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;
@@ -0,0 +1,172 @@
1
+ export declare const messages: {
2
+ deleteEmojiTitle: {
3
+ id: string;
4
+ defaultMessage: string;
5
+ description: string;
6
+ };
7
+ deleteEmojiDescription: {
8
+ id: string;
9
+ defaultMessage: string;
10
+ description: string;
11
+ };
12
+ deleteEmojiLabel: {
13
+ id: string;
14
+ defaultMessage: string;
15
+ description: string;
16
+ };
17
+ addCustomEmojiLabel: {
18
+ id: string;
19
+ defaultMessage: string;
20
+ description: string;
21
+ };
22
+ emojiPlaceholder: {
23
+ id: string;
24
+ defaultMessage: string;
25
+ description: string;
26
+ };
27
+ emojiNameAriaLabel: {
28
+ id: string;
29
+ defaultMessage: string;
30
+ description: string;
31
+ };
32
+ emojiChooseFileTitle: {
33
+ id: string;
34
+ defaultMessage: string;
35
+ description: string;
36
+ };
37
+ emojiChooseFileScreenReaderDescription: {
38
+ id: string;
39
+ defaultMessage: string;
40
+ description: string;
41
+ };
42
+ emojiSelectSkinToneButtonAriaLabelText: {
43
+ id: string;
44
+ defaultMessage: string;
45
+ description: string;
46
+ };
47
+ emojiImageRequirements: {
48
+ id: string;
49
+ defaultMessage: string;
50
+ description: string;
51
+ };
52
+ emojiPreviewTitle: {
53
+ id: string;
54
+ defaultMessage: string;
55
+ description: string;
56
+ };
57
+ emojiPreview: {
58
+ id: string;
59
+ defaultMessage: string;
60
+ description: string;
61
+ };
62
+ addEmojiLabel: {
63
+ id: string;
64
+ defaultMessage: string;
65
+ description: string;
66
+ };
67
+ retryLabel: {
68
+ id: string;
69
+ defaultMessage: string;
70
+ description: string;
71
+ };
72
+ cancelLabel: {
73
+ id: string;
74
+ defaultMessage: string;
75
+ description: string;
76
+ };
77
+ searchPlaceholder: {
78
+ id: string;
79
+ defaultMessage: string;
80
+ description: string;
81
+ };
82
+ searchLabel: {
83
+ id: string;
84
+ defaultMessage: string;
85
+ description: string;
86
+ };
87
+ categoriesSearchResults: {
88
+ id: string;
89
+ defaultMessage: string;
90
+ description: string;
91
+ };
92
+ frequentCategory: {
93
+ id: string;
94
+ defaultMessage: string;
95
+ description: string;
96
+ };
97
+ peopleCategory: {
98
+ id: string;
99
+ defaultMessage: string;
100
+ description: string;
101
+ };
102
+ natureCategory: {
103
+ id: string;
104
+ defaultMessage: string;
105
+ description: string;
106
+ };
107
+ foodsCategory: {
108
+ id: string;
109
+ defaultMessage: string;
110
+ description: string;
111
+ };
112
+ activityCategory: {
113
+ id: string;
114
+ defaultMessage: string;
115
+ description: string;
116
+ };
117
+ placesCategory: {
118
+ id: string;
119
+ defaultMessage: string;
120
+ description: string;
121
+ };
122
+ objectsCategory: {
123
+ id: string;
124
+ defaultMessage: string;
125
+ description: string;
126
+ };
127
+ symbolsCategory: {
128
+ id: string;
129
+ defaultMessage: string;
130
+ description: string;
131
+ };
132
+ flagsCategory: {
133
+ id: string;
134
+ defaultMessage: string;
135
+ description: string;
136
+ };
137
+ productivityCategory: {
138
+ id: string;
139
+ defaultMessage: string;
140
+ description: string;
141
+ };
142
+ userUploadsCustomCategory: {
143
+ id: string;
144
+ defaultMessage: string;
145
+ description: string;
146
+ };
147
+ allUploadsCustomCategory: {
148
+ id: string;
149
+ defaultMessage: string;
150
+ description: string;
151
+ };
152
+ deleteEmojiFailed: {
153
+ id: string;
154
+ defaultMessage: string;
155
+ description: string;
156
+ };
157
+ emojiInvalidImage: {
158
+ id: string;
159
+ defaultMessage: string;
160
+ description: string;
161
+ };
162
+ emojiUploadFailed: {
163
+ id: string;
164
+ defaultMessage: string;
165
+ description: string;
166
+ };
167
+ emojiImageTooBig: {
168
+ id: string;
169
+ defaultMessage: string;
170
+ description: string;
171
+ };
172
+ };