@atlaskit/emoji 72.1.11 → 72.2.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/report.api.md DELETED
@@ -1,1377 +0,0 @@
1
- <!-- API Report Version: 2.3 -->
2
-
3
- ## API Report File for "@atlaskit/emoji"
4
-
5
- > Do not edit this file. This report is auto-generated using
6
- > [API Extractor](https://api-extractor.com/).
7
- > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
8
-
9
- ### Table of contents
10
-
11
- - [Main Entry Types](#main-entry-types)
12
- - [Peer Dependencies](#peer-dependencies)
13
-
14
- ### Main Entry Types
15
-
16
- <!--SECTION START: Main Entry Types-->
17
-
18
- ```ts
19
- /// <reference types="react" />
20
-
21
- import { AbstractResource } from '@atlaskit/util-service-support';
22
- import { Component } from 'react';
23
- import type { ComponentClass } from 'react';
24
- import { ComponentType } from 'react';
25
- import { ConcurrentExperience } from '@atlaskit/ufo';
26
- import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
27
- import { FC } from 'react';
28
- import { ForwardRefExoticComponent } from 'react';
29
- import { jsx } from '@emotion/react';
30
- import type { Provider } from '@atlaskit/util-service-support/types';
31
- import { PureComponent } from 'react';
32
- import { default as React_2 } from 'react';
33
- import { RefAttributes } from 'react';
34
- import { ServiceConfig } from '@atlaskit/util-service-support';
35
- import type { SyntheticEvent } from 'react';
36
- import { UFOExperience } from '@atlaskit/ufo';
37
- import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
38
-
39
- export { AbstractResource };
40
-
41
- // @public (undocumented)
42
- export interface AltRepresentations {
43
- // (undocumented)
44
- [key: string]: EmojiServiceRepresentation;
45
- }
46
-
47
- // @public (undocumented)
48
- interface BaseResourcedEmojiProps {
49
- customFallback?: JSX.Element | string;
50
- emojiId: EmojiId;
51
- emojiProviderLookupOrder?: EmojiProviderLookupOrder;
52
- fitToHeight?: number;
53
- optimistic?: boolean;
54
- optimisticImageURL?: string;
55
- showTooltip?: boolean;
56
- }
57
-
58
- // @public (undocumented)
59
- export interface CategoryDescription {
60
- // (undocumented)
61
- icon: any;
62
- // (undocumented)
63
- id: string;
64
- // (undocumented)
65
- name: keyof typeof messages;
66
- // (undocumented)
67
- order: number;
68
- }
69
-
70
- // @public (undocumented)
71
- export type CategoryId =
72
- | 'ACTIVITY'
73
- | 'ATLASSIAN'
74
- | 'CUSTOM'
75
- | 'FLAGS'
76
- | 'FOODS'
77
- | 'FREQUENT'
78
- | 'NATURE'
79
- | 'OBJECTS'
80
- | 'PEOPLE'
81
- | 'PLACES'
82
- | 'SYMBOLS';
83
-
84
- // @public (undocumented)
85
- export const customCategory = 'CUSTOM';
86
-
87
- // @public (undocumented)
88
- export const defaultEmojiHeight = 20;
89
-
90
- // @public
91
- export const denormaliseEmojiServiceResponse: (emojiData: EmojiServiceResponse) => EmojiResponse;
92
-
93
- // @public
94
- class DuplicateLimitedQueue<T> {
95
- constructor(options: QueueOptions);
96
- protected bulkEnqueue(items: T[]): void;
97
- clear(): void;
98
- // (undocumented)
99
- enqueue(item: T): void;
100
- protected getItems(): T[];
101
- getItemsOrderedByDuplicateCount(): Array<T>;
102
- }
103
-
104
- // @public (undocumented)
105
- export const Emoji: (props: Props) => jsx.JSX.Element;
106
-
107
- // @public
108
- export const EmojiCommonProvider: FC<EmojiCommonProviderProps>;
109
-
110
- // @public (undocumented)
111
- interface EmojiCommonProviderProps {
112
- emojiProvider?: EmojiProvider;
113
- }
114
-
115
- // @public (undocumented)
116
- interface EmojiContext {
117
- // (undocumented)
118
- emoji: {
119
- emojiProvider: EmojiProvider;
120
- };
121
- }
122
-
123
- // @public (undocumented)
124
- export const EmojiContextProvider: FC<EmojiContextProviderType>;
125
-
126
- // @public (undocumented)
127
- type EmojiContextProviderType = {
128
- emojiContextValue: EmojiContextType;
129
- };
130
-
131
- // @public (undocumented)
132
- type EmojiContextType = EmojiContext | null;
133
-
134
- // @public (undocumented)
135
- export interface EmojiDescription extends EmojiId {
136
- // (undocumented)
137
- altRepresentation?: EmojiRepresentation;
138
- // (undocumented)
139
- ascii?: string[];
140
- // (undocumented)
141
- category: string;
142
- // (undocumented)
143
- createdDate?: string;
144
- // (undocumented)
145
- creatorUserId?: string;
146
- // (undocumented)
147
- name?: string;
148
- // (undocumented)
149
- order?: number;
150
- // (undocumented)
151
- representation: EmojiRepresentation;
152
- // (undocumented)
153
- searchable: boolean;
154
- // (undocumented)
155
- type: string;
156
- }
157
-
158
- // @public (undocumented)
159
- export interface EmojiDescriptionWithVariations extends EmojiDescription {
160
- // (undocumented)
161
- skinVariations?: EmojiDescription[];
162
- }
163
-
164
- // @public
165
- export interface EmojiId {
166
- // (undocumented)
167
- fallback?: string;
168
- // (undocumented)
169
- id?: string;
170
- // (undocumented)
171
- shortName: string;
172
- }
173
-
174
- // @public
175
- export type EmojiProviderLookupOrder = string[];
176
-
177
- // @public (undocumented)
178
- export const emojiImage = 'emoji-common-emoji-image';
179
-
180
- // @public (undocumented)
181
- export interface EmojiImageRepresentation {
182
- // (undocumented)
183
- height: number;
184
- // (undocumented)
185
- width: number;
186
- }
187
-
188
- // @public
189
- export class EmojiLoader {
190
- constructor(config: EmojiLoaderConfig);
191
- loadEmoji(): Promise<EmojiResponse>;
192
- }
193
-
194
- // @public (undocumented)
195
- interface EmojiLoaderConfig extends ServiceConfig {
196
- // (undocumented)
197
- getRatio?: () => number;
198
- }
199
-
200
- // @public (undocumented)
201
- export interface EmojiMeta {
202
- // (undocumented)
203
- mediaApiToken?: MediaApiToken;
204
- // (undocumented)
205
- spriteSheets?: SpriteSheets;
206
- }
207
-
208
- // @public (undocumented)
209
- export const emojiNode = 'emoji-common-node';
210
-
211
- // @public (undocumented)
212
- const EmojiPicker: ForwardRefExoticComponent<
213
- Pick<
214
- Omit<Props_3 & WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps>,
215
- 'emojiProvider' | 'hideToneSelector' | 'onPickerRef' | 'onSelection'
216
- > &
217
- Partial<
218
- Pick<Omit<Props_3 & WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps>, 'size'>
219
- > &
220
- Partial<
221
- Pick<
222
- {
223
- size: string;
224
- },
225
- never
226
- >
227
- > &
228
- RefAttributes<any>
229
- >;
230
- export { EmojiPicker };
231
- export default EmojiPicker;
232
-
233
- // @public (undocumented)
234
- export const emojiPickerHeight = 295;
235
-
236
- // @public (undocumented)
237
- export const emojiPickerWidth = 350;
238
-
239
- // @public (undocumented)
240
- export const EmojiPlaceholder: (props: Props_2) => jsx.JSX.Element;
241
-
242
- // @public (undocumented)
243
- export const emojiPlaceholder = 'emoji-common-placeholder';
244
-
245
- // @public (undocumented)
246
- interface EmojiProgessCallback {
247
- // (undocumented)
248
- (progress: EmojiProgress): void;
249
- }
250
-
251
- // @public (undocumented)
252
- interface EmojiProgress {
253
- // (undocumented)
254
- readonly percent: number;
255
- }
256
-
257
- // @public (undocumented)
258
- export interface EmojiProvider
259
- extends Provider<string, EmojiSearchResult, any, undefined, SearchOptions> {
260
- calculateDynamicCategories?(): Promise<string[]>;
261
- deleteSiteEmoji(emoji: EmojiDescription): Promise<boolean>;
262
- fetchByEmojiId(
263
- emojiId: EmojiId,
264
- optimistic: boolean,
265
- emojiProviderLookupOrder?: EmojiProviderLookupOrder,
266
- ): OptionalEmojiDescriptionWithVariations | Promise<OptionalEmojiDescriptionWithVariations>;
267
- fetchEmojiProvider(force?: boolean): Promise<EmojiRepository | undefined>;
268
- findByEmojiId(
269
- emojiId: EmojiId,
270
- emojiProviderLookupOrder?: EmojiProviderLookupOrder,
271
- ): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
272
- findById(id: string): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
273
- findByShortName(
274
- shortName: string,
275
- emojiProviderLookupOrder?: EmojiProviderLookupOrder,
276
- ): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
277
- findInCategory(categoryId: string): Promise<EmojiDescription[]>;
278
- getAsciiMap(): Promise<Map<string, EmojiDescription>>;
279
- getCurrentUser(): OptionalUser;
280
- getFrequentlyUsed(options?: SearchOptions): Promise<EmojiDescription[]>;
281
- getMediaEmojiDescriptionURLWithInlineToken(emoji: EmojiDescription): Promise<EmojiDescription>;
282
- getOptimisticImageURL(emojiId: EmojiId): string | undefined;
283
- getSelectedTone(): ToneSelection;
284
- loadMediaEmoji(
285
- emoji: EmojiDescription,
286
- useAlt?: boolean,
287
- ): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
288
- onlyFetchOnDemand?(): boolean;
289
- optimisticMediaRendering(emoji: EmojiDescription, useAlt?: boolean): boolean;
290
- recordSelection?(emoji: EmojiDescription): Promise<any>;
291
- setSelectedTone(tone: ToneSelection): void;
292
- }
293
-
294
- // @public (undocumented)
295
- export class EmojiRepository {
296
- constructor(emojis: EmojiDescription[], usageTracker?: UsageFrequencyTracker);
297
- // (undocumented)
298
- addUnknownEmoji(emoji: EmojiDescription): void;
299
- all(): EmojiSearchResult;
300
- // (undocumented)
301
- delete(emoji: EmojiDescription): void;
302
- findAllMatchingShortName(shortName: string): EmojiDescription[];
303
- // (undocumented)
304
- findByAsciiRepresentation(asciiEmoji: string): OptionalEmojiDescription;
305
- findById(id: string): OptionalEmojiDescription;
306
- findByShortName(
307
- shortName: string,
308
- emojiProviderLookupOrder?: EmojiProviderLookupOrder,
309
- ): OptionalEmojiDescription;
310
- // (undocumented)
311
- findInCategory(categoryId: CategoryId): EmojiDescription[];
312
- // (undocumented)
313
- getAsciiMap(): Map<string, EmojiDescription>;
314
- // (undocumented)
315
- getDynamicCategoryList(): CategoryId[];
316
- getFrequentlyUsed(options?: SearchOptions): EmojiDescription[];
317
- search(query?: string, options?: SearchOptions): EmojiSearchResult;
318
- // (undocumented)
319
- protected usageTracker: UsageFrequencyTracker;
320
- used(emoji: EmojiDescription): void;
321
- }
322
-
323
- // @public (undocumented)
324
- export type EmojiRepresentation =
325
- | ImageRepresentation
326
- | MediaApiRepresentation
327
- | SpriteRepresentation
328
- | undefined;
329
-
330
- // @public (undocumented)
331
- export class EmojiResource extends EmojiResource_2 implements UploadingEmojiProvider {
332
- constructor(config: EmojiResourceConfig);
333
- // (undocumented)
334
- protected allowUpload: boolean;
335
- // (undocumented)
336
- isUploadSupported(): Promise<boolean>;
337
- // (undocumented)
338
- prepareForUpload(): Promise<void>;
339
- // (undocumented)
340
- uploadCustomEmoji(upload: EmojiUpload, retry?: boolean): Promise<EmojiDescription>;
341
- }
342
-
343
- // @public (undocumented)
344
- class EmojiResource_2
345
- extends AbstractResource<string, EmojiSearchResult, any, undefined, SearchOptions>
346
- implements EmojiProvider
347
- {
348
- constructor(config: EmojiResourceConfig);
349
- // (undocumented)
350
- protected activeLoaders: number;
351
- // (undocumented)
352
- protected addUnknownEmoji(emoji: EmojiDescription): void;
353
- // (undocumented)
354
- calculateDynamicCategories(): Promise<CategoryId[]>;
355
- // (undocumented)
356
- protected currentUser?: User;
357
- // (undocumented)
358
- deleteSiteEmoji(emoji: EmojiDescription): Promise<boolean>;
359
- // (undocumented)
360
- emojiProviderConfig: EmojiResourceConfig;
361
- // (undocumented)
362
- protected emojiRepository?: EmojiRepository;
363
- // (undocumented)
364
- protected emojiResponses: EmojiResponse[];
365
- // (undocumented)
366
- fetchByEmojiId(
367
- emojiId: EmojiId,
368
- optimistic: boolean,
369
- emojiProviderLookupOrder?: EmojiProviderLookupOrder,
370
- ): Promise<OptionalEmojiDescriptionWithVariations>;
371
- // (undocumented)
372
- fetchEmojiProvider(force?: boolean): Promise<EmojiRepository | undefined>;
373
- // (undocumented)
374
- protected fetchOnDemand: boolean;
375
- // (undocumented)
376
- filter(query?: string, options?: SearchOptions): void;
377
- // (undocumented)
378
- findByEmojiId(
379
- emojiId: EmojiId,
380
- emojiProviderLookupOrder?: EmojiProviderLookupOrder,
381
- ): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
382
- // (undocumented)
383
- findById(id: string): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
384
- // (undocumented)
385
- findByShortName(
386
- shortName: string,
387
- emojiProviderLookupOrder?: EmojiProviderLookupOrder,
388
- ): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
389
- // (undocumented)
390
- findInCategory(categoryId: CategoryId): Promise<EmojiDescription[]>;
391
- // (undocumented)
392
- getAsciiMap(): Promise<Map<string, EmojiDescription>>;
393
- // (undocumented)
394
- getCurrentUser(): OptionalUser;
395
- getEmojiProvider(options?: GetEmojiProviderOptions): Promise<EmojiProvider>;
396
- // (undocumented)
397
- getFrequentlyUsed(options?: SearchOptions): Promise<EmojiDescription[]>;
398
- getMediaEmojiDescriptionURLWithInlineToken(emoji: EmojiDescription): Promise<EmojiDescription>;
399
- // (undocumented)
400
- getOptimisticImageURL: (emojiId: EmojiId) => string | undefined;
401
- // (undocumented)
402
- getSelectedTone(): ToneSelection;
403
- // (undocumented)
404
- protected initEmojiRepository(emojiResponses: EmojiResponse[]): void;
405
- // (undocumented)
406
- protected initialLoaders: number;
407
- // (undocumented)
408
- protected initSiteEmojiResource(
409
- emojiResponse: EmojiResponse,
410
- provider: ServiceConfig,
411
- ): Promise<void>;
412
- // (undocumented)
413
- protected isInitialised: boolean;
414
- // (undocumented)
415
- protected isRepositoryAvailable: <T>(repository?: T | undefined) => repository is T;
416
- // (undocumented)
417
- protected lastQuery?: LastQuery;
418
- // (undocumented)
419
- loadMediaEmoji(
420
- emoji: EmojiDescription,
421
- useAlt?: boolean,
422
- ): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
423
- // (undocumented)
424
- protected notifyResult(result: EmojiSearchResult): void;
425
- // (undocumented)
426
- onlyFetchOnDemand(): boolean;
427
- // (undocumented)
428
- optimisticMediaRendering(emoji: EmojiDescription, useAlt?: boolean): boolean;
429
- // (undocumented)
430
- protected recordConfig?: ServiceConfig;
431
- recordSelection(emoji: EmojiDescription): Promise<any>;
432
- // (undocumented)
433
- protected refreshLastFilter(): void;
434
- // (undocumented)
435
- protected retries: Map<Retry<any>, ResolveReject<any>>;
436
- // (undocumented)
437
- protected retryIfLoading<T>(retry: Retry<T>, defaultResponse: T): Promise<T>;
438
- // (undocumented)
439
- protected selectedTone: ToneSelection;
440
- // (undocumented)
441
- setSelectedTone(tone: ToneSelection): void;
442
- // (undocumented)
443
- protected siteEmojiResource?: SiteEmojiResource;
444
- }
445
-
446
- // @public (undocumented)
447
- export interface EmojiResourceConfig {
448
- allowUpload?: boolean;
449
- currentUser?: User;
450
- optimisticImageApi?: OptimisticImageApiLoaderConfig;
451
- options?: Options;
452
- providers: ServiceConfig[];
453
- recordConfig?: ServiceConfig;
454
- singleEmojiApi?: SingleEmojiApiLoaderConfig;
455
- }
456
-
457
- // @public (undocumented)
458
- export interface EmojiResponse {
459
- // (undocumented)
460
- emojis: EmojiDescriptionWithVariations[];
461
- // (undocumented)
462
- mediaApiToken?: MediaApiToken;
463
- }
464
-
465
- // @public (undocumented)
466
- export interface EmojiSearchResult {
467
- // (undocumented)
468
- emojis: EmojiDescription[];
469
- // (undocumented)
470
- query?: string;
471
- }
472
-
473
- // @public (undocumented)
474
- export interface EmojiServiceDescription {
475
- // (undocumented)
476
- altRepresentations?: AltRepresentations;
477
- // (undocumented)
478
- ascii?: string[];
479
- // (undocumented)
480
- category: string;
481
- // (undocumented)
482
- createdDate?: string;
483
- // (undocumented)
484
- creatorUserId?: string;
485
- // (undocumented)
486
- fallback?: string;
487
- // (undocumented)
488
- id: string;
489
- // (undocumented)
490
- name?: string;
491
- // (undocumented)
492
- order?: number;
493
- // (undocumented)
494
- representation: EmojiServiceRepresentation;
495
- // (undocumented)
496
- searchable: boolean;
497
- // (undocumented)
498
- shortName: string;
499
- // (undocumented)
500
- type: string;
501
- }
502
-
503
- // @public (undocumented)
504
- export interface EmojiServiceDescriptionWithVariations extends EmojiServiceDescription {
505
- // (undocumented)
506
- skinVariations?: EmojiServiceDescription[];
507
- }
508
-
509
- // @public (undocumented)
510
- export type EmojiServiceRepresentation = ImageRepresentation | SpriteServiceRepresentation;
511
-
512
- // @public
513
- export interface EmojiServiceResponse {
514
- // (undocumented)
515
- emojis: EmojiServiceDescriptionWithVariations[];
516
- // (undocumented)
517
- meta?: EmojiMeta;
518
- }
519
-
520
- // @public (undocumented)
521
- export const emojiSprite = 'emoji-common-emoji-sprite';
522
-
523
- // @public (undocumented)
524
- export class EmojiTypeAhead extends LoadingEmojiComponent<Props_7, State> {
525
- constructor(props: Props_7);
526
- // (undocumented)
527
- asyncLoadComponent(): void;
528
- // (undocumented)
529
- static AsyncLoadedComponent?: ComponentClass<Props_8>;
530
- // (undocumented)
531
- chooseCurrentSelection: () => void;
532
- // (undocumented)
533
- count: () => number;
534
- // (undocumented)
535
- renderLoaded(
536
- loadedEmojiProvider: EmojiProvider,
537
- TypeAheadComponent: ComponentClass<Props_8>,
538
- ): JSX.Element | null;
539
- // (undocumented)
540
- selectNext: () => void;
541
- // (undocumented)
542
- selectPrevious: () => void;
543
- // (undocumented)
544
- state: {
545
- asyncLoadedComponent: React_2.ComponentClass<Props_8, any> | undefined;
546
- };
547
- }
548
-
549
- // @public (undocumented)
550
- interface EmojiTypeAheadBaseProps {
551
- // (undocumented)
552
- createAnalyticsEvent?: CreateUIAnalyticsEvent;
553
- listLimit?: number;
554
- onClose?: OnLifecycle;
555
- onOpen?: OnLifecycle;
556
- onSelection?: OnEmojiEvent;
557
- query?: string;
558
- }
559
-
560
- // @public (undocumented)
561
- export class EmojiTypeAheadItem extends PureComponent<Props_11, {}> {
562
- // (undocumented)
563
- onEmojiMenuItemMouseMove: React_2.MouseEventHandler<HTMLDivElement>;
564
- // (undocumented)
565
- onEmojiSelected: React_2.MouseEventHandler<HTMLDivElement>;
566
- // (undocumented)
567
- render(): jsx.JSX.Element;
568
- }
569
-
570
- // @public (undocumented)
571
- export interface EmojiUpload {
572
- // (undocumented)
573
- dataURL: string;
574
- // (undocumented)
575
- filename: string;
576
- // (undocumented)
577
- height: number;
578
- // (undocumented)
579
- name: string;
580
- // (undocumented)
581
- shortName: string;
582
- // (undocumented)
583
- width: number;
584
- }
585
-
586
- // @public (undocumented)
587
- export type EmojiUploader = EmojiUploaderInternal;
588
-
589
- // @public (undocumented)
590
- export const EmojiUploader: React_2.ForwardRefExoticComponent<
591
- Omit<Props_5, keyof WithAnalyticsEventsProps> & React_2.RefAttributes<any>
592
- >;
593
-
594
- // @public (undocumented)
595
- class EmojiUploaderInternal extends LoadingEmojiComponent<Props_5, State> {
596
- constructor(props: Props_5);
597
- // (undocumented)
598
- asyncLoadComponent(): void;
599
- // (undocumented)
600
- static AsyncLoadedComponent?: FC<Props_6>;
601
- // (undocumented)
602
- renderLoaded(loadedEmojiProvider: EmojiProvider, EmojiUploadComponent: FC<Props_6>): JSX.Element;
603
- // (undocumented)
604
- state: {
605
- asyncLoadedComponent: React_2.FC<Props_6> | undefined;
606
- };
607
- }
608
-
609
- // @public
610
- export interface EmojiVariationDescription extends EmojiDescription {
611
- baseId: string;
612
- }
613
-
614
- // @public (undocumented)
615
- interface GetEmojiProviderOptions {
616
- fetchAtStart?: boolean;
617
- }
618
-
619
- // @public (undocumented)
620
- export interface ImageRepresentation extends EmojiImageRepresentation {
621
- // (undocumented)
622
- imagePath: string;
623
- }
624
-
625
- // @public (undocumented)
626
- interface LastQuery {
627
- // (undocumented)
628
- options?: SearchOptions;
629
- // (undocumented)
630
- query?: string;
631
- }
632
-
633
- // @public
634
- abstract class LoadingEmojiComponent<P extends Props_4, S extends State> extends Component<P, S> {
635
- constructor(props: P, state: S);
636
- // (undocumented)
637
- abstract asyncLoadComponent(): void;
638
- // (undocumented)
639
- componentDidMount(): void;
640
- // (undocumented)
641
- componentWillUnmount(): void;
642
- // (undocumented)
643
- render(): JSX.Element | null;
644
- // (undocumented)
645
- abstract renderLoaded(
646
- loadedEmojiProvider: EmojiProvider,
647
- asyncLoadedComponent: ComponentType<any>,
648
- ): JSX.Element | null;
649
- // (undocumented)
650
- renderLoading(): JSX.Element | null;
651
- // (undocumented)
652
- protected setAsyncState(asyncLoadedComponent: ComponentType<any>): void;
653
- // (undocumented)
654
- UNSAFE_componentWillReceiveProps(nextProps: Readonly<P>): void;
655
- }
656
-
657
- // @public (undocumented)
658
- export interface MediaApiRepresentation extends EmojiImageRepresentation {
659
- // (undocumented)
660
- mediaPath: string;
661
- }
662
-
663
- // @public
664
- export interface MediaApiToken {
665
- // (undocumented)
666
- clientId: string;
667
- // (undocumented)
668
- collectionName: string;
669
- // (undocumented)
670
- expiresAt: number;
671
- // (undocumented)
672
- jwt: string;
673
- // (undocumented)
674
- url: string;
675
- }
676
-
677
- // @public (undocumented)
678
- export type Message = React.ReactNode | string;
679
-
680
- // @public (undocumented)
681
- const messages: {
682
- deleteEmojiTooltip: {
683
- id: string;
684
- defaultMessage: string;
685
- description: string;
686
- };
687
- deleteEmojiTooltipForScreenreader: {
688
- id: string;
689
- defaultMessage: string;
690
- description: string;
691
- };
692
- deleteEmojiTitle: {
693
- id: string;
694
- defaultMessage: string;
695
- description: string;
696
- };
697
- deleteEmojiDescription: {
698
- id: string;
699
- defaultMessage: string;
700
- description: string;
701
- };
702
- deleteEmojiLabel: {
703
- id: string;
704
- defaultMessage: string;
705
- description: string;
706
- };
707
- addCustomEmojiLabel: {
708
- id: string;
709
- defaultMessage: string;
710
- description: string;
711
- };
712
- emojiPlaceholder: {
713
- id: string;
714
- defaultMessage: string;
715
- description: string;
716
- };
717
- emojiNameAriaLabel: {
718
- id: string;
719
- defaultMessage: string;
720
- description: string;
721
- };
722
- emojiChooseFileTitle: {
723
- id: string;
724
- defaultMessage: string;
725
- description: string;
726
- };
727
- emojiChooseFileScreenReaderDescription: {
728
- id: string;
729
- defaultMessage: string;
730
- description: string;
731
- };
732
- emojiSelectSkinToneButtonAriaLabelText: {
733
- id: string;
734
- defaultMessage: string;
735
- description: string;
736
- };
737
- emojiSelectSkinToneListAriaLabelText: {
738
- id: string;
739
- defaultMessage: string;
740
- description: string;
741
- };
742
- emojiImageRequirements: {
743
- id: string;
744
- defaultMessage: string;
745
- description: string;
746
- };
747
- emojiPreviewTitle: {
748
- id: string;
749
- defaultMessage: string;
750
- description: string;
751
- };
752
- emojiPreview: {
753
- id: string;
754
- defaultMessage: string;
755
- description: string;
756
- };
757
- addEmojiLabel: {
758
- id: string;
759
- defaultMessage: string;
760
- description: string;
761
- };
762
- retryLabel: {
763
- id: string;
764
- defaultMessage: string;
765
- description: string;
766
- };
767
- cancelLabel: {
768
- id: string;
769
- defaultMessage: string;
770
- description: string;
771
- };
772
- searchPlaceholder: {
773
- id: string;
774
- defaultMessage: string;
775
- description: string;
776
- };
777
- searchLabel: {
778
- id: string;
779
- defaultMessage: string;
780
- description: string;
781
- };
782
- searchResultsStatus: {
783
- id: string;
784
- defaultMessage: string;
785
- description: string;
786
- };
787
- searchResultsStatusSeeAll: {
788
- id: string;
789
- defaultMessage: string;
790
- description: string;
791
- };
792
- categoriesSelectorLabel: {
793
- id: string;
794
- defaultMessage: string;
795
- description: string;
796
- };
797
- categoriesSearchResults: {
798
- id: string;
799
- defaultMessage: string;
800
- description: string;
801
- };
802
- frequentCategory: {
803
- id: string;
804
- defaultMessage: string;
805
- description: string;
806
- };
807
- peopleCategory: {
808
- id: string;
809
- defaultMessage: string;
810
- description: string;
811
- };
812
- natureCategory: {
813
- id: string;
814
- defaultMessage: string;
815
- description: string;
816
- };
817
- foodsCategory: {
818
- id: string;
819
- defaultMessage: string;
820
- description: string;
821
- };
822
- activityCategory: {
823
- id: string;
824
- defaultMessage: string;
825
- description: string;
826
- };
827
- placesCategory: {
828
- id: string;
829
- defaultMessage: string;
830
- description: string;
831
- };
832
- objectsCategory: {
833
- id: string;
834
- defaultMessage: string;
835
- description: string;
836
- };
837
- symbolsCategory: {
838
- id: string;
839
- defaultMessage: string;
840
- description: string;
841
- };
842
- flagsCategory: {
843
- id: string;
844
- defaultMessage: string;
845
- description: string;
846
- };
847
- productivityCategory: {
848
- id: string;
849
- defaultMessage: string;
850
- description: string;
851
- };
852
- userUploadsCustomCategory: {
853
- id: string;
854
- defaultMessage: string;
855
- description: string;
856
- };
857
- allUploadsCustomCategory: {
858
- id: string;
859
- defaultMessage: string;
860
- description: string;
861
- };
862
- deleteEmojiFailed: {
863
- id: string;
864
- defaultMessage: string;
865
- description: string;
866
- };
867
- emojiInvalidImage: {
868
- id: string;
869
- defaultMessage: string;
870
- description: string;
871
- };
872
- emojiUploadFailed: {
873
- id: string;
874
- defaultMessage: string;
875
- description: string;
876
- };
877
- emojiImageTooBig: {
878
- id: string;
879
- defaultMessage: string;
880
- description: string;
881
- };
882
- emojiPickerTitle: {
883
- id: string;
884
- defaultMessage: string;
885
- description: string;
886
- };
887
- emojiPickerListPanel: {
888
- id: string;
889
- defaultMessage: string;
890
- description: string;
891
- };
892
- emojiPickerGrid: {
893
- id: string;
894
- defaultMessage: string;
895
- description: string;
896
- };
897
- emojiButtonRoleDescription: {
898
- id: string;
899
- defaultMessage: string;
900
- description: string;
901
- };
902
- error: {
903
- id: string;
904
- defaultMessage: string;
905
- description: string;
906
- };
907
- };
908
-
909
- // @public (undocumented)
910
- export interface OnCategory {
911
- // (undocumented)
912
- (categoryId: CategoryId | null): void;
913
- }
914
-
915
- // @public (undocumented)
916
- export interface OnEmojiEvent<T = any> {
917
- // (undocumented)
918
- (emojiId: EmojiId, emoji: OptionalEmojiDescription, event?: SyntheticEvent<T>): void;
919
- }
920
-
921
- // @public (undocumented)
922
- interface OnLifecycle {
923
- // (undocumented)
924
- (): void;
925
- }
926
-
927
- // @public (undocumented)
928
- export interface OnToneSelected {
929
- // (undocumented)
930
- (variation: ToneValueType): void;
931
- }
932
-
933
- // @public (undocumented)
934
- export interface OnToneSelectorCancelled {
935
- // (undocumented)
936
- (): void;
937
- }
938
-
939
- // @public (undocumented)
940
- interface OptimisticImageApiLoaderConfig extends Omit<ServiceConfig, 'url'> {
941
- // (undocumented)
942
- getUrl: (emojiId: EmojiId) => string;
943
- }
944
-
945
- // @public (undocumented)
946
- export type OptionalEmojiDescription = EmojiDescription | undefined;
947
-
948
- // @public (undocumented)
949
- export type OptionalEmojiDescriptionWithVariations = EmojiDescriptionWithVariations | undefined;
950
-
951
- // @public (undocumented)
952
- export type OptionalUser = User | undefined;
953
-
954
- // @public (undocumented)
955
- interface Options {
956
- // (undocumented)
957
- onlyFetchOnDemand?: boolean;
958
- }
959
-
960
- // @public (undocumented)
961
- interface PickerRefHandler {
962
- // (undocumented)
963
- (ref: any): any;
964
- }
965
-
966
- // @public (undocumented)
967
- export type PickerSize = 'large' | 'medium' | 'small';
968
-
969
- // @public (undocumented)
970
- interface Props extends Omit<React_2.HTMLAttributes<HTMLSpanElement>, 'onFocus' | 'onMouseMove'> {
971
- autoWidth?: boolean;
972
- className?: string;
973
- disableLazyLoad?: boolean;
974
- emoji: EmojiDescription;
975
- fitToHeight?: number;
976
- onDelete?: OnEmojiEvent;
977
- onFocus?: OnEmojiEvent;
978
- onLoadError?: OnEmojiEvent<HTMLImageElement>;
979
- onLoadSuccess?: (emoji: EmojiDescription) => void;
980
- onMouseMove?: OnEmojiEvent;
981
- onSelected?: OnEmojiEvent;
982
- selected?: boolean;
983
- selectOnHover?: boolean;
984
- shouldBeInteractive?: boolean;
985
- showDelete?: boolean;
986
- showTooltip?: boolean;
987
- }
988
-
989
- // @public (undocumented)
990
- interface Props_10 extends BaseResourcedEmojiProps {
991
- emojiProvider: Promise<EmojiProvider>;
992
- }
993
-
994
- // @public (undocumented)
995
- interface Props_11 {
996
- // (undocumented)
997
- emoji: EmojiDescription;
998
- // (undocumented)
999
- emojiProvider?: EmojiProvider;
1000
- // (undocumented)
1001
- onMouseMove: OnEmojiEvent;
1002
- // (undocumented)
1003
- onSelection: OnEmojiEvent;
1004
- // (undocumented)
1005
- selected: boolean;
1006
- }
1007
-
1008
- // @public (undocumented)
1009
- interface Props_2 {
1010
- // (undocumented)
1011
- loading?: boolean;
1012
- // (undocumented)
1013
- representation?: EmojiImageRepresentation;
1014
- // (undocumented)
1015
- shortName: string;
1016
- // (undocumented)
1017
- showTooltip?: boolean;
1018
- // (undocumented)
1019
- size?: number;
1020
- }
1021
-
1022
- // @public (undocumented)
1023
- interface Props_3 extends Props_4 {
1024
- hideToneSelector?: boolean;
1025
- onPickerRef?: PickerRefHandler;
1026
- onSelection?: OnEmojiEvent;
1027
- size?: PickerSize;
1028
- }
1029
-
1030
- // @public (undocumented)
1031
- interface Props_4 {
1032
- emojiProvider: Promise<EmojiProvider>;
1033
- }
1034
-
1035
- // @public (undocumented)
1036
- interface Props_5 extends Props_4 {
1037
- // (undocumented)
1038
- createAnalyticsEvent?: CreateUIAnalyticsEvent;
1039
- }
1040
-
1041
- // @public (undocumented)
1042
- interface Props_6 {
1043
- // (undocumented)
1044
- createAnalyticsEvent?: CreateUIAnalyticsEvent;
1045
- // (undocumented)
1046
- emojiProvider: EmojiProvider;
1047
- // (undocumented)
1048
- onUploaderRef?: UploadRefHandler;
1049
- }
1050
-
1051
- // @public (undocumented)
1052
- interface Props_7 extends EmojiTypeAheadBaseProps, Props_4 {
1053
- // (undocumented)
1054
- offsetX?: number;
1055
- // (undocumented)
1056
- offsetY?: number;
1057
- // (undocumented)
1058
- position?: RelativePosition;
1059
- target?: HTMLElement | string;
1060
- // (undocumented)
1061
- zIndex?: number | string;
1062
- }
1063
-
1064
- // @public (undocumented)
1065
- interface Props_8 extends EmojiTypeAheadBaseProps {
1066
- emojiProvider: EmojiProvider;
1067
- }
1068
-
1069
- // @public (undocumented)
1070
- interface Props_9 extends Props_10 {}
1071
-
1072
- // @public
1073
- interface QueueOptions {
1074
- maxDuplicates: number;
1075
- minUniqueItems: number;
1076
- }
1077
-
1078
- // @public (undocumented)
1079
- export const recordSelectionFailedSli: (options?: {
1080
- createAnalyticsEvent?: CreateUIAnalyticsEvent;
1081
- }) => (err: Error) => Promise<never>;
1082
-
1083
- // @public (undocumented)
1084
- export const recordSelectionSucceededSli: (options?: {
1085
- createAnalyticsEvent?: CreateUIAnalyticsEvent;
1086
- }) => () => void;
1087
-
1088
- // @public (undocumented)
1089
- export type RelativePosition = 'above' | 'auto' | 'below';
1090
-
1091
- // @public (undocumented)
1092
- interface ResolveReject<T> {
1093
- // (undocumented)
1094
- reject(reason?: any): void;
1095
- // (undocumented)
1096
- resolve(result: T): void;
1097
- }
1098
-
1099
- // @public (undocumented)
1100
- export const ResourcedEmoji: FC<Props_9>;
1101
-
1102
- // @public (undocumented)
1103
- interface Retry<T> {
1104
- // (undocumented)
1105
- (): Promise<T> | T;
1106
- }
1107
-
1108
- // @public (undocumented)
1109
- type SamplingFunc = (rate: number) => boolean;
1110
-
1111
- // @public (undocumented)
1112
- export interface SearchOptions {
1113
- // (undocumented)
1114
- limit?: number;
1115
- // (undocumented)
1116
- skinTone?: number;
1117
- // (undocumented)
1118
- sort?: SearchSort;
1119
- // (undocumented)
1120
- source?: SearchSourceTypes;
1121
- }
1122
-
1123
- // @public (undocumented)
1124
- export enum SearchSort {
1125
- // (undocumented)
1126
- Default = 1,
1127
- // (undocumented)
1128
- None = 0,
1129
- // (undocumented)
1130
- UsageFrequency = 2,
1131
- }
1132
-
1133
- // @public (undocumented)
1134
- enum SearchSourceTypes {
1135
- // (undocumented)
1136
- PICKER = 'picker',
1137
- // (undocumented)
1138
- TYPEAHEAD = 'typeahead',
1139
- }
1140
-
1141
- // @public (undocumented)
1142
- export const selected = 'emoji-common-selected';
1143
-
1144
- // @public (undocumented)
1145
- export const selectOnHover = 'emoji-common-select-on-hover';
1146
-
1147
- // @public (undocumented)
1148
- interface SingleEmojiApiLoaderConfig extends Omit<ServiceConfig, 'url'> {
1149
- // (undocumented)
1150
- getUrl: (emojiId: EmojiId) => string;
1151
- }
1152
-
1153
- // @public (undocumented)
1154
- class SiteEmojiResource {
1155
- constructor(siteServiceConfig: ServiceConfig, mediaApiToken: MediaApiToken);
1156
- deleteEmoji(emoji: EmojiDescription): Promise<boolean>;
1157
- // (undocumented)
1158
- findEmoji(emojiId: EmojiId): Promise<OptionalEmojiDescription>;
1159
- generateTokenisedMediaURLS(
1160
- representation: EmojiRepresentation,
1161
- altRepresentation?: EmojiRepresentation,
1162
- ): Promise<TokenisedEmojiRepresentation>;
1163
- hasUploadToken(): Promise<boolean>;
1164
- loadMediaEmoji(
1165
- emoji: EmojiDescription,
1166
- useAlt?: boolean,
1167
- ): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
1168
- // (undocumented)
1169
- optimisticRendering(emoji: EmojiDescription, useAlt?: boolean): Promise<boolean> | boolean;
1170
- // (undocumented)
1171
- prepareForUpload(): void;
1172
- // (undocumented)
1173
- protected tokenManager: TokenManager;
1174
- // (undocumented)
1175
- uploadEmoji(
1176
- upload: EmojiUpload,
1177
- retry?: boolean,
1178
- progressCallback?: EmojiProgessCallback,
1179
- ): Promise<EmojiDescription>;
1180
- }
1181
-
1182
- // @public (undocumented)
1183
- export interface SpriteImageRepresentation extends EmojiImageRepresentation {
1184
- // (undocumented)
1185
- x: number;
1186
- // (undocumented)
1187
- xIndex: number;
1188
- // (undocumented)
1189
- y: number;
1190
- // (undocumented)
1191
- yIndex: number;
1192
- }
1193
-
1194
- // @public
1195
- export interface SpriteRepresentation extends SpriteImageRepresentation {
1196
- // (undocumented)
1197
- sprite: SpriteSheet;
1198
- }
1199
-
1200
- // @public
1201
- export interface SpriteServiceRepresentation extends SpriteImageRepresentation {
1202
- spriteRef: string;
1203
- }
1204
-
1205
- // @public (undocumented)
1206
- export interface SpriteSheet {
1207
- // (undocumented)
1208
- column: number;
1209
- // (undocumented)
1210
- height: number;
1211
- // (undocumented)
1212
- row: number;
1213
- // (undocumented)
1214
- url: string;
1215
- // (undocumented)
1216
- width: number;
1217
- }
1218
-
1219
- // @public (undocumented)
1220
- export interface SpriteSheets {
1221
- // (undocumented)
1222
- [index: string]: SpriteSheet;
1223
- }
1224
-
1225
- // @public (undocumented)
1226
- interface State {
1227
- // (undocumented)
1228
- asyncLoadedComponent?: ComponentType<any>;
1229
- // (undocumented)
1230
- loadedEmojiProvider?: EmojiProvider;
1231
- }
1232
-
1233
- // @public (undocumented)
1234
- export interface Styles {
1235
- // (undocumented)
1236
- [index: string]: any;
1237
- }
1238
-
1239
- // @public (undocumented)
1240
- export const toEmojiId: (emoji: EmojiDescription) => EmojiId;
1241
-
1242
- // @public (undocumented)
1243
- type TokenisedEmojiRepresentation = {
1244
- representation?: EmojiRepresentation;
1245
- altRepresentation?: EmojiRepresentation;
1246
- };
1247
-
1248
- // @public (undocumented)
1249
- class TokenManager {
1250
- constructor(siteServiceConfig: ServiceConfig);
1251
- // (undocumented)
1252
- addToken(type: TokenType, mediaApiToken: MediaApiToken): void;
1253
- // (undocumented)
1254
- fetchNewToken(type: TokenType): Promise<MediaApiToken>;
1255
- // (undocumented)
1256
- getToken(type: TokenType, forceRefresh?: boolean): Promise<MediaApiToken>;
1257
- // (undocumented)
1258
- isValidToken(mediaApiToken: MediaApiToken): boolean;
1259
- }
1260
-
1261
- // @public (undocumented)
1262
- type TokenType = 'read' | 'upload';
1263
-
1264
- // @public (undocumented)
1265
- export type ToneSelection = number | undefined;
1266
-
1267
- // @public (undocumented)
1268
- type ToneValueType = number;
1269
-
1270
- // @public (undocumented)
1271
- export const toOptionalEmojiId: (emoji: OptionalEmojiDescription) => EmojiId | undefined;
1272
-
1273
- // @public (undocumented)
1274
- export enum UfoComponentName {
1275
- // (undocumented)
1276
- EMOJI = 'emoji',
1277
- // (undocumented)
1278
- EMOJI_PICKER = 'emoji-picker',
1279
- // (undocumented)
1280
- EMOJI_PROVIDER = 'emoji-provider',
1281
- }
1282
-
1283
- // @public (undocumented)
1284
- export enum UfoExperienceName {
1285
- // (undocumented)
1286
- EMOJI_PICKER_OPENED = 'emoji-picker-opened',
1287
- // (undocumented)
1288
- EMOJI_RENDERED = 'emoji-rendered',
1289
- // (undocumented)
1290
- EMOJI_RESOURCE_FETCHED = 'emoji-resource-fetched',
1291
- // (undocumented)
1292
- EMOJI_SEARCHED = 'emoji-searched',
1293
- // (undocumented)
1294
- EMOJI_SELECTION_RECORDED = 'emoji-selection-recorded',
1295
- // (undocumented)
1296
- EMOJI_UPLOADED = 'emoji-uploaded',
1297
- }
1298
-
1299
- // @public (undocumented)
1300
- export const ufoExperiences: {
1301
- 'emoji-rendered': ConcurrentExperience;
1302
- 'emoji-resource-fetched': ConcurrentExperience;
1303
- 'emoji-picker-opened': UFOExperience;
1304
- 'emoji-selection-recorded': UFOExperience;
1305
- 'emoji-uploaded': UFOExperience;
1306
- 'emoji-searched': UFOExperience;
1307
- };
1308
-
1309
- // @public (undocumented)
1310
- export interface UploadingEmojiProvider extends EmojiProvider {
1311
- isUploadSupported(): Promise<boolean>;
1312
- prepareForUpload(): Promise<void>;
1313
- uploadCustomEmoji(upload: EmojiUpload, retry?: boolean): Promise<EmojiDescription>;
1314
- }
1315
-
1316
- // @public (undocumented)
1317
- interface UploadRefHandler {
1318
- // (undocumented)
1319
- (ref: HTMLDivElement): void;
1320
- }
1321
-
1322
- // @public
1323
- export class UsageFrequencyTracker {
1324
- constructor(useStorageIfPossible?: boolean);
1325
- clear(): void;
1326
- getOrder(): Array<string>;
1327
- // (undocumented)
1328
- protected queue: DuplicateLimitedQueue<string>;
1329
- recordUsage(emoji: EmojiDescription): void;
1330
- }
1331
-
1332
- // @public (undocumented)
1333
- export const useEmoji: () => {
1334
- emojiProvider: EmojiProvider;
1335
- isUploadSupported: boolean;
1336
- };
1337
-
1338
- // @public @deprecated (undocumented)
1339
- export const useEmojiContext: () => EmojiContextType;
1340
-
1341
- // @public (undocumented)
1342
- export interface User {
1343
- // (undocumented)
1344
- id: string;
1345
- }
1346
-
1347
- // @public
1348
- export const withSampling: (ufoExperience: UFOExperience) => WithSamplingUFOExperience;
1349
-
1350
- // @public (undocumented)
1351
- export interface WithSamplingUFOExperience extends Omit<UFOExperience, 'start'> {
1352
- // (undocumented)
1353
- start: (options: {
1354
- samplingRate: number;
1355
- samplingFunc?: SamplingFunc;
1356
- startTime?: number;
1357
- }) => Promise<void>;
1358
- }
1359
-
1360
- // (No @packageDocumentation comment for this package)
1361
- ```
1362
-
1363
- <!--SECTION END: Main Entry Types-->
1364
-
1365
- ### Peer Dependencies
1366
-
1367
- <!--SECTION START: Peer Dependencies-->
1368
-
1369
- ```json
1370
- {
1371
- "react": "^16.8.0",
1372
- "react-dom": "^16.8.0",
1373
- "react-intl": "npm:react-intl@^5.18.1"
1374
- }
1375
- ```
1376
-
1377
- <!--SECTION END: Peer Dependencies-->