@atlaskit/emoji 64.5.0 → 64.5.1

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/emoji
2
2
 
3
+ ## 64.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
8
+ - Updated dependencies
9
+
3
10
  ## 64.5.0
4
11
 
5
12
  ### Minor Changes
@@ -52,13 +52,11 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
52
52
  *
53
53
  * Follow this up with an isUploadSupported() check to see if the provider is actually
54
54
  * configured to support uploads.
55
+ * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates
55
56
  */
56
57
  var supportsUploadFeature = function supportsUploadFeature(emojiProvider) {
57
- var _ref = emojiProvider,
58
- isUploadSupported = _ref.isUploadSupported,
59
- prepareForUpload = _ref.prepareForUpload,
60
- uploadCustomEmoji = _ref.uploadCustomEmoji;
61
- return !!(isUploadSupported && prepareForUpload && uploadCustomEmoji);
58
+ var emojiUploadProvider = emojiProvider;
59
+ return !!emojiUploadProvider.isUploadSupported && !!emojiUploadProvider.uploadCustomEmoji && !!emojiUploadProvider.prepareForUpload;
62
60
  };
63
61
 
64
62
  exports.supportsUploadFeature = supportsUploadFeature;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/emoji",
3
- "version": "64.5.0",
3
+ "version": "64.5.1",
4
4
  "sideEffects": false
5
5
  }
@@ -15,14 +15,11 @@ import { ufoExperiences } from '../util/analytics';
15
15
  *
16
16
  * Follow this up with an isUploadSupported() check to see if the provider is actually
17
17
  * configured to support uploads.
18
+ * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates
18
19
  */
19
20
  export const supportsUploadFeature = emojiProvider => {
20
- const {
21
- isUploadSupported,
22
- prepareForUpload,
23
- uploadCustomEmoji
24
- } = emojiProvider;
25
- return !!(isUploadSupported && prepareForUpload && uploadCustomEmoji);
21
+ const emojiUploadProvider = emojiProvider;
22
+ return !!emojiUploadProvider.isUploadSupported && !!emojiUploadProvider.uploadCustomEmoji && !!emojiUploadProvider.prepareForUpload;
26
23
  };
27
24
  export class EmojiResource extends AbstractResource {
28
25
  constructor(config) {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/emoji",
3
- "version": "64.5.0",
3
+ "version": "64.5.1",
4
4
  "sideEffects": false
5
5
  }
@@ -27,13 +27,11 @@ import { ufoExperiences } from '../util/analytics';
27
27
  *
28
28
  * Follow this up with an isUploadSupported() check to see if the provider is actually
29
29
  * configured to support uploads.
30
+ * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates
30
31
  */
31
32
  export var supportsUploadFeature = function supportsUploadFeature(emojiProvider) {
32
- var _ref = emojiProvider,
33
- isUploadSupported = _ref.isUploadSupported,
34
- prepareForUpload = _ref.prepareForUpload,
35
- uploadCustomEmoji = _ref.uploadCustomEmoji;
36
- return !!(isUploadSupported && prepareForUpload && uploadCustomEmoji);
33
+ var emojiUploadProvider = emojiProvider;
34
+ return !!emojiUploadProvider.isUploadSupported && !!emojiUploadProvider.uploadCustomEmoji && !!emojiUploadProvider.prepareForUpload;
37
35
  };
38
36
  export var EmojiResource = /*#__PURE__*/function (_AbstractResource) {
39
37
  _inherits(EmojiResource, _AbstractResource);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/emoji",
3
- "version": "64.5.0",
3
+ "version": "64.5.1",
4
4
  "sideEffects": false
5
5
  }
@@ -43,6 +43,7 @@ export interface ResolveReject<T> {
43
43
  *
44
44
  * Follow this up with an isUploadSupported() check to see if the provider is actually
45
45
  * configured to support uploads.
46
+ * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates
46
47
  */
47
48
  export declare const supportsUploadFeature: (emojiProvider: EmojiProvider) => emojiProvider is UploadingEmojiProvider;
48
49
  export interface LastQuery {
@@ -15,4 +15,4 @@ export declare const denormaliseSkinEmoji: (emoji: EmojiServiceDescriptionWithVa
15
15
  * emoji with local sprite definitions.
16
16
  */
17
17
  export declare const denormaliseEmojiServiceResponse: (emojiData: EmojiServiceResponse) => EmojiResponse;
18
- export declare const shouldUseAltRepresentation: (emoji: EmojiDescription, fitToHeight?: import("../types").ToneSelection) => boolean;
18
+ export declare const shouldUseAltRepresentation: (emoji: EmojiDescription, fitToHeight?: number | undefined) => boolean;
@@ -33,8 +33,8 @@ export declare class EmojiUploadPicker extends PureComponent<Props & WrappedComp
33
33
  clearUploadPicker: () => void;
34
34
  render(): JSX.Element;
35
35
  }
36
- declare const _default: React.ForwardRefExoticComponent<Pick<React.PropsWithChildren<Props & WrappedComponentProps<"intl">>, "children" | "errorMessage" | "onUploadCancelled" | "onUploadEmoji" | "onFileChooserClicked" | "initialUploadName"> & {
37
- forwardedRef?: ((instance: any) => void) | React.RefObject<any> | null | undefined;
36
+ declare const _default: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<Props & WrappedComponentProps<"intl">>, "intl"> & {
37
+ forwardedRef?: React.Ref<any> | undefined;
38
38
  } & React.RefAttributes<any>> & {
39
39
  WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
40
40
  };
@@ -14,5 +14,5 @@ export declare class ToneSelectorInternal extends PureComponent<Props & WithAnal
14
14
  private onToneSelectedHandler;
15
15
  render(): JSX.Element;
16
16
  }
17
- declare const ToneSelector: React.ForwardRefExoticComponent<Pick<Props & WithAnalyticsEventsProps, "emoji" | "onToneSelected" | "previewEmojiId"> & React.RefAttributes<any>>;
17
+ declare const ToneSelector: React.ForwardRefExoticComponent<Omit<Props & WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
18
18
  export default ToneSelector;
@@ -19,5 +19,5 @@ export declare class EmojiPickerInternal extends LoadingEmojiComponent<Props & W
19
19
  renderLoading(): JSX.Element | null;
20
20
  renderLoaded(loadedEmojiProvider: EmojiProvider, EmojiPickerComponent: ComponentClass<ComponentProps>): JSX.Element;
21
21
  }
22
- declare const EmojiPicker: import("react").ForwardRefExoticComponent<Pick<Props & WithAnalyticsEventsProps, "emojiProvider" | "onSelection" | "onPickerRef" | "hideToneSelector"> & import("react").RefAttributes<any>>;
22
+ declare const EmojiPicker: import("react").ForwardRefExoticComponent<Omit<Props & WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps> & import("react").RefAttributes<any>>;
23
23
  export default EmojiPicker;
@@ -1,7 +1,7 @@
1
1
  import { PureComponent } from 'react';
2
2
  import { MessageDescriptor } from 'react-intl-next';
3
3
  import { EmojiProvider } from '../../api/EmojiResource';
4
- import { EmojiDescription, EmojiId, OnEmojiEvent, OptionalEmojiDescription, OptionalEmojiDescriptionWithVariations, ToneSelection } from '../../types';
4
+ import { EmojiDescription, EmojiId, OnEmojiEvent, OptionalEmojiDescriptionWithVariations, ToneSelection } from '../../types';
5
5
  import { CategoryId } from './categories';
6
6
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
7
7
  export interface PickerRefHandler {
@@ -42,7 +42,7 @@ export default class EmojiPickerComponent extends PureComponent<Props, State> {
42
42
  componentWillUnmount(): void;
43
43
  UNSAFE_componentWillReceiveProps(nextProps: Props): void;
44
44
  componentDidUpdate(prevProps: Props): void;
45
- onEmojiActive: (_emojiId: EmojiId, emoji?: OptionalEmojiDescription) => void;
45
+ onEmojiActive: (_emojiId: EmojiId, emoji?: EmojiDescription | undefined) => void;
46
46
  onCategoryActivated: (category: CategoryId | null) => void;
47
47
  onCategorySelected: (categoryId: CategoryId | null) => void;
48
48
  onFileChooserClicked: () => void;
@@ -1,6 +1,6 @@
1
1
  import { PureComponent } from 'react';
2
2
  import { EmojiProvider } from '../../api/EmojiResource';
3
- import { EmojiDescription, OnEmojiEvent, ToneSelection } from '../../types';
3
+ import { EmojiDescription, OnEmojiEvent } from '../../types';
4
4
  import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
5
5
  export interface OnLifecycle {
6
6
  (): void;
@@ -43,7 +43,7 @@ export default class EmojiTypeAheadComponent extends PureComponent<Props, State>
43
43
  selectPrevious: () => void;
44
44
  chooseCurrentSelection: () => void;
45
45
  count: () => number;
46
- getTone: (tone?: ToneSelection) => string | undefined;
46
+ getTone: (tone?: number | undefined) => string | undefined;
47
47
  private fireAnalyticsEvent;
48
48
  private onSearch;
49
49
  private onSearchResult;
@@ -18,5 +18,5 @@ export declare class EmojiUploaderInternal extends LoadingEmojiComponent<Props,
18
18
  renderLoaded(loadedEmojiProvider: EmojiProvider, EmojiUploadComponent: ComponentClass<ComponentProps>): JSX.Element;
19
19
  }
20
20
  declare type EmojiUploader = EmojiUploaderInternal;
21
- declare const EmojiUploader: React.ForwardRefExoticComponent<Pick<Props, "emojiProvider" | "onUploaderRef"> & React.RefAttributes<any>>;
21
+ declare const EmojiUploader: React.ForwardRefExoticComponent<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any>>;
22
22
  export default EmojiUploader;
@@ -1,4 +1,4 @@
1
- import { Component } from 'react';
1
+ import React, { Component } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { EmojiContext } from '../components/common/internal-types';
4
4
  export interface LegacyEmojiContextProviderProps {
@@ -13,10 +13,10 @@ interface LegacyEmojiContextProviderState {
13
13
  */
14
14
  export default class LegacyEmojiContextProvider extends Component<LegacyEmojiContextProviderProps, LegacyEmojiContextProviderState> {
15
15
  static contextTypes: {
16
- emoji: PropTypes.Requireable<any>;
16
+ emoji: PropTypes.Requireable<object>;
17
17
  };
18
18
  context: EmojiContext;
19
19
  constructor(props: LegacyEmojiContextProviderProps, context: EmojiContext);
20
- render(): {} | null | undefined;
20
+ render(): React.ReactNode;
21
21
  }
22
22
  export {};
@@ -1,14 +1,14 @@
1
1
  import { AnalyticsEventPayload, CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
2
2
  import { EmojiDescription } from '../../types';
3
- export declare const createAndFireEventInElementsChannel: (payload: Record<string, any>) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => import("@atlaskit/analytics-next").UIAnalyticsEvent;
3
+ export declare const createAndFireEventInElementsChannel: (payload: AnalyticsEventPayload) => (createAnalyticsEvent: CreateUIAnalyticsEvent) => import("@atlaskit/analytics-next").UIAnalyticsEvent;
4
4
  export declare type EmojiInsertionAnalytic = (source: 'picker' | 'typeahead') => AnalyticsEventPayload;
5
5
  export declare const recordSucceeded: EmojiInsertionAnalytic;
6
6
  export declare const recordFailed: EmojiInsertionAnalytic;
7
7
  interface Duration {
8
8
  duration: number;
9
9
  }
10
- export declare const openedPickerEvent: () => Record<string, any>;
11
- export declare const closedPickerEvent: (attributes: Duration) => Record<string, any>;
10
+ export declare const openedPickerEvent: () => AnalyticsEventPayload;
11
+ export declare const closedPickerEvent: (attributes: Duration) => AnalyticsEventPayload;
12
12
  interface EmojiAttributes {
13
13
  emojiId: string;
14
14
  baseEmojiId?: string;
@@ -18,40 +18,40 @@ interface EmojiAttributes {
18
18
  }
19
19
  export declare const pickerClickedEvent: (attributes: {
20
20
  queryLength: number;
21
- } & EmojiAttributes & Duration) => Record<string, any>;
21
+ } & EmojiAttributes & Duration) => AnalyticsEventPayload;
22
22
  export declare const categoryClickedEvent: (attributes: {
23
23
  category: string;
24
- }) => Record<string, any>;
24
+ }) => AnalyticsEventPayload;
25
25
  export declare const pickerSearchedEvent: (attributes: {
26
26
  queryLength: number;
27
27
  numMatches: number;
28
- }) => Record<string, any>;
28
+ }) => AnalyticsEventPayload;
29
29
  export declare const toneSelectedEvent: (attributes: {
30
30
  skinToneModifier: string;
31
- }) => Record<string, any>;
31
+ }) => AnalyticsEventPayload;
32
32
  export declare const toneSelectorOpenedEvent: (attributes: {
33
33
  skinToneModifier?: string;
34
- }) => Record<string, any>;
35
- export declare const toneSelectorClosedEvent: () => Record<string, any>;
36
- export declare const uploadBeginButton: () => Record<string, any>;
34
+ }) => AnalyticsEventPayload;
35
+ export declare const toneSelectorClosedEvent: () => AnalyticsEventPayload;
36
+ export declare const uploadBeginButton: () => AnalyticsEventPayload;
37
37
  export declare const uploadConfirmButton: (attributes: {
38
38
  retry: boolean;
39
- }) => Record<string, any>;
40
- export declare const uploadCancelButton: () => Record<string, any>;
41
- export declare const uploadSucceededEvent: (attributes: Duration) => Record<string, any>;
39
+ }) => AnalyticsEventPayload;
40
+ export declare const uploadCancelButton: () => AnalyticsEventPayload;
41
+ export declare const uploadSucceededEvent: (attributes: Duration) => AnalyticsEventPayload;
42
42
  export declare const uploadFailedEvent: (attributes: {
43
43
  reason: string;
44
- } & Duration) => Record<string, any>;
44
+ } & Duration) => AnalyticsEventPayload;
45
45
  interface Attributes {
46
46
  emojiId?: string;
47
47
  }
48
- export declare const deleteBeginEvent: (attributes: Attributes) => Record<string, any>;
49
- export declare const deleteConfirmEvent: (attributes: Attributes) => Record<string, any>;
50
- export declare const deleteCancelEvent: (attributes: Attributes) => Record<string, any>;
51
- export declare const selectedFileEvent: () => Record<string, any>;
52
- export declare const typeaheadCancelledEvent: (duration: number, query?: string | undefined, emojiList?: EmojiDescription[] | undefined) => Record<string, any>;
53
- export declare const typeaheadSelectedEvent: (pressed: boolean, duration: number, emoji: EmojiDescription, emojiList?: EmojiDescription[] | undefined, query?: string | undefined, exactMatch?: boolean | undefined) => Record<string, any>;
54
- export declare const typeaheadRenderedEvent: (duration: number, query?: string | undefined, emojiList?: EmojiDescription[] | undefined) => Record<string, any>;
48
+ export declare const deleteBeginEvent: (attributes: Attributes) => AnalyticsEventPayload;
49
+ export declare const deleteConfirmEvent: (attributes: Attributes) => AnalyticsEventPayload;
50
+ export declare const deleteCancelEvent: (attributes: Attributes) => AnalyticsEventPayload;
51
+ export declare const selectedFileEvent: () => AnalyticsEventPayload;
52
+ export declare const typeaheadCancelledEvent: (duration: number, query?: string | undefined, emojiList?: EmojiDescription[] | undefined) => AnalyticsEventPayload;
53
+ export declare const typeaheadSelectedEvent: (pressed: boolean, duration: number, emoji: EmojiDescription, emojiList?: EmojiDescription[] | undefined, query?: string | undefined, exactMatch?: boolean | undefined) => AnalyticsEventPayload;
54
+ export declare const typeaheadRenderedEvent: (duration: number, query?: string | undefined, emojiList?: EmojiDescription[] | undefined) => AnalyticsEventPayload;
55
55
  export declare const recordSelectionSucceededSli: (options?: {
56
56
  createAnalyticsEvent?: CreateUIAnalyticsEvent | undefined;
57
57
  } | undefined) => () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/emoji",
3
- "version": "64.5.0",
3
+ "version": "64.5.1",
4
4
  "description": "Fabric emoji React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -27,9 +27,9 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@atlaskit/analytics-next": "^8.2.0",
30
- "@atlaskit/button": "^16.2.0",
30
+ "@atlaskit/button": "^16.3.0",
31
31
  "@atlaskit/icon": "^21.10.0",
32
- "@atlaskit/media-client": "^15.0.0",
32
+ "@atlaskit/media-client": "^15.1.0",
33
33
  "@atlaskit/spinner": "^15.0.0",
34
34
  "@atlaskit/textfield": "^5.1.0",
35
35
  "@atlaskit/theme": "^12.1.0",
@@ -78,7 +78,7 @@
78
78
  "rxjs": "^5.5.0",
79
79
  "serialize-javascript": "^5.0.1",
80
80
  "sinon": "^2.2.0",
81
- "typescript": "3.9.10",
81
+ "typescript": "4.2.4",
82
82
  "wait-for-expect": "^1.2.0",
83
83
  "webpack-dev-server": "^3.11.2"
84
84
  },