@atlaskit/emoji 69.0.1 → 69.0.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.
Files changed (125) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/afm-jira/tsconfig.json +3 -0
  4. package/afm-post-office/tsconfig.json +3 -0
  5. package/dist/cjs/components/compiled/common/EmojiActions.js +1 -1
  6. package/dist/cjs/components/compiled/common/EmojiPreviewComponent.compiled.css +0 -1
  7. package/dist/cjs/components/compiled/common/EmojiPreviewComponent.js +1 -1
  8. package/dist/cjs/components/compiled/picker/CategorySelector.compiled.css +24 -0
  9. package/dist/cjs/components/compiled/picker/CategorySelector.js +161 -0
  10. package/dist/cjs/components/compiled/picker/EmojiPicker.compiled.css +12 -0
  11. package/dist/cjs/components/compiled/picker/EmojiPicker.js +109 -0
  12. package/dist/cjs/components/compiled/picker/EmojiPickerCategoryHeading.compiled.css +9 -0
  13. package/dist/cjs/components/compiled/picker/EmojiPickerCategoryHeading.js +43 -0
  14. package/dist/cjs/components/compiled/picker/EmojiPickerComponent.compiled.css +20 -0
  15. package/dist/cjs/components/compiled/picker/EmojiPickerComponent.js +574 -0
  16. package/dist/cjs/components/compiled/picker/EmojiPickerEmojiRow.compiled.css +35 -0
  17. package/dist/cjs/components/compiled/picker/EmojiPickerEmojiRow.js +76 -0
  18. package/dist/cjs/components/compiled/picker/EmojiPickerFooter.compiled.css +5 -0
  19. package/dist/cjs/components/compiled/picker/EmojiPickerFooter.js +33 -0
  20. package/dist/cjs/components/compiled/picker/EmojiPickerListSearch.compiled.css +23 -0
  21. package/dist/cjs/components/compiled/picker/EmojiPickerListSearch.js +93 -0
  22. package/dist/cjs/components/compiled/picker/EmojiPickerTabPanel.compiled.css +6 -0
  23. package/dist/cjs/components/compiled/picker/EmojiPickerTabPanel.js +60 -0
  24. package/dist/cjs/components/compiled/picker/EmojiPickerVirtualItems.compiled.css +8 -0
  25. package/dist/cjs/components/compiled/picker/EmojiPickerVirtualItems.js +86 -0
  26. package/dist/cjs/components/compiled/picker/VirtualList.compiled.css +10 -0
  27. package/dist/cjs/components/compiled/picker/VirtualList.js +303 -0
  28. package/dist/cjs/components/picker/EmojiPickerFooter.js +0 -2
  29. package/dist/cjs/components/picker/EmojiPickerList.js +219 -145
  30. package/dist/cjs/components/picker/EmojiPickerTabPanel.js +67 -0
  31. package/dist/cjs/components/picker/styles.js +1 -10
  32. package/dist/cjs/index.js +4 -6
  33. package/dist/cjs/picker.js +5 -7
  34. package/dist/cjs/util/analytics/analytics.js +1 -1
  35. package/dist/es2019/components/compiled/common/EmojiActions.js +1 -1
  36. package/dist/es2019/components/compiled/common/EmojiPreviewComponent.compiled.css +0 -1
  37. package/dist/es2019/components/compiled/common/EmojiPreviewComponent.js +1 -1
  38. package/dist/es2019/components/compiled/picker/CategorySelector.compiled.css +24 -0
  39. package/dist/es2019/components/compiled/picker/CategorySelector.js +136 -0
  40. package/dist/es2019/components/compiled/picker/EmojiPicker.compiled.css +12 -0
  41. package/dist/es2019/components/compiled/picker/EmojiPicker.js +67 -0
  42. package/dist/es2019/components/compiled/picker/EmojiPickerCategoryHeading.compiled.css +9 -0
  43. package/dist/es2019/components/compiled/picker/EmojiPickerCategoryHeading.js +30 -0
  44. package/dist/es2019/components/compiled/picker/EmojiPickerComponent.compiled.css +19 -0
  45. package/dist/es2019/components/compiled/picker/EmojiPickerComponent.js +506 -0
  46. package/dist/es2019/components/compiled/picker/EmojiPickerEmojiRow.compiled.css +35 -0
  47. package/dist/es2019/components/compiled/picker/EmojiPickerEmojiRow.js +69 -0
  48. package/dist/es2019/components/compiled/picker/EmojiPickerFooter.compiled.css +5 -0
  49. package/dist/es2019/components/compiled/picker/EmojiPickerFooter.js +19 -0
  50. package/dist/es2019/components/compiled/picker/EmojiPickerListSearch.compiled.css +23 -0
  51. package/dist/es2019/components/compiled/picker/EmojiPickerListSearch.js +79 -0
  52. package/dist/es2019/components/compiled/picker/EmojiPickerTabPanel.compiled.css +6 -0
  53. package/dist/es2019/components/compiled/picker/EmojiPickerTabPanel.js +39 -0
  54. package/dist/es2019/components/compiled/picker/EmojiPickerVirtualItems.compiled.css +8 -0
  55. package/dist/es2019/components/compiled/picker/EmojiPickerVirtualItems.js +51 -0
  56. package/dist/es2019/components/compiled/picker/VirtualList.compiled.css +10 -0
  57. package/dist/es2019/components/compiled/picker/VirtualList.js +288 -0
  58. package/dist/es2019/components/picker/EmojiPickerFooter.js +1 -1
  59. package/dist/es2019/components/picker/EmojiPickerList.js +186 -114
  60. package/dist/es2019/components/picker/EmojiPickerTabPanel.js +48 -0
  61. package/dist/es2019/components/picker/styles.js +0 -9
  62. package/dist/es2019/index.js +2 -1
  63. package/dist/es2019/picker.js +5 -1
  64. package/dist/es2019/util/analytics/analytics.js +1 -1
  65. package/dist/esm/components/compiled/common/EmojiActions.js +1 -1
  66. package/dist/esm/components/compiled/common/EmojiPreviewComponent.compiled.css +0 -1
  67. package/dist/esm/components/compiled/common/EmojiPreviewComponent.js +1 -1
  68. package/dist/esm/components/compiled/picker/CategorySelector.compiled.css +24 -0
  69. package/dist/esm/components/compiled/picker/CategorySelector.js +151 -0
  70. package/dist/esm/components/compiled/picker/EmojiPicker.compiled.css +12 -0
  71. package/dist/esm/components/compiled/picker/EmojiPicker.js +97 -0
  72. package/dist/esm/components/compiled/picker/EmojiPickerCategoryHeading.compiled.css +9 -0
  73. package/dist/esm/components/compiled/picker/EmojiPickerCategoryHeading.js +34 -0
  74. package/dist/esm/components/compiled/picker/EmojiPickerComponent.compiled.css +20 -0
  75. package/dist/esm/components/compiled/picker/EmojiPickerComponent.js +564 -0
  76. package/dist/esm/components/compiled/picker/EmojiPickerEmojiRow.compiled.css +35 -0
  77. package/dist/esm/components/compiled/picker/EmojiPickerEmojiRow.js +66 -0
  78. package/dist/esm/components/compiled/picker/EmojiPickerFooter.compiled.css +5 -0
  79. package/dist/esm/components/compiled/picker/EmojiPickerFooter.js +24 -0
  80. package/dist/esm/components/compiled/picker/EmojiPickerListSearch.compiled.css +23 -0
  81. package/dist/esm/components/compiled/picker/EmojiPickerListSearch.js +83 -0
  82. package/dist/esm/components/compiled/picker/EmojiPickerTabPanel.compiled.css +6 -0
  83. package/dist/esm/components/compiled/picker/EmojiPickerTabPanel.js +50 -0
  84. package/dist/esm/components/compiled/picker/EmojiPickerVirtualItems.compiled.css +8 -0
  85. package/dist/esm/components/compiled/picker/EmojiPickerVirtualItems.js +76 -0
  86. package/dist/esm/components/compiled/picker/VirtualList.compiled.css +10 -0
  87. package/dist/esm/components/compiled/picker/VirtualList.js +293 -0
  88. package/dist/esm/components/picker/EmojiPickerFooter.js +1 -1
  89. package/dist/esm/components/picker/EmojiPickerList.js +219 -147
  90. package/dist/esm/components/picker/EmojiPickerTabPanel.js +59 -0
  91. package/dist/esm/components/picker/styles.js +0 -9
  92. package/dist/esm/index.js +2 -1
  93. package/dist/esm/picker.js +5 -1
  94. package/dist/esm/util/analytics/analytics.js +1 -1
  95. package/dist/types/components/compiled/picker/CategorySelector.d.ts +17 -0
  96. package/dist/types/components/compiled/picker/EmojiPicker.d.ts +44 -0
  97. package/dist/types/components/compiled/picker/EmojiPickerCategoryHeading.d.ts +13 -0
  98. package/dist/types/components/compiled/picker/EmojiPickerComponent.d.ts +24 -0
  99. package/dist/types/components/compiled/picker/EmojiPickerEmojiRow.d.ts +17 -0
  100. package/dist/types/components/compiled/picker/EmojiPickerFooter.d.ts +8 -0
  101. package/dist/types/components/compiled/picker/EmojiPickerListSearch.d.ts +11 -0
  102. package/dist/types/components/compiled/picker/EmojiPickerTabPanel.d.ts +21 -0
  103. package/dist/types/components/compiled/picker/EmojiPickerVirtualItems.d.ts +35 -0
  104. package/dist/types/components/compiled/picker/VirtualList.d.ts +42 -0
  105. package/dist/types/components/picker/EmojiPickerList.d.ts +1 -6
  106. package/dist/types/components/picker/EmojiPickerTabPanel.d.ts +21 -0
  107. package/dist/types/components/picker/styles.d.ts +0 -1
  108. package/dist/types/index.d.ts +2 -1
  109. package/dist/types/picker.d.ts +3 -1
  110. package/dist/types-ts4.5/components/compiled/picker/CategorySelector.d.ts +17 -0
  111. package/dist/types-ts4.5/components/compiled/picker/EmojiPicker.d.ts +44 -0
  112. package/dist/types-ts4.5/components/compiled/picker/EmojiPickerCategoryHeading.d.ts +13 -0
  113. package/dist/types-ts4.5/components/compiled/picker/EmojiPickerComponent.d.ts +24 -0
  114. package/dist/types-ts4.5/components/compiled/picker/EmojiPickerEmojiRow.d.ts +17 -0
  115. package/dist/types-ts4.5/components/compiled/picker/EmojiPickerFooter.d.ts +8 -0
  116. package/dist/types-ts4.5/components/compiled/picker/EmojiPickerListSearch.d.ts +11 -0
  117. package/dist/types-ts4.5/components/compiled/picker/EmojiPickerTabPanel.d.ts +21 -0
  118. package/dist/types-ts4.5/components/compiled/picker/EmojiPickerVirtualItems.d.ts +35 -0
  119. package/dist/types-ts4.5/components/compiled/picker/VirtualList.d.ts +42 -0
  120. package/dist/types-ts4.5/components/picker/EmojiPickerList.d.ts +1 -6
  121. package/dist/types-ts4.5/components/picker/EmojiPickerTabPanel.d.ts +21 -0
  122. package/dist/types-ts4.5/components/picker/styles.d.ts +0 -1
  123. package/dist/types-ts4.5/index.d.ts +2 -1
  124. package/dist/types-ts4.5/picker.d.ts +3 -1
  125. package/package.json +3 -2
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import type { ComponentClass } from 'react';
6
+ import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
7
+ import type { EmojiProvider } from '../../../api/EmojiResource';
8
+ import type { OnEmojiEvent, PickerSize } from '../../../types';
9
+ import LoadingEmojiComponent, { type Props as LoadingProps, type State as LoadingState } from '../../common/LoadingEmojiComponent';
10
+ import type { PickerRefHandler, Props as ComponentProps } from './EmojiPickerComponent';
11
+ export declare const preloadEmojiPicker: () => void;
12
+ export interface Props extends LoadingProps {
13
+ /**
14
+ * Callback to be executed on emoji selection.
15
+ */
16
+ onSelection?: OnEmojiEvent;
17
+ /**
18
+ * Callback to handle picker reference.
19
+ */
20
+ onPickerRef?: PickerRefHandler;
21
+ /**
22
+ * Flag to disable tone selector.
23
+ */
24
+ hideToneSelector?: boolean;
25
+ /**
26
+ * Size of Emoji Picker. default value is 'medium'.
27
+ */
28
+ size?: PickerSize;
29
+ }
30
+ export declare class EmojiPickerInternal extends LoadingEmojiComponent<Props & WithAnalyticsEventsProps, LoadingState> {
31
+ static AsyncLoadedComponent?: React.ComponentType<React.PropsWithChildren<ComponentProps>>;
32
+ static defaultProps: {
33
+ size: string;
34
+ };
35
+ state: {
36
+ asyncLoadedComponent: import("react").ComponentType<import("react").PropsWithChildren<ComponentProps>> | undefined;
37
+ };
38
+ constructor(props: Props);
39
+ asyncLoadComponent(): void;
40
+ renderLoading(): JSX.Element | null;
41
+ renderLoaded(loadedEmojiProvider: EmojiProvider, EmojiPickerComponent: ComponentClass<ComponentProps>): JSX.Element;
42
+ }
43
+ declare const EmojiPicker: import("react").ForwardRefExoticComponent<Omit<Props & WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any>>;
44
+ export default EmojiPicker;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { CategoryGroupKey } from '../../picker/categories';
3
+ /**
4
+ * Test id for wrapper Emoji Picker List div
5
+ */
6
+ export declare const RENDER_EMOJI_PICKER_CATEGORY_HEADING_TESTID = "render-emoji-picker-categorty-heading";
7
+ export interface Props {
8
+ id: CategoryGroupKey;
9
+ title: string;
10
+ className?: string;
11
+ }
12
+ declare const EmojiPickerCategoryHeading: ({ id, title, className }: Props) => JSX.Element;
13
+ export default EmojiPickerCategoryHeading;
@@ -0,0 +1,24 @@
1
+ /// <reference types="react" />
2
+ import { type OnEmojiEvent, type PickerSize } from '../../../types';
3
+ import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
4
+ export interface PickerRefHandler {
5
+ (ref: any): any;
6
+ }
7
+ export interface Props {
8
+ /**
9
+ * Callback to be executed when user selects an emoji.
10
+ */
11
+ onSelection?: OnEmojiEvent;
12
+ /**
13
+ * Callback performed when picker reference is being set.
14
+ */
15
+ onPickerRef?: PickerRefHandler;
16
+ /**
17
+ * Flag to disable tone selector.
18
+ */
19
+ hideToneSelector?: boolean;
20
+ createAnalyticsEvent?: CreateUIAnalyticsEvent;
21
+ size?: PickerSize;
22
+ }
23
+ declare const _default: import("react").MemoExoticComponent<({ onSelection, onPickerRef, hideToneSelector, createAnalyticsEvent, size, }: Props) => JSX.Element>;
24
+ export default _default;
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import type { EmojiDescription, OnEmojiEvent } from '../../../types';
3
+ import type { VirtualItem as VirtualItemContext } from '@tanstack/react-virtual';
4
+ import type { CategoryGroupKey } from '../../picker/categories';
5
+ export interface Props {
6
+ category: CategoryGroupKey;
7
+ emojis: EmojiDescription[];
8
+ title: string;
9
+ showDelete: boolean;
10
+ onSelected?: OnEmojiEvent;
11
+ onMouseMove?: OnEmojiEvent;
12
+ onFocus?: OnEmojiEvent;
13
+ onDelete?: OnEmojiEvent;
14
+ virtualItemContext?: VirtualItemContext;
15
+ }
16
+ declare const _default: import("react").MemoExoticComponent<({ emojis, onSelected, onMouseMove, onFocus, title, showDelete, onDelete, virtualItemContext, }: Props) => JSX.Element>;
17
+ export default _default;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { EmojiDescription } from '../../../types';
3
+ export interface Props {
4
+ selectedEmoji?: EmojiDescription;
5
+ }
6
+ export declare const emojiPickerFooterTestId = "emoji-picker-footer";
7
+ declare const _default: import("react").MemoExoticComponent<({ selectedEmoji }: Props) => JSX.Element>;
8
+ export default _default;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import type { Styles } from '../../../types';
3
+ export interface Props {
4
+ style?: Styles;
5
+ query?: string;
6
+ isVisible?: boolean;
7
+ onChange: (value: string) => void;
8
+ resultsCount: number;
9
+ }
10
+ export declare const emojiPickerSearchTestId = "emoji-picker-search";
11
+ export declare const EmojiPickerListSearch: (props: Props) => JSX.Element;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ import { type WrappedComponentProps } from 'react-intl-next';
7
+ /**
8
+ * TODO: have to use class component here as unit test is relying on ref.root. Will refactor this whole file + EmojiPickerList to functional component in future
9
+ * ticket: COLLAB-2317
10
+ */
11
+ interface EmojiPickerTabPanelProps extends WrappedComponentProps {
12
+ /**
13
+ * Indicate whether the panel shows search results or full emojis list
14
+ */
15
+ showSearchResults: boolean;
16
+ children?: React.ReactNode;
17
+ }
18
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<React.PropsWithChildren<EmojiPickerTabPanelProps>>> & {
19
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<EmojiPickerTabPanelProps>>;
20
+ };
21
+ export default _default;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import type { ReactNode } from 'react';
6
+ import { type Props as CategoryHeadingProps } from './EmojiPickerCategoryHeading';
7
+ import { type Props as EmojiRowProps } from './EmojiPickerEmojiRow';
8
+ import type { VirtualItem as VirtualItemContext } from '@tanstack/react-virtual';
9
+ export interface RenderItem {
10
+ (context?: VirtualItemContext): ReactNode;
11
+ }
12
+ export interface VirtualItem<P> {
13
+ height: number;
14
+ props: P;
15
+ renderItem: RenderItem;
16
+ }
17
+ export declare abstract class AbstractItem<P> implements VirtualItem<P> {
18
+ readonly height: number;
19
+ readonly props: P;
20
+ constructor(props: P, height: number);
21
+ abstract renderItem: RenderItem;
22
+ }
23
+ export declare class EmojisRowItem extends AbstractItem<EmojiRowProps> {
24
+ constructor(props: EmojiRowProps);
25
+ renderItem: (context?: VirtualItemContext) => JSX.Element;
26
+ }
27
+ export declare class LoadingItem extends AbstractItem<{}> {
28
+ constructor();
29
+ renderItem: () => JSX.Element;
30
+ }
31
+ export declare class CategoryHeadingItem extends AbstractItem<CategoryHeadingProps> {
32
+ constructor(props: CategoryHeadingProps);
33
+ renderItem: () => JSX.Element;
34
+ }
35
+ export declare const virtualItemRenderer: (rows: VirtualItem<CategoryHeadingProps | EmojiRowProps | {}>[], context: VirtualItemContext) => JSX.Element;
@@ -0,0 +1,42 @@
1
+ import type { VirtualItem as VirtualItemContext } from '@tanstack/react-virtual';
2
+ import React from 'react';
3
+ type Props = {
4
+ overscanRowCount: number;
5
+ rowHeight: (index: number) => number;
6
+ rowRenderer: (context: VirtualItemContext) => JSX.Element;
7
+ onRowsRendered: (indexes: {
8
+ startIndex: number;
9
+ }) => void;
10
+ rowCount: number;
11
+ scrollToAlignment: 'start' | 'end';
12
+ width: number;
13
+ height: number;
14
+ };
15
+ export type ListRef = {
16
+ /**
17
+ * Scroll to the row by row index
18
+ * @param index row index of virtual list
19
+ */
20
+ scrollToRow: (index?: number) => void;
21
+ /**
22
+ * Scroll to the row by row index, and focus on last emoji in that row
23
+ * @param index row index of virtual list
24
+ * @returns
25
+ */
26
+ 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
+ /**
34
+ * Update the focus index of virtual list, which will manage tabIndex via EmojiPickerListContext
35
+ * @param rIndex row index of virtual list
36
+ * @param cIndex column index of virtual list
37
+ */
38
+ updateFocusIndex: (rIndex: number, cIndex?: number) => void;
39
+ };
40
+ export declare const virtualListScrollContainerTestId = "virtual-list-scroll-container";
41
+ export declare const VirtualList: React.ForwardRefExoticComponent<Props & React.RefAttributes<ListRef>>;
42
+ export {};
@@ -1,9 +1,4 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
1
  import React, { PureComponent } from 'react';
6
- import { jsx } from '@emotion/react';
7
2
  import type { EmojiDescription, EmojiDescriptionWithVariations, Message, OnCategory, OnEmojiEvent, OnToneSelected, OnToneSelectorCancelled, PickerSize, ToneSelection, User } from '../../types';
8
3
  import { type CategoryId } from './categories';
9
4
  import type { OnUploadEmoji } from '../common/EmojiUploadPicker';
@@ -100,6 +95,6 @@ export declare class EmojiPickerVirtualListInternalOld extends PureComponent<Pro
100
95
  * however, it'll trigger onChange from VirtualList, which will update focus index automatically for us
101
96
  */
102
97
  private handleOnCloseDelete;
103
- render(): jsx.JSX.Element;
98
+ render(): React.JSX.Element;
104
99
  }
105
100
  export declare const EmojiPickerVirtualListInternalNew: React.ForwardRefExoticComponent<Props & React.RefAttributes<PickerListRef>>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ import { type WrappedComponentProps } from 'react-intl-next';
7
+ /**
8
+ * TODO: have to use class component here as unit test is relying on ref.root. Will refactor this whole file + EmojiPickerList to functional component in future
9
+ * ticket: COLLAB-2317
10
+ */
11
+ interface EmojiPickerTabPanelProps extends WrappedComponentProps {
12
+ /**
13
+ * Indicate whether the panel shows search results or full emojis list
14
+ */
15
+ showSearchResults: boolean;
16
+ children?: React.ReactNode;
17
+ }
18
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<React.PropsWithChildren<EmojiPickerTabPanelProps>>> & {
19
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<EmojiPickerTabPanelProps>>;
20
+ };
21
+ export default _default;
@@ -2,7 +2,6 @@ import type { PickerSize } from '../../types';
2
2
  export declare const emojiPicker: (hasPreview?: boolean, size?: PickerSize) => import("@emotion/react").SerializedStyles;
3
3
  export declare const categorySelector: import("@emotion/react").SerializedStyles;
4
4
  export declare const categorySelectorTablist: import("@emotion/react").SerializedStyles;
5
- export declare const emojiPickerList: import("@emotion/react").SerializedStyles;
6
5
  export declare const virtualList: import("@emotion/react").SerializedStyles;
7
6
  export declare const searchIcon: import("@emotion/react").SerializedStyles;
8
7
  export declare const input: import("@emotion/react").SerializedStyles;
@@ -1,7 +1,8 @@
1
1
  import { AbstractResource } from '@atlaskit/util-service-support';
2
2
  import { Emoji, EmojiPlaceholder } from './element';
3
3
  import ResourcedEmoji from './components/common/ResourcedEmoji';
4
- import EmojiPicker, { preloadEmojiPicker } from './components/picker/EmojiPicker';
4
+ import { EmojiPicker } from './picker';
5
+ import { preloadEmojiPicker } from './components/picker/EmojiPicker';
5
6
  import EmojiUploader from './components/uploader/EmojiUploader';
6
7
  import EmojiTypeAhead from './components/typeahead/EmojiTypeAhead';
7
8
  import EmojiTypeAheadItem from './components/typeahead/EmojiTypeAheadItem';
@@ -1 +1,3 @@
1
- export { default as EmojiPicker } from './components/picker/EmojiPicker';
1
+ /// <reference types="react" />
2
+ declare const EmojiPicker: import("react").FC<Omit<Omit<import("./components/compiled/picker/EmojiPicker").Props & import("@atlaskit/analytics-next").WithAnalyticsEventsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & import("react").RefAttributes<any>, "ref"> & Omit<Omit<import("./components/picker/EmojiPicker").Props & import("@atlaskit/analytics-next").WithAnalyticsEventsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & import("react").RefAttributes<any>, "ref"> & import("react").RefAttributes<any>>;
3
+ export { EmojiPicker };
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import type { CategoryDescription, OnCategory } from '../../../types';
3
+ import { type CategoryGroupKey, type CategoryId } from '../../picker/categories';
4
+ export interface Props {
5
+ dynamicCategories?: CategoryId[];
6
+ activeCategoryId?: CategoryId | null;
7
+ disableCategories?: boolean;
8
+ onCategorySelected?: OnCategory;
9
+ }
10
+ export type CategoryMap = {
11
+ [id: string]: CategoryDescription;
12
+ };
13
+ export declare const sortCategories: (c1: CategoryGroupKey, c2: CategoryGroupKey) => number;
14
+ export declare const categorySelectorComponentTestId = "category-selector-component";
15
+ export declare const categorySelectorCategoryTestId: (categoryId: string) => string;
16
+ declare const CategorySelector: (props: Props) => JSX.Element;
17
+ export default CategorySelector;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import type { ComponentClass } from 'react';
6
+ import { type WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
7
+ import type { EmojiProvider } from '../../../api/EmojiResource';
8
+ import type { OnEmojiEvent, PickerSize } from '../../../types';
9
+ import LoadingEmojiComponent, { type Props as LoadingProps, type State as LoadingState } from '../../common/LoadingEmojiComponent';
10
+ import type { PickerRefHandler, Props as ComponentProps } from './EmojiPickerComponent';
11
+ export declare const preloadEmojiPicker: () => void;
12
+ export interface Props extends LoadingProps {
13
+ /**
14
+ * Callback to be executed on emoji selection.
15
+ */
16
+ onSelection?: OnEmojiEvent;
17
+ /**
18
+ * Callback to handle picker reference.
19
+ */
20
+ onPickerRef?: PickerRefHandler;
21
+ /**
22
+ * Flag to disable tone selector.
23
+ */
24
+ hideToneSelector?: boolean;
25
+ /**
26
+ * Size of Emoji Picker. default value is 'medium'.
27
+ */
28
+ size?: PickerSize;
29
+ }
30
+ export declare class EmojiPickerInternal extends LoadingEmojiComponent<Props & WithAnalyticsEventsProps, LoadingState> {
31
+ static AsyncLoadedComponent?: React.ComponentType<React.PropsWithChildren<ComponentProps>>;
32
+ static defaultProps: {
33
+ size: string;
34
+ };
35
+ state: {
36
+ asyncLoadedComponent: import("react").ComponentType<import("react").PropsWithChildren<ComponentProps>> | undefined;
37
+ };
38
+ constructor(props: Props);
39
+ asyncLoadComponent(): void;
40
+ renderLoading(): JSX.Element | null;
41
+ renderLoaded(loadedEmojiProvider: EmojiProvider, EmojiPickerComponent: ComponentClass<ComponentProps>): JSX.Element;
42
+ }
43
+ declare const EmojiPicker: import("react").ForwardRefExoticComponent<Omit<Props & WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any>>;
44
+ export default EmojiPicker;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { CategoryGroupKey } from '../../picker/categories';
3
+ /**
4
+ * Test id for wrapper Emoji Picker List div
5
+ */
6
+ export declare const RENDER_EMOJI_PICKER_CATEGORY_HEADING_TESTID = "render-emoji-picker-categorty-heading";
7
+ export interface Props {
8
+ id: CategoryGroupKey;
9
+ title: string;
10
+ className?: string;
11
+ }
12
+ declare const EmojiPickerCategoryHeading: ({ id, title, className }: Props) => JSX.Element;
13
+ export default EmojiPickerCategoryHeading;
@@ -0,0 +1,24 @@
1
+ /// <reference types="react" />
2
+ import { type OnEmojiEvent, type PickerSize } from '../../../types';
3
+ import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
4
+ export interface PickerRefHandler {
5
+ (ref: any): any;
6
+ }
7
+ export interface Props {
8
+ /**
9
+ * Callback to be executed when user selects an emoji.
10
+ */
11
+ onSelection?: OnEmojiEvent;
12
+ /**
13
+ * Callback performed when picker reference is being set.
14
+ */
15
+ onPickerRef?: PickerRefHandler;
16
+ /**
17
+ * Flag to disable tone selector.
18
+ */
19
+ hideToneSelector?: boolean;
20
+ createAnalyticsEvent?: CreateUIAnalyticsEvent;
21
+ size?: PickerSize;
22
+ }
23
+ declare const _default: import("react").MemoExoticComponent<({ onSelection, onPickerRef, hideToneSelector, createAnalyticsEvent, size, }: Props) => JSX.Element>;
24
+ export default _default;
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ import type { EmojiDescription, OnEmojiEvent } from '../../../types';
3
+ import type { VirtualItem as VirtualItemContext } from '@tanstack/react-virtual';
4
+ import type { CategoryGroupKey } from '../../picker/categories';
5
+ export interface Props {
6
+ category: CategoryGroupKey;
7
+ emojis: EmojiDescription[];
8
+ title: string;
9
+ showDelete: boolean;
10
+ onSelected?: OnEmojiEvent;
11
+ onMouseMove?: OnEmojiEvent;
12
+ onFocus?: OnEmojiEvent;
13
+ onDelete?: OnEmojiEvent;
14
+ virtualItemContext?: VirtualItemContext;
15
+ }
16
+ declare const _default: import("react").MemoExoticComponent<({ emojis, onSelected, onMouseMove, onFocus, title, showDelete, onDelete, virtualItemContext, }: Props) => JSX.Element>;
17
+ export default _default;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import type { EmojiDescription } from '../../../types';
3
+ export interface Props {
4
+ selectedEmoji?: EmojiDescription;
5
+ }
6
+ export declare const emojiPickerFooterTestId = "emoji-picker-footer";
7
+ declare const _default: import("react").MemoExoticComponent<({ selectedEmoji }: Props) => JSX.Element>;
8
+ export default _default;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import type { Styles } from '../../../types';
3
+ export interface Props {
4
+ style?: Styles;
5
+ query?: string;
6
+ isVisible?: boolean;
7
+ onChange: (value: string) => void;
8
+ resultsCount: number;
9
+ }
10
+ export declare const emojiPickerSearchTestId = "emoji-picker-search";
11
+ export declare const EmojiPickerListSearch: (props: Props) => JSX.Element;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ import { type WrappedComponentProps } from 'react-intl-next';
7
+ /**
8
+ * TODO: have to use class component here as unit test is relying on ref.root. Will refactor this whole file + EmojiPickerList to functional component in future
9
+ * ticket: COLLAB-2317
10
+ */
11
+ interface EmojiPickerTabPanelProps extends WrappedComponentProps {
12
+ /**
13
+ * Indicate whether the panel shows search results or full emojis list
14
+ */
15
+ showSearchResults: boolean;
16
+ children?: React.ReactNode;
17
+ }
18
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<React.PropsWithChildren<EmojiPickerTabPanelProps>>> & {
19
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<EmojiPickerTabPanelProps>>;
20
+ };
21
+ export default _default;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import type { ReactNode } from 'react';
6
+ import { type Props as CategoryHeadingProps } from './EmojiPickerCategoryHeading';
7
+ import { type Props as EmojiRowProps } from './EmojiPickerEmojiRow';
8
+ import type { VirtualItem as VirtualItemContext } from '@tanstack/react-virtual';
9
+ export interface RenderItem {
10
+ (context?: VirtualItemContext): ReactNode;
11
+ }
12
+ export interface VirtualItem<P> {
13
+ height: number;
14
+ props: P;
15
+ renderItem: RenderItem;
16
+ }
17
+ export declare abstract class AbstractItem<P> implements VirtualItem<P> {
18
+ readonly height: number;
19
+ readonly props: P;
20
+ constructor(props: P, height: number);
21
+ abstract renderItem: RenderItem;
22
+ }
23
+ export declare class EmojisRowItem extends AbstractItem<EmojiRowProps> {
24
+ constructor(props: EmojiRowProps);
25
+ renderItem: (context?: VirtualItemContext) => JSX.Element;
26
+ }
27
+ export declare class LoadingItem extends AbstractItem<{}> {
28
+ constructor();
29
+ renderItem: () => JSX.Element;
30
+ }
31
+ export declare class CategoryHeadingItem extends AbstractItem<CategoryHeadingProps> {
32
+ constructor(props: CategoryHeadingProps);
33
+ renderItem: () => JSX.Element;
34
+ }
35
+ export declare const virtualItemRenderer: (rows: VirtualItem<CategoryHeadingProps | EmojiRowProps | {}>[], context: VirtualItemContext) => JSX.Element;
@@ -0,0 +1,42 @@
1
+ import type { VirtualItem as VirtualItemContext } from '@tanstack/react-virtual';
2
+ import React from 'react';
3
+ type Props = {
4
+ overscanRowCount: number;
5
+ rowHeight: (index: number) => number;
6
+ rowRenderer: (context: VirtualItemContext) => JSX.Element;
7
+ onRowsRendered: (indexes: {
8
+ startIndex: number;
9
+ }) => void;
10
+ rowCount: number;
11
+ scrollToAlignment: 'start' | 'end';
12
+ width: number;
13
+ height: number;
14
+ };
15
+ export type ListRef = {
16
+ /**
17
+ * Scroll to the row by row index
18
+ * @param index row index of virtual list
19
+ */
20
+ scrollToRow: (index?: number) => void;
21
+ /**
22
+ * Scroll to the row by row index, and focus on last emoji in that row
23
+ * @param index row index of virtual list
24
+ * @returns
25
+ */
26
+ 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
+ /**
34
+ * Update the focus index of virtual list, which will manage tabIndex via EmojiPickerListContext
35
+ * @param rIndex row index of virtual list
36
+ * @param cIndex column index of virtual list
37
+ */
38
+ updateFocusIndex: (rIndex: number, cIndex?: number) => void;
39
+ };
40
+ export declare const virtualListScrollContainerTestId = "virtual-list-scroll-container";
41
+ export declare const VirtualList: React.ForwardRefExoticComponent<Props & React.RefAttributes<ListRef>>;
42
+ export {};
@@ -1,9 +1,4 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
1
  import React, { PureComponent } from 'react';
6
- import { jsx } from '@emotion/react';
7
2
  import type { EmojiDescription, EmojiDescriptionWithVariations, Message, OnCategory, OnEmojiEvent, OnToneSelected, OnToneSelectorCancelled, PickerSize, ToneSelection, User } from '../../types';
8
3
  import { type CategoryId } from './categories';
9
4
  import type { OnUploadEmoji } from '../common/EmojiUploadPicker';
@@ -100,6 +95,6 @@ export declare class EmojiPickerVirtualListInternalOld extends PureComponent<Pro
100
95
  * however, it'll trigger onChange from VirtualList, which will update focus index automatically for us
101
96
  */
102
97
  private handleOnCloseDelete;
103
- render(): jsx.JSX.Element;
98
+ render(): React.JSX.Element;
104
99
  }
105
100
  export declare const EmojiPickerVirtualListInternalNew: React.ForwardRefExoticComponent<Props & React.RefAttributes<PickerListRef>>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ import { type WrappedComponentProps } from 'react-intl-next';
7
+ /**
8
+ * TODO: have to use class component here as unit test is relying on ref.root. Will refactor this whole file + EmojiPickerList to functional component in future
9
+ * ticket: COLLAB-2317
10
+ */
11
+ interface EmojiPickerTabPanelProps extends WrappedComponentProps {
12
+ /**
13
+ * Indicate whether the panel shows search results or full emojis list
14
+ */
15
+ showSearchResults: boolean;
16
+ children?: React.ReactNode;
17
+ }
18
+ declare const _default: React.FC<import("react-intl-next").WithIntlProps<React.PropsWithChildren<EmojiPickerTabPanelProps>>> & {
19
+ WrappedComponent: React.ComponentType<React.PropsWithChildren<EmojiPickerTabPanelProps>>;
20
+ };
21
+ export default _default;
@@ -2,7 +2,6 @@ import type { PickerSize } from '../../types';
2
2
  export declare const emojiPicker: (hasPreview?: boolean, size?: PickerSize) => import("@emotion/react").SerializedStyles;
3
3
  export declare const categorySelector: import("@emotion/react").SerializedStyles;
4
4
  export declare const categorySelectorTablist: import("@emotion/react").SerializedStyles;
5
- export declare const emojiPickerList: import("@emotion/react").SerializedStyles;
6
5
  export declare const virtualList: import("@emotion/react").SerializedStyles;
7
6
  export declare const searchIcon: import("@emotion/react").SerializedStyles;
8
7
  export declare const input: import("@emotion/react").SerializedStyles;
@@ -1,7 +1,8 @@
1
1
  import { AbstractResource } from '@atlaskit/util-service-support';
2
2
  import { Emoji, EmojiPlaceholder } from './element';
3
3
  import ResourcedEmoji from './components/common/ResourcedEmoji';
4
- import EmojiPicker, { preloadEmojiPicker } from './components/picker/EmojiPicker';
4
+ import { EmojiPicker } from './picker';
5
+ import { preloadEmojiPicker } from './components/picker/EmojiPicker';
5
6
  import EmojiUploader from './components/uploader/EmojiUploader';
6
7
  import EmojiTypeAhead from './components/typeahead/EmojiTypeAhead';
7
8
  import EmojiTypeAheadItem from './components/typeahead/EmojiTypeAheadItem';
@@ -1 +1,3 @@
1
- export { default as EmojiPicker } from './components/picker/EmojiPicker';
1
+ /// <reference types="react" />
2
+ declare const EmojiPicker: import("react").FC<Omit<Omit<import("./components/compiled/picker/EmojiPicker").Props & import("@atlaskit/analytics-next").WithAnalyticsEventsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & import("react").RefAttributes<any>, "ref"> & Omit<Omit<import("./components/picker/EmojiPicker").Props & import("@atlaskit/analytics-next").WithAnalyticsEventsProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & import("react").RefAttributes<any>, "ref"> & import("react").RefAttributes<any>>;
3
+ export { EmojiPicker };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/emoji",
3
- "version": "69.0.1",
3
+ "version": "69.0.2",
4
4
  "description": "Fabric emoji React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,13 +37,14 @@
37
37
  "dependencies": {
38
38
  "@atlaskit/analytics-next": "^11.0.0",
39
39
  "@atlaskit/button": "^21.1.0",
40
+ "@atlaskit/css": "^0.10.0",
40
41
  "@atlaskit/heading": "^5.1.0",
41
42
  "@atlaskit/icon": "^25.0.0",
42
43
  "@atlaskit/media-client": "^32.0.0",
43
44
  "@atlaskit/media-client-react": "^4.0.0",
44
45
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
46
  "@atlaskit/platform-feature-flags-react": "^0.1.0",
46
- "@atlaskit/primitives": "^14.1.0",
47
+ "@atlaskit/primitives": "^14.2.0",
47
48
  "@atlaskit/spinner": "^18.0.0",
48
49
  "@atlaskit/textfield": "^8.0.0",
49
50
  "@atlaskit/theme": "^18.0.0",