@atlaskit/emoji 70.17.9 → 70.17.10

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 (180) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/admin/package.json +1 -8
  3. package/analytics/package.json +1 -8
  4. package/categories/package.json +1 -8
  5. package/constants/package.json +1 -8
  6. package/dist/cjs/util/analytics/analytics.js +1 -1
  7. package/dist/es2019/util/analytics/analytics.js +1 -1
  8. package/dist/esm/util/analytics/analytics.js +1 -1
  9. package/element/package.json +1 -8
  10. package/emoji/package.json +1 -8
  11. package/emoji-common-provider/package.json +1 -8
  12. package/emoji-context-provider/package.json +1 -8
  13. package/emoji-id-to-emoji/package.json +1 -8
  14. package/emoji-loader/package.json +1 -8
  15. package/emoji-picker/package.json +1 -8
  16. package/emoji-placeholder/package.json +1 -8
  17. package/emoji-repository/package.json +1 -8
  18. package/emoji-resource/package.json +1 -8
  19. package/emoji-type-ahead/package.json +1 -8
  20. package/emoji-type-ahead-item/package.json +1 -8
  21. package/emoji-type-ahead-list/package.json +1 -8
  22. package/emoji-uploader/package.json +1 -8
  23. package/emoji-utils/package.json +1 -8
  24. package/package.json +2 -2
  25. package/picker/package.json +1 -8
  26. package/resource/package.json +1 -8
  27. package/resourced-emoji/package.json +1 -8
  28. package/sampling-ufo/package.json +1 -8
  29. package/styles/package.json +1 -8
  30. package/type-helpers/package.json +1 -8
  31. package/typeahead/package.json +1 -8
  32. package/types/package.json +1 -8
  33. package/ufo-experiences/package.json +1 -8
  34. package/usage-frequency-tracker/package.json +1 -8
  35. package/use-emoji/package.json +1 -8
  36. package/use-emoji-context/package.json +1 -8
  37. package/utils/package.json +1 -8
  38. package/dist/types-ts4.5/admin.d.ts +0 -1
  39. package/dist/types-ts4.5/api/EmojiLoader.d.ts +0 -13
  40. package/dist/types-ts4.5/api/EmojiRepository.d.ts +0 -75
  41. package/dist/types-ts4.5/api/EmojiRepositoryRegex.d.ts +0 -1
  42. package/dist/types-ts4.5/api/EmojiResource.d.ts +0 -160
  43. package/dist/types-ts4.5/api/EmojiUtils.d.ts +0 -29
  44. package/dist/types-ts4.5/api/internal/Comparators.d.ts +0 -109
  45. package/dist/types-ts4.5/api/internal/UsageFrequencyTracker.d.ts +0 -46
  46. package/dist/types-ts4.5/api/media/MediaEmojiCache.d.ts +0 -53
  47. package/dist/types-ts4.5/api/media/MediaImageLoader.d.ts +0 -21
  48. package/dist/types-ts4.5/api/media/SiteEmojiResource.d.ts +0 -51
  49. package/dist/types-ts4.5/api/media/TokenManager.d.ts +0 -13
  50. package/dist/types-ts4.5/components/common/AddEmoji.d.ts +0 -11
  51. package/dist/types-ts4.5/components/common/CachingEmoji.d.ts +0 -21
  52. package/dist/types-ts4.5/components/common/DeletableEmojiTooltipContent.d.ts +0 -6
  53. package/dist/types-ts4.5/components/common/DeleteButton.d.ts +0 -7
  54. package/dist/types-ts4.5/components/common/Emoji.d.ts +0 -96
  55. package/dist/types-ts4.5/components/common/EmojiActions.d.ts +0 -40
  56. package/dist/types-ts4.5/components/common/EmojiDeletePreview.d.ts +0 -25
  57. package/dist/types-ts4.5/components/common/EmojiErrorMessage.d.ts +0 -13
  58. package/dist/types-ts4.5/components/common/EmojiFallback.d.ts +0 -8
  59. package/dist/types-ts4.5/components/common/EmojiPlaceholder.d.ts +0 -13
  60. package/dist/types-ts4.5/components/common/EmojiPreviewComponent.d.ts +0 -6
  61. package/dist/types-ts4.5/components/common/EmojiRadioButton.d.ts +0 -17
  62. package/dist/types-ts4.5/components/common/EmojiUploadPicker.d.ts +0 -25
  63. package/dist/types-ts4.5/components/common/EmojiUploadPreview.d.ts +0 -22
  64. package/dist/types-ts4.5/components/common/FileChooser.d.ts +0 -21
  65. package/dist/types-ts4.5/components/common/LoadingEmojiComponent.d.ts +0 -32
  66. package/dist/types-ts4.5/components/common/Popup.d.ts +0 -12
  67. package/dist/types-ts4.5/components/common/RecordSelectionDefault.d.ts +0 -12
  68. package/dist/types-ts4.5/components/common/ResourcedEmoji.d.ts +0 -6
  69. package/dist/types-ts4.5/components/common/ResourcedEmojiComponent.d.ts +0 -74
  70. package/dist/types-ts4.5/components/common/RetryableButton.d.ts +0 -13
  71. package/dist/types-ts4.5/components/common/Scrollable.d.ts +0 -23
  72. package/dist/types-ts4.5/components/common/TonePreviewButton.d.ts +0 -18
  73. package/dist/types-ts4.5/components/common/ToneSelector.d.ts +0 -15
  74. package/dist/types-ts4.5/components/common/ToolTipContentWithKeymap.d.ts +0 -11
  75. package/dist/types-ts4.5/components/common/UfoErrorBoundary.d.ts +0 -9
  76. package/dist/types-ts4.5/components/common/UploadEmoji.d.ts +0 -5
  77. package/dist/types-ts4.5/components/common/internal-types.d.ts +0 -20
  78. package/dist/types-ts4.5/components/common/setSkinToneAriaLabelText.d.ts +0 -1
  79. package/dist/types-ts4.5/components/common/styles.d.ts +0 -10
  80. package/dist/types-ts4.5/components/i18n.d.ts +0 -267
  81. package/dist/types-ts4.5/components/picker/CategorySelector.d.ts +0 -17
  82. package/dist/types-ts4.5/components/picker/CategoryTracker.d.ts +0 -16
  83. package/dist/types-ts4.5/components/picker/EmojiPicker.d.ts +0 -45
  84. package/dist/types-ts4.5/components/picker/EmojiPickerCategoryHeading.d.ts +0 -12
  85. package/dist/types-ts4.5/components/picker/EmojiPickerComponent.d.ts +0 -28
  86. package/dist/types-ts4.5/components/picker/EmojiPickerEmojiRow.d.ts +0 -22
  87. package/dist/types-ts4.5/components/picker/EmojiPickerFooter.d.ts +0 -14
  88. package/dist/types-ts4.5/components/picker/EmojiPickerList.d.ts +0 -51
  89. package/dist/types-ts4.5/components/picker/EmojiPickerListSearch.d.ts +0 -10
  90. package/dist/types-ts4.5/components/picker/EmojiPickerNoResults.d.ts +0 -7
  91. package/dist/types-ts4.5/components/picker/EmojiPickerSizes.d.ts +0 -13
  92. package/dist/types-ts4.5/components/picker/EmojiPickerTabPanel.d.ts +0 -21
  93. package/dist/types-ts4.5/components/picker/EmojiPickerVirtualItems.d.ts +0 -40
  94. package/dist/types-ts4.5/components/picker/VirtualList.d.ts +0 -42
  95. package/dist/types-ts4.5/components/picker/assets/spot/search-no-result/SearchNoResultDark.d.ts +0 -2
  96. package/dist/types-ts4.5/components/picker/assets/spot/search-no-result/SearchNoResultLight.d.ts +0 -2
  97. package/dist/types-ts4.5/components/picker/categories.d.ts +0 -9
  98. package/dist/types-ts4.5/components/picker/utils.d.ts +0 -3
  99. package/dist/types-ts4.5/components/typeahead/EmojiTypeAhead.d.ts +0 -28
  100. package/dist/types-ts4.5/components/typeahead/EmojiTypeAheadComponent.d.ts +0 -73
  101. package/dist/types-ts4.5/components/typeahead/EmojiTypeAheadItem.d.ts +0 -17
  102. package/dist/types-ts4.5/components/typeahead/EmojiTypeAheadList.d.ts +0 -34
  103. package/dist/types-ts4.5/components/typeahead/EmojiTypeAheadListContainer.d.ts +0 -10
  104. package/dist/types-ts4.5/components/typeahead/EmojiTypeAheadSpinner.d.ts +0 -1
  105. package/dist/types-ts4.5/components/typeahead/styles.d.ts +0 -3
  106. package/dist/types-ts4.5/components/uploader/EmojiUploadComponent.d.ts +0 -18
  107. package/dist/types-ts4.5/components/uploader/EmojiUploader.d.ts +0 -21
  108. package/dist/types-ts4.5/context/EmojiCommonProvider.d.ts +0 -17
  109. package/dist/types-ts4.5/context/EmojiContext.d.ts +0 -4
  110. package/dist/types-ts4.5/context/EmojiContextProvider.d.ts +0 -7
  111. package/dist/types-ts4.5/context/EmojiPickerListContext.d.ts +0 -10
  112. package/dist/types-ts4.5/element.d.ts +0 -3
  113. package/dist/types-ts4.5/hooks/useEmoji.d.ts +0 -5
  114. package/dist/types-ts4.5/hooks/useEmojiContext.d.ts +0 -5
  115. package/dist/types-ts4.5/hooks/useEmojiPickerListContext.d.ts +0 -2
  116. package/dist/types-ts4.5/hooks/useInView.d.ts +0 -7
  117. package/dist/types-ts4.5/hooks/useIsMounted.d.ts +0 -1
  118. package/dist/types-ts4.5/hooks/usePrevious.d.ts +0 -1
  119. package/dist/types-ts4.5/i18n/cs.d.ts +0 -55
  120. package/dist/types-ts4.5/i18n/da.d.ts +0 -55
  121. package/dist/types-ts4.5/i18n/de.d.ts +0 -55
  122. package/dist/types-ts4.5/i18n/en.d.ts +0 -55
  123. package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -55
  124. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -55
  125. package/dist/types-ts4.5/i18n/es.d.ts +0 -55
  126. package/dist/types-ts4.5/i18n/et.d.ts +0 -39
  127. package/dist/types-ts4.5/i18n/fi.d.ts +0 -55
  128. package/dist/types-ts4.5/i18n/fr.d.ts +0 -55
  129. package/dist/types-ts4.5/i18n/hr.d.ts +0 -54
  130. package/dist/types-ts4.5/i18n/hu.d.ts +0 -55
  131. package/dist/types-ts4.5/i18n/index.d.ts +0 -37
  132. package/dist/types-ts4.5/i18n/is.d.ts +0 -33
  133. package/dist/types-ts4.5/i18n/it.d.ts +0 -55
  134. package/dist/types-ts4.5/i18n/ja.d.ts +0 -55
  135. package/dist/types-ts4.5/i18n/ko.d.ts +0 -55
  136. package/dist/types-ts4.5/i18n/languages.d.ts +0 -28
  137. package/dist/types-ts4.5/i18n/nb.d.ts +0 -55
  138. package/dist/types-ts4.5/i18n/nl.d.ts +0 -55
  139. package/dist/types-ts4.5/i18n/pl.d.ts +0 -55
  140. package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -55
  141. package/dist/types-ts4.5/i18n/pt_PT.d.ts +0 -39
  142. package/dist/types-ts4.5/i18n/ro.d.ts +0 -33
  143. package/dist/types-ts4.5/i18n/ru.d.ts +0 -55
  144. package/dist/types-ts4.5/i18n/sk.d.ts +0 -39
  145. package/dist/types-ts4.5/i18n/sl.d.ts +0 -54
  146. package/dist/types-ts4.5/i18n/sr_RS.d.ts +0 -54
  147. package/dist/types-ts4.5/i18n/sr_YR.d.ts +0 -54
  148. package/dist/types-ts4.5/i18n/sv.d.ts +0 -55
  149. package/dist/types-ts4.5/i18n/th.d.ts +0 -55
  150. package/dist/types-ts4.5/i18n/tr.d.ts +0 -55
  151. package/dist/types-ts4.5/i18n/uk.d.ts +0 -55
  152. package/dist/types-ts4.5/i18n/vi.d.ts +0 -55
  153. package/dist/types-ts4.5/i18n/zh.d.ts +0 -55
  154. package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -55
  155. package/dist/types-ts4.5/index.d.ts +0 -27
  156. package/dist/types-ts4.5/picker.d.ts +0 -1
  157. package/dist/types-ts4.5/resource.d.ts +0 -6
  158. package/dist/types-ts4.5/typeahead.d.ts +0 -2
  159. package/dist/types-ts4.5/types.d.ts +0 -389
  160. package/dist/types-ts4.5/util/DuplicateLimitedQueue.d.ts +0 -91
  161. package/dist/types-ts4.5/util/StoredDuplicateLimitedQueue.d.ts +0 -46
  162. package/dist/types-ts4.5/util/analytics/analytics.d.ts +0 -69
  163. package/dist/types-ts4.5/util/analytics/index.d.ts +0 -6
  164. package/dist/types-ts4.5/util/analytics/samplingUfo.d.ts +0 -38
  165. package/dist/types-ts4.5/util/analytics/ufoExperiences.d.ts +0 -14
  166. package/dist/types-ts4.5/util/analytics/useSampledUFOComponentExperience.d.ts +0 -8
  167. package/dist/types-ts4.5/util/browser-support.d.ts +0 -6
  168. package/dist/types-ts4.5/util/constants.d.ts +0 -72
  169. package/dist/types-ts4.5/util/emojiIdToEmoji.d.ts +0 -15
  170. package/dist/types-ts4.5/util/filters.d.ts +0 -8
  171. package/dist/types-ts4.5/util/image.d.ts +0 -10
  172. package/dist/types-ts4.5/util/is-ssr.d.ts +0 -1
  173. package/dist/types-ts4.5/util/keymaps.d.ts +0 -14
  174. package/dist/types-ts4.5/util/logger.d.ts +0 -4
  175. package/dist/types-ts4.5/util/mouse.d.ts +0 -8
  176. package/dist/types-ts4.5/util/shared-styles.d.ts +0 -13
  177. package/dist/types-ts4.5/util/storage-available.d.ts +0 -3
  178. package/dist/types-ts4.5/util/timed-promise.d.ts +0 -1
  179. package/dist/types-ts4.5/util/type-helpers.d.ts +0 -25
  180. package/dist/types-ts4.5/utils.d.ts +0 -4
@@ -1,160 +0,0 @@
1
- import { AbstractResource, type OnProviderChange, type ServiceConfig } from '@atlaskit/util-service-support';
2
- import type { CategoryId } from '../components/picker/categories';
3
- import { type EmojiDescription, type EmojiId, type EmojiProvider, type EmojiResponse, type EmojiSearchResult, type EmojiUpload, type OptionalEmojiDescription, type OptionalEmojiDescriptionWithVariations, type OptionalUser, type SearchOptions, type ToneSelection, type UploadingEmojiProvider, type User } from '../types';
4
- import EmojiRepository from './EmojiRepository';
5
- import SiteEmojiResource from './media/SiteEmojiResource';
6
- import type { OptimisticImageApiLoaderConfig, Options, SingleEmojiApiLoaderConfig, EmojiLoadSuccessCallback, EmojiLoadFailCallback } from './EmojiUtils';
7
- interface GetEmojiProviderOptions {
8
- /**
9
- * Whether fetch emoji provider at start
10
- * @defaultValue true
11
- */
12
- fetchAtStart?: boolean;
13
- }
14
- export type { EmojiProvider, UploadingEmojiProvider } from '../types';
15
- export interface EmojiResourceConfig {
16
- /**
17
- * Must be set to true to enable upload support in the emoji components.
18
- *
19
- * Can be used for the restriction of the upload UI based on permissions, or feature flags.
20
- *
21
- * Note this also requires that other conditions are met (for example, one of the providers
22
- * must support upload for the UploadingEmojiResource implementation of UploadingEmojiProvider).
23
- */
24
- allowUpload?: boolean;
25
- /**
26
- * Logged user in the Product.
27
- */
28
- currentUser?: User;
29
- /**
30
- * A callback triggered on emoji load failure
31
- */
32
- onEmojiLoadFail?: EmojiLoadFailCallback;
33
- /**
34
- * A callback triggered on emoji load success
35
- */
36
- onEmojiLoadSuccess?: EmojiLoadSuccessCallback;
37
- /**
38
- * Renders an image while the provider is being downloaded to reduce the time
39
- * the user is being presented with a placeholder
40
- */
41
- optimisticImageApi?: OptimisticImageApiLoaderConfig;
42
- /**
43
- * Additional configuration:
44
- * * On-demand Fetching - Useful for when a product may prefer manually controlling when providers are fetched
45
- */
46
- options?: Options;
47
- /**
48
- * This defines the different providers. Later providers will override earlier
49
- * providers when performing shortName based look up.
50
- */
51
- providers: ServiceConfig[];
52
- /**
53
- * The service configuration for remotely recording emoji selections.
54
- * A post will be performed to this URL with the EmojiId as the body.
55
- */
56
- recordConfig?: ServiceConfig;
57
- /**
58
- * This is specifically used for fetching a meta information of a single emoji.
59
- * Useful for when rendering a single or a subset of emojis on a page that does not require the
60
- * whole provider list to be downloaded.
61
- */
62
- singleEmojiApi?: SingleEmojiApiLoaderConfig;
63
- }
64
- export interface OnEmojiProviderChange extends OnProviderChange<EmojiSearchResult, any, void> {
65
- }
66
- export interface Retry<T> {
67
- (): Promise<T> | T;
68
- }
69
- export interface ResolveReject<T> {
70
- reject(reason?: any): void;
71
- resolve(result: T): void;
72
- }
73
- /**
74
- * Checks if the emojiProvider can support uploading at a feature level.
75
- *
76
- * Follow this up with an isUploadSupported() check to see if the provider is actually
77
- * configured to support uploads.
78
- * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates
79
- */
80
- export declare const supportsUploadFeature: (emojiProvider: EmojiProvider) => emojiProvider is UploadingEmojiProvider;
81
- export interface LastQuery {
82
- options?: SearchOptions;
83
- query?: string;
84
- }
85
- export declare class EmojiResource extends AbstractResource<string, EmojiSearchResult, any, undefined, SearchOptions> implements EmojiProvider {
86
- protected recordConfig?: ServiceConfig;
87
- protected emojiRepository?: EmojiRepository;
88
- protected lastQuery?: LastQuery;
89
- protected activeLoaders: number;
90
- protected initialLoaders: number;
91
- protected retries: Map<Retry<any>, ResolveReject<any>>;
92
- protected siteEmojiResource?: SiteEmojiResource;
93
- protected selectedTone: ToneSelection;
94
- protected currentUser?: User;
95
- protected isInitialised: boolean;
96
- protected fetchOnDemand: boolean;
97
- protected emojiResponses: EmojiResponse[];
98
- emojiProviderConfig: EmojiResourceConfig;
99
- constructor(config: EmojiResourceConfig);
100
- /**
101
- * Get the emoji provider from Emoji Resource
102
- * @returns Promise<EmojiProvider>
103
- */
104
- getEmojiProvider(options?: GetEmojiProviderOptions): Promise<EmojiProvider>;
105
- private fetchIndividualProvider;
106
- fetchEmojiProvider(force?: boolean): Promise<EmojiRepository | undefined>;
107
- onlyFetchOnDemand(): boolean;
108
- fetchByEmojiId(emojiId: EmojiId, optimistic: boolean): Promise<OptionalEmojiDescriptionWithVariations>;
109
- private getProviderType;
110
- protected initEmojiRepository(emojiResponses: EmojiResponse[]): void;
111
- protected initSiteEmojiResource(emojiResponse: EmojiResponse, provider: ServiceConfig): Promise<void>;
112
- private performRetries;
113
- getOptimisticImageURL: (emojiId: EmojiId) => string | undefined;
114
- protected isRepositoryAvailable: <T>(repository?: T) => repository is T;
115
- private isLoaded;
116
- private loadStoredTone;
117
- protected refreshLastFilter(): void;
118
- protected retryIfLoading<T>(retry: Retry<T>, defaultResponse: T): Promise<T>;
119
- protected notifyResult(result: EmojiSearchResult): void;
120
- /**
121
- * Returns the EmojiDescription with a valid media path that includes query token and client attributes to access the emoji media inline.
122
- */
123
- getMediaEmojiDescriptionURLWithInlineToken(emoji: EmojiDescription): Promise<EmojiDescription>;
124
- loadMediaEmoji(emoji: EmojiDescription, useAlt?: boolean): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
125
- optimisticMediaRendering(emoji: EmojiDescription, useAlt?: boolean): boolean;
126
- filter(query?: string, options?: SearchOptions): void;
127
- findByShortName(shortName: string): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
128
- findByEmojiId(emojiId: EmojiId): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
129
- findById(id: string): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
130
- /**
131
- * Synchronously reads the emoji type from the local cache for the given emojiId.
132
- * Returns `undefined` when the emoji is not in the cache or no repository is initialised.
133
- * This is a pure cache read — no network requests are made.
134
- */
135
- getCachedEmojiType(emojiId: EmojiId): string | undefined;
136
- findInCategory(categoryId: CategoryId): Promise<EmojiDescription[]>;
137
- getAsciiMap(): Promise<Map<string, EmojiDescription>>;
138
- getFrequentlyUsed(options?: SearchOptions): Promise<EmojiDescription[]>;
139
- /**
140
- * Record the selection of an emoji to a remote service if 'recordConfig' has been supplied.
141
- * Regardless of the recordConfig, emoji selections will always be recorded on the EmojiRepository
142
- * for the purposes of tracking the frequency of use.
143
- *
144
- * @param emoji The full description of the emoji to record usage for.
145
- */
146
- recordSelection(emoji: EmojiDescription): Promise<any>;
147
- deleteSiteEmoji(emoji: EmojiDescription): Promise<boolean>;
148
- getSelectedTone(): ToneSelection;
149
- setSelectedTone(tone: ToneSelection): void;
150
- calculateDynamicCategories(): Promise<CategoryId[]>;
151
- getCurrentUser(): OptionalUser;
152
- protected addUnknownEmoji(emoji: EmojiDescription): void;
153
- }
154
- export default class UploadingEmojiResource extends EmojiResource implements UploadingEmojiProvider {
155
- protected allowUpload: boolean;
156
- constructor(config: EmojiResourceConfig);
157
- isUploadSupported(): Promise<boolean>;
158
- uploadCustomEmoji(upload: EmojiUpload, retry?: boolean, timeout?: number): Promise<EmojiDescription>;
159
- prepareForUpload(): Promise<void>;
160
- }
@@ -1,29 +0,0 @@
1
- import { type RequestServiceOptions, type ServiceConfig } from '@atlaskit/util-service-support';
2
- import { type AltRepresentations, type EmojiDescription, type EmojiDescriptionWithVariations, type EmojiMeta, type EmojiRepresentation, type EmojiResponse, type EmojiServiceDescriptionWithVariations, type EmojiServiceRepresentation, type EmojiServiceResponse, type EmojiId } from '../types';
3
- export interface EmojiLoaderConfig extends ServiceConfig {
4
- getRatio?: () => number;
5
- }
6
- export interface Options {
7
- onlyFetchOnDemand?: boolean;
8
- }
9
- export interface SingleEmojiApiLoaderConfig extends Omit<ServiceConfig, 'url'> {
10
- getUrl: (emojiId: EmojiId) => string;
11
- }
12
- export interface OptimisticImageApiLoaderConfig extends Omit<ServiceConfig, 'url'> {
13
- getUrl: (emojiId: EmojiId) => string;
14
- }
15
- export type EmojiLoadSuccessCallback = (emojiId?: string) => void;
16
- export type EmojiLoadFailCallback = (emojiId?: string, reason?: string) => void;
17
- export declare const emojiRequest: (provider: EmojiLoaderConfig, options?: RequestServiceOptions) => Promise<EmojiServiceResponse>;
18
- export declare const getPixelRatio: () => number;
19
- export declare const getAltRepresentation: (reps: AltRepresentations) => EmojiServiceRepresentation;
20
- export declare const isMediaApiUrl: (url: string, meta?: EmojiMeta) => boolean;
21
- export declare const denormaliseServiceRepresentation: (representation: EmojiServiceRepresentation, meta?: EmojiMeta) => EmojiRepresentation;
22
- export declare const denormaliseServiceAltRepresentation: (altReps?: AltRepresentations, meta?: EmojiMeta) => EmojiRepresentation;
23
- export declare const denormaliseSkinEmoji: (emoji: EmojiServiceDescriptionWithVariations, meta?: EmojiMeta) => EmojiDescriptionWithVariations[];
24
- /**
25
- * Denormalised an emoji response (emojis + sprite references) into an array of
26
- * emoji with local sprite definitions.
27
- */
28
- export declare const denormaliseEmojiServiceResponse: (emojiData: EmojiServiceResponse) => EmojiResponse;
29
- export declare const shouldUseAltRepresentation: (emoji: EmojiDescription, fitToHeight?: number) => boolean;
@@ -1,109 +0,0 @@
1
- import type { EmojiDescription } from '../../types';
2
- /**
3
- * Create the default sort comparator to be used for the user queries against emoji
4
- *
5
- * @param query the query used in the search to be sorted. Any colons will be stripped from the query and it will be
6
- * converted to lowercase.
7
- * @param orderedIds the id of emoji ordered by how frequently they are used
8
- */
9
- export declare function createSearchEmojiComparator(query?: string, orderedIds?: Array<string>): EmojiComparator;
10
- export declare function createUsageOnlyEmojiComparator(orderedIds: Array<string>): EmojiComparator;
11
- /**
12
- * Returns a number representing the result of comparing e1 and e2.
13
- * Compatible with Array.sort, which is to say -
14
- * - less than 0 if e1 should come first
15
- * - 0 if they are equal; e1 and e2 will be unchanged in position relative to each other
16
- * - greater than 0 if e2 should come first.
17
- */
18
- export interface EmojiComparator {
19
- compare(e1: EmojiDescription, e2: EmojiDescription): number;
20
- }
21
- /**
22
- * A combinator comparator that applies an ordered chained of sub-comparators. The first comparator that
23
- * returns a non-zero value stops the chain and causes that value to be returned. If a comparator returns a
24
- * zero then the next one in the chain is tried.
25
- *
26
- * If no comparators in the chain return a non-zero value then zero will be returned.
27
- */
28
- export declare class ChainedEmojiComparator implements EmojiComparator {
29
- private chain;
30
- constructor(...comparators: EmojiComparator[]);
31
- compare(e1: EmojiDescription, e2: EmojiDescription): number;
32
- }
33
- /**
34
- * Orders two emoji such that if one of them has an ascii representation that exactly matches the query then it will
35
- * be ordered first.
36
- */
37
- export declare class AsciiMatchComparator implements EmojiComparator {
38
- private query;
39
- constructor(query: string);
40
- compare(e1: EmojiDescription, e2: EmojiDescription): 0 | 1 | -1;
41
- }
42
- /**
43
- * Orders two emoji such that the one who's shortname matches the query exactly comes first. If there are matching
44
- * shortnames then the type of emoji is taken into account with SITE emoji coming first.
45
- */
46
- export declare class ExactShortNameMatchComparator implements EmojiComparator {
47
- private colonQuery;
48
- private typeComparator;
49
- constructor(query: string);
50
- compare(e1: EmojiDescription, e2: EmojiDescription): number;
51
- }
52
- /**
53
- * Orders two emoji based on their type, with the types being STANDARD, ATLASSIAN and SITE (in that order).
54
- * If the comparator is configured to 'reverse' then the order will be SITE, ATLASSIAN, STANDARD.
55
- *
56
- * Regardless of the reverse setting, an unknown type will always come last.
57
- */
58
- export declare class EmojiTypeComparator implements EmojiComparator {
59
- private typeToNumber;
60
- constructor(reverse?: boolean);
61
- compare(e1: EmojiDescription, e2: EmojiDescription): number;
62
- private emojiTypeToOrdinal;
63
- }
64
- /**
65
- * Order two emoji such as the one which is more frequently used comes first. If neither have any usage
66
- * information then leave their order unchanged.
67
- */
68
- export declare class UsageFrequencyComparator implements EmojiComparator {
69
- private positionLookup;
70
- constructor(orderedIds: Array<string>);
71
- compare(e1: EmojiDescription, e2: EmojiDescription): number;
72
- /**
73
- * Get the ordinal representing the position of this emoji.
74
- *
75
- * @param id the id of the emoji
76
- */
77
- private getPositionInOrder;
78
- }
79
- type KeysOfType<T, TProp> = {
80
- [P in keyof T]: T[P] extends TProp | undefined ? P : never;
81
- }[keyof T];
82
- /**
83
- * A comparator that will sort higher an emoji which matches the query string earliest in the indicated
84
- * property.
85
- */
86
- export declare class QueryStringPositionMatchComparator implements EmojiComparator {
87
- private readonly propertyName;
88
- private query;
89
- /**
90
- * @param query the query to match
91
- * @param propertyToCompare the property of EmojiDescription to check for query within
92
- */
93
- constructor(query: string, propertyToCompare: KeysOfType<EmojiDescription, string>);
94
- private getScore;
95
- compare(e1: EmojiDescription, e2: EmojiDescription): number;
96
- }
97
- export declare class OrderComparator implements EmojiComparator {
98
- private static INSTANCE;
99
- private constructor();
100
- static get Instance(): OrderComparator;
101
- compare(e1: EmojiDescription, e2: EmojiDescription): number;
102
- }
103
- export declare class AlphabeticalShortnameComparator implements EmojiComparator {
104
- private static INSTANCE;
105
- private constructor();
106
- static get Instance(): AlphabeticalShortnameComparator;
107
- compare(e1: EmojiDescription, e2: EmojiDescription): number;
108
- }
109
- export {};
@@ -1,46 +0,0 @@
1
- import type { EmojiDescription } from '../../types';
2
- import DuplicateLimitedQueue from '../../util/DuplicateLimitedQueue';
3
- /**
4
- * Keeps track of the last 150 emoji usages, although limiting the maximum count for a single emoji to 25 to
5
- * ensure we don't end up with only a single emoji being recorded. Usage is persisted to local storage for
6
- * consistency between 'sessions'.
7
- *
8
- * Skin tone variations for an emoji will be 'collapsed' so they are tracked as their base emoji. Gender
9
- * variations are not collapsed in this way and will be tracked per gender. This decision reflects the UI of
10
- * the EmojiPicker component.
11
- */
12
- export declare class UsageFrequencyTracker {
13
- private static readonly queueOptions;
14
- protected queue: DuplicateLimitedQueue<string>;
15
- private gateway;
16
- constructor(useStorageIfPossible?: boolean);
17
- /**
18
- * Record the fact that the supplied emoji was used. You should note that usage is updated asynchronously so you can not
19
- * count on getOrder() reflecting this usage immediately.
20
- *
21
- * @param emoji the emoji who's usage is to be recorded. If the emoji has no id then no usage will be recorded
22
- */
23
- recordUsage(emoji: EmojiDescription): void;
24
- /**
25
- * Returns an array of emoji id (without skin tone variations) sorted by most used to least used. If there
26
- * are no usages then an empty array will be returned.
27
- */
28
- getOrder(): Array<string>;
29
- /**
30
- * Exposed for testing only. Clear any recorded usage.
31
- */
32
- clear(): void;
33
- }
34
- export declare class Gateway {
35
- private maximumPermitted;
36
- private count;
37
- constructor(maximumPermitted: number);
38
- /**
39
- * Run the supplied function if the count of already submitted work allows it. Drop the work
40
- * if it's not allowed to run.
41
- *
42
- * Will return true if the function has been submitted or false if it was not submitted.
43
- */
44
- submit(f: () => void): boolean;
45
- private completed;
46
- }
@@ -1,53 +0,0 @@
1
- import type { EmojiDescription, OptionalEmojiDescription } from '../../types';
2
- import MediaImageLoader from './MediaImageLoader';
3
- import type TokenManager from './TokenManager';
4
- export interface EmojiCacheStrategy {
5
- loadEmoji(emoji: EmojiDescription, useAlt?: boolean): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
6
- optimisticRendering(): boolean;
7
- }
8
- /**
9
- * For browsers that support caching for resources
10
- * regardless of originally supplied headers (basically everything but Firefox).
11
- */
12
- export declare class BrowserCacheStrategy implements EmojiCacheStrategy {
13
- private cachedImageUrls;
14
- private mediaImageLoader;
15
- constructor(mediaImageLoader: MediaImageLoader);
16
- loadEmoji(emoji: EmojiDescription, useAlt?: boolean): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
17
- optimisticRendering(): boolean;
18
- static supported(mediaPath: string, mediaImageLoader: MediaImageLoader): Promise<boolean>;
19
- }
20
- /**
21
- * For browsers that do no cache images without equivalent headers (e.g. Firefox).
22
- *
23
- * Images are cached in memory in a LRU cache. Images considered too large,
24
- * are not cached, but retrieved each time.
25
- *
26
- * Images are still cached by the browser, but loading in asynchronous with
27
- * small delay noticable to the end user.
28
- */
29
- export declare class MemoryCacheStrategy implements EmojiCacheStrategy {
30
- private dataURLCache;
31
- private mediaImageLoader;
32
- constructor(mediaImageLoader: MediaImageLoader);
33
- loadEmoji(emoji: EmojiDescription, useAlt?: boolean): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
34
- optimisticRendering(): boolean;
35
- }
36
- /**
37
- * Provides a cache for Media Emoji.
38
- *
39
- * Emoji are returned immediately if cached and ready to use by the browser.
40
- *
41
- * Otherwise, they are loaded and returned via a promise.
42
- */
43
- export default class MediaEmojiCache {
44
- protected cache?: EmojiCacheStrategy;
45
- protected waitingInitUrls: string[];
46
- private cacheLoading;
47
- private mediaImageLoader;
48
- constructor(tokenManager: TokenManager);
49
- loadEmoji(emoji: EmojiDescription, useAlt?: boolean): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
50
- optimisticRendering(url: string): boolean | Promise<boolean>;
51
- protected getCache(url: string): EmojiCacheStrategy | Promise<EmojiCacheStrategy>;
52
- private initCache;
53
- }
@@ -1,21 +0,0 @@
1
- import type TokenManager from './TokenManager';
2
- export type DataURL = string;
3
- export interface MediaImageLoaderOptions {
4
- concurrentDownloadLimit: number;
5
- }
6
- export default class MediaImageLoader {
7
- private tokenManager;
8
- private mediaImageQueue;
9
- private activeProcessing;
10
- private concurrentDownloadLimit;
11
- private pendingRequests;
12
- constructor(tokenManager: TokenManager, options?: MediaImageLoaderOptions);
13
- loadMediaImage(url: string): Promise<DataURL>;
14
- getQueueSize(): number;
15
- getActiveDownloads(): number;
16
- private processFromQueue;
17
- private completedItem;
18
- private delay;
19
- private requestMediaEmoji;
20
- private readBlob;
21
- }
@@ -1,51 +0,0 @@
1
- import { type ServiceConfig } from '@atlaskit/util-service-support';
2
- import type { EmojiDescription, EmojiId, EmojiRepresentation, EmojiServiceDescription, EmojiUpload, MediaApiToken, OptionalEmojiDescription } from '../../types';
3
- import TokenManager from './TokenManager';
4
- export interface EmojiUploadResponse {
5
- emojis: EmojiServiceDescription[];
6
- }
7
- export interface EmojiProgress {
8
- readonly percent: number;
9
- }
10
- export interface EmojiProgessCallback {
11
- (progress: EmojiProgress): void;
12
- }
13
- type TokenisedEmojiRepresentation = {
14
- altRepresentation?: EmojiRepresentation;
15
- representation?: EmojiRepresentation;
16
- };
17
- export declare const mediaProportionOfProgress: number;
18
- export default class SiteEmojiResource {
19
- private siteServiceConfig;
20
- private mediaApiToken;
21
- private mediaEmojiCache;
22
- protected tokenManager: TokenManager;
23
- constructor(siteServiceConfig: ServiceConfig, mediaApiToken: MediaApiToken);
24
- /**
25
- * Will generate an emoji media path that is inclusive of client and token within the query parameter for media representation and altRepresentation
26
- */
27
- generateTokenisedMediaURLS(representation: EmojiRepresentation, altRepresentation?: EmojiRepresentation): Promise<TokenisedEmojiRepresentation>;
28
- /**
29
- * Will load media emoji, returning a new EmojiDescription if, for example,
30
- * the URL has changed.
31
- */
32
- loadMediaEmoji(emoji: EmojiDescription, useAlt?: boolean): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
33
- optimisticRendering(emoji: EmojiDescription, useAlt?: boolean): boolean | Promise<boolean>;
34
- uploadEmoji(upload: EmojiUpload, retry?: boolean, progressCallback?: EmojiProgessCallback): Promise<EmojiDescription>;
35
- /**
36
- * Check if the MediaEmojiResource has been able to initialise an uploadToken. Retrieving an upload token
37
- * is asynchronous so the Promise will need to resolve before the state is known. If the token retrieval
38
- * completes with failure then the Promise will resolve to false.
39
- */
40
- hasUploadToken(): Promise<boolean>;
41
- prepareForUpload(): void;
42
- findEmoji(emojiId: EmojiId): Promise<OptionalEmojiDescription>;
43
- /**
44
- * Calls to site-scoped EmojiResource to delete emoji
45
- * @param emoji media emoji to delete
46
- * @returns Promise.resolve() if success and Promise.reject() for failure
47
- */
48
- deleteEmoji(emoji: EmojiDescription): Promise<boolean>;
49
- private postToEmojiService;
50
- }
51
- export {};
@@ -1,13 +0,0 @@
1
- import type { MediaApiToken } from '../../types';
2
- import { type ServiceConfig } from '@atlaskit/util-service-support';
3
- export declare const EXPIRES_AT_LATENCY_IN_SECONDS = 30;
4
- export type TokenType = 'read' | 'upload';
5
- export default class TokenManager {
6
- private siteServiceConfig;
7
- private tokens;
8
- constructor(siteServiceConfig: ServiceConfig);
9
- isValidToken(mediaApiToken: MediaApiToken): boolean;
10
- fetchNewToken(type: TokenType): Promise<MediaApiToken>;
11
- addToken(type: TokenType, mediaApiToken: MediaApiToken): void;
12
- getToken(type: TokenType, forceRefresh?: boolean): Promise<MediaApiToken>;
13
- }
@@ -1,11 +0,0 @@
1
- import { type WrappedComponentProps } from 'react-intl';
2
- export declare const emojiActionsTestId = "emoji-actions";
3
- export declare const uploadEmojiTestId = "upload-emoji";
4
- type Props = {
5
- onOpenUpload: () => void;
6
- uploadEnabled: boolean;
7
- };
8
- type PropsWithWrappedComponentPropsType = Props & WrappedComponentProps;
9
- type AddOwnEmojiProps = PropsWithWrappedComponentPropsType;
10
- export declare const AddOwnEmoji: (props: AddOwnEmojiProps) => JSX.Element;
11
- export {};
@@ -1,21 +0,0 @@
1
- import React from 'react';
2
- import { type EmojiDescription } from '../../types';
3
- import { type Props as EmojiProps } from './Emoji';
4
- export interface State {
5
- cachedEmoji?: EmojiDescription;
6
- invalidImage?: boolean;
7
- }
8
- export interface CachingEmojiProps extends EmojiProps {
9
- placeholderSize?: number;
10
- }
11
- /**
12
- * Renders an emoji from a cached image, if required.
13
- */
14
- export declare const CachingEmoji: (props: React.PropsWithChildren<CachingEmojiProps>) => React.JSX.Element;
15
- /**
16
- * Rendering a media emoji image from a cache for media emoji, with different
17
- * rendering paths depending on caching strategy.
18
- */
19
- export declare const CachingMediaEmoji: (props: React.PropsWithChildren<CachingEmojiProps>) => React.JSX.Element;
20
- declare const _default_1: React.MemoExoticComponent<(props: React.PropsWithChildren<CachingEmojiProps>) => React.JSX.Element>;
21
- export default _default_1;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import type { EmojiDescription } from '../../types';
3
- export declare const DeletableEmojiTooltipContent: () => React.JSX.Element;
4
- export declare const DeletableEmojiTooltipContentForScreenReader: ({ emoji, }: {
5
- emoji: EmojiDescription;
6
- }) => React.JSX.Element;
@@ -1,7 +0,0 @@
1
- import { type ButtonProps } from '@atlaskit/button/standard-button';
2
- /**
3
- * Test id for wrapper Emoji delete button
4
- */
5
- export declare const RENDER_EMOJI_DELETE_BUTTON_TESTID = "render-emoji-delete-button";
6
- declare const DeleteButton: (props: ButtonProps) => JSX.Element;
7
- export default DeleteButton;
@@ -1,96 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React from 'react';
6
- import { type EmojiDescription, type OnEmojiEvent } from '../../types';
7
- export interface Props extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'onMouseMove' | 'onFocus'> {
8
- /**
9
- * Auto Width takes the constraint of height and enables native scaling based on the emojis image.
10
- * This is primarily used when rendering emojis for SSR as the component does not know the width and height
11
- * at the time of the render. It overrides the emoji representations width with 'auto' on the images width attribute
12
- *
13
- * Used only for image based emojis
14
- */
15
- autoWidth?: boolean;
16
- /**
17
- * Additional css classes, if required.
18
- */
19
- className?: string;
20
- /**
21
- * Disables lazy load on images
22
- */
23
- disableLazyLoad?: boolean;
24
- /**
25
- * This should only be set when the emoji is being used in the Editor.
26
- * Currently when set -- this prevents any aria labels being added.
27
- * This is acceptable in Editor -- as it uses another technique to announce the emoji nodes.
28
- */
29
- editorEmoji?: true;
30
- /**
31
- * The emoji to render
32
- */
33
- emoji: EmojiDescription;
34
- /**
35
- * Fits emoji to height in pixels, keeping aspect ratio
36
- */
37
- fitToHeight?: number;
38
- /**
39
- * Called when an emoji is deleted
40
- */
41
- onDelete?: OnEmojiEvent;
42
- /**
43
- * Called when the mouse moves over the emoji.
44
- */
45
- onFocus?: OnEmojiEvent;
46
- /**
47
- * Callback for if an emoji image fails to load.
48
- */
49
- onLoadError?: OnEmojiEvent<HTMLImageElement>;
50
- /**
51
- * Callback for if an emoji image succesfully loads.
52
- */
53
- onLoadSuccess?: (emoji: EmojiDescription) => void;
54
- /**
55
- * Called when the mouse moves over the emoji.
56
- */
57
- onMouseMove?: OnEmojiEvent;
58
- /**
59
- * Called when an emoji is selected
60
- */
61
- onSelected?: OnEmojiEvent;
62
- /**
63
- * Show the emoji as selected
64
- */
65
- selected?: boolean;
66
- /**
67
- * Automatically show the emoji as selected based on mouse hover.
68
- * CSS, fast, does not require a re-render, but selected state not
69
- * externally controlled via props.
70
- */
71
- selectOnHover?: boolean;
72
- /**
73
- * Indicates whether emoji is an interactive element (tab index and role) or just a view
74
- */
75
- shouldBeInteractive?: boolean;
76
- /**
77
- * Show a delete button on mouse hover
78
- * Used only for custom emoji
79
- */
80
- showDelete?: boolean;
81
- /**
82
- * Show a tooltip on mouse hover.
83
- */
84
- showTooltip?: boolean;
85
- }
86
- export declare const SpriteEmoji: (props: Props) => JSX.Element;
87
- export declare const UnicodeEmoji: (props: Props) => JSX.Element;
88
- export declare const ImageEmoji: (props: Props) => JSX.Element;
89
- interface EmojiNodeWrapperProps extends Props {
90
- type: 'sprite' | 'image' | 'unicode';
91
- }
92
- export declare const EmojiNodeWrapper: React.ForwardRefExoticComponent<EmojiNodeWrapperProps & {
93
- children?: React.ReactNode | undefined;
94
- } & React.RefAttributes<HTMLSpanElement>>;
95
- export declare const Emoji: (props: Props) => JSX.Element;
96
- export default Emoji;