@ctrl/ngx-emoji-mart 6.0.1 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/anchors.component.d.ts +3 -0
  2. package/category.component.d.ts +3 -0
  3. package/ctrl-ngx-emoji-mart.d.ts +1 -0
  4. package/emoji-frequently.service.d.ts +3 -0
  5. package/emoji-search.service.d.ts +3 -0
  6. package/esm2020/anchors.component.mjs +83 -0
  7. package/esm2020/category.component.mjs +386 -0
  8. package/{esm2015/ctrl-ngx-emoji-mart.js → esm2020/ctrl-ngx-emoji-mart.mjs} +0 -0
  9. package/{esm2015/emoji-frequently.service.js → esm2020/emoji-frequently.service.mjs} +10 -8
  10. package/esm2020/emoji-search.service.mjs +177 -0
  11. package/{esm2015/ngx-emoji/ctrl-ngx-emoji-mart-ngx-emoji.js → esm2020/ngx-emoji/ctrl-ngx-emoji-mart-ngx-emoji.mjs} +0 -0
  12. package/{esm2015/ngx-emoji/data/categories.js → esm2020/ngx-emoji/data/categories.mjs} +0 -0
  13. package/{esm2015/ngx-emoji/data/data.interfaces.js → esm2020/ngx-emoji/data/data.interfaces.mjs} +0 -0
  14. package/{esm2015/ngx-emoji/data/emojis.js → esm2020/ngx-emoji/data/emojis.mjs} +0 -0
  15. package/{esm2015/ngx-emoji/data/skins.js → esm2020/ngx-emoji/data/skins.mjs} +0 -0
  16. package/esm2020/ngx-emoji/emoji.component.mjs +236 -0
  17. package/esm2020/ngx-emoji/emoji.module.mjs +18 -0
  18. package/esm2020/ngx-emoji/emoji.service.mjs +144 -0
  19. package/{esm2015/ngx-emoji/index.js → esm2020/ngx-emoji/index.mjs} +0 -0
  20. package/esm2020/picker.component.mjs +505 -0
  21. package/esm2020/picker.module.mjs +49 -0
  22. package/esm2020/preview.component.mjs +181 -0
  23. package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
  24. package/esm2020/search.component.mjs +165 -0
  25. package/esm2020/skins.component.mjs +108 -0
  26. package/{esm2015/svgs/index.js → esm2020/svgs/index.mjs} +0 -0
  27. package/{esm2015/utils/index.js → esm2020/utils/index.mjs} +0 -0
  28. package/fesm2015/{ctrl-ngx-emoji-mart-ngx-emoji.js → ctrl-ngx-emoji-mart-ngx-emoji.mjs} +101 -44
  29. package/fesm2015/ctrl-ngx-emoji-mart-ngx-emoji.mjs.map +1 -0
  30. package/fesm2015/{ctrl-ngx-emoji-mart.js → ctrl-ngx-emoji-mart.mjs} +623 -284
  31. package/fesm2015/ctrl-ngx-emoji-mart.mjs.map +1 -0
  32. package/fesm2020/ctrl-ngx-emoji-mart-ngx-emoji.mjs +31829 -0
  33. package/fesm2020/ctrl-ngx-emoji-mart-ngx-emoji.mjs.map +1 -0
  34. package/fesm2020/ctrl-ngx-emoji-mart.mjs +1751 -0
  35. package/fesm2020/ctrl-ngx-emoji-mart.mjs.map +1 -0
  36. package/ngx-emoji/ctrl-ngx-emoji-mart-ngx-emoji.d.ts +1 -0
  37. package/ngx-emoji/emoji.component.d.ts +3 -0
  38. package/ngx-emoji/emoji.module.d.ts +6 -0
  39. package/ngx-emoji/emoji.service.d.ts +3 -0
  40. package/ngx-emoji/package.json +6 -7
  41. package/package.json +29 -10
  42. package/picker.component.d.ts +3 -0
  43. package/picker.module.d.ts +13 -0
  44. package/preview.component.d.ts +4 -1
  45. package/search.component.d.ts +3 -0
  46. package/skins.component.d.ts +6 -3
  47. package/bundles/ctrl-ngx-emoji-mart-ngx-emoji.umd.js +0 -32104
  48. package/bundles/ctrl-ngx-emoji-mart-ngx-emoji.umd.js.map +0 -1
  49. package/bundles/ctrl-ngx-emoji-mart.umd.js +0 -1729
  50. package/bundles/ctrl-ngx-emoji-mart.umd.js.map +0 -1
  51. package/ctrl-ngx-emoji-mart.metadata.json +0 -1
  52. package/esm2015/anchors.component.js +0 -54
  53. package/esm2015/category.component.js +0 -275
  54. package/esm2015/emoji-search.service.js +0 -179
  55. package/esm2015/ngx-emoji/emoji.component.js +0 -174
  56. package/esm2015/ngx-emoji/emoji.module.js +0 -13
  57. package/esm2015/ngx-emoji/emoji.service.js +0 -143
  58. package/esm2015/picker.component.js +0 -459
  59. package/esm2015/picker.module.js +0 -34
  60. package/esm2015/preview.component.js +0 -113
  61. package/esm2015/search.component.js +0 -115
  62. package/esm2015/skins.component.js +0 -76
  63. package/fesm2015/ctrl-ngx-emoji-mart-ngx-emoji.js.map +0 -1
  64. package/fesm2015/ctrl-ngx-emoji-mart.js.map +0 -1
  65. package/ngx-emoji/ctrl-ngx-emoji-mart-ngx-emoji.metadata.json +0 -1
@@ -0,0 +1,1751 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Component, ChangeDetectionStrategy, Input, Output, PLATFORM_ID, Injectable, Inject, ViewChild, ViewChildren, NgModule } from '@angular/core';
3
+ import * as i3 from '@angular/common';
4
+ import { isPlatformBrowser, CommonModule } from '@angular/common';
5
+ import { Subject } from 'rxjs';
6
+ import * as i1 from '@ctrl/ngx-emoji-mart/ngx-emoji';
7
+ import { categories as categories$1, EmojiModule } from '@ctrl/ngx-emoji-mart/ngx-emoji';
8
+ import * as i2 from '@angular/forms';
9
+ import { FormsModule } from '@angular/forms';
10
+
11
+ class AnchorsComponent {
12
+ constructor() {
13
+ this.categories = [];
14
+ this.icons = {};
15
+ this.anchorClick = new EventEmitter();
16
+ }
17
+ trackByFn(idx, cat) {
18
+ return cat.id;
19
+ }
20
+ handleClick($event, index) {
21
+ this.anchorClick.emit({
22
+ category: this.categories[index],
23
+ index,
24
+ });
25
+ }
26
+ }
27
+ AnchorsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: AnchorsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
28
+ AnchorsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: AnchorsComponent, selector: "emoji-mart-anchors", inputs: { categories: "categories", color: "color", selected: "selected", i18n: "i18n", icons: "icons" }, outputs: { anchorClick: "anchorClick" }, ngImport: i0, template: `
29
+ <div class="emoji-mart-anchors">
30
+ <ng-template ngFor let-category [ngForOf]="categories" let-idx="index" [ngForTrackBy]="trackByFn">
31
+ <span
32
+ *ngIf="category.anchor !== false"
33
+ [attr.title]="i18n.categories[category.id]"
34
+ (click)="this.handleClick($event, idx)"
35
+ class="emoji-mart-anchor"
36
+ [class.emoji-mart-anchor-selected]="category.name === selected"
37
+ [style.color]="category.name === selected ? color : null"
38
+ >
39
+ <div>
40
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
41
+ <path [attr.d]="icons[category.id]" />
42
+ </svg>
43
+ </div>
44
+ <span class="emoji-mart-anchor-bar" [style.background-color]="color"></span>
45
+ </span>
46
+ </ng-template>
47
+ </div>
48
+ `, isInline: true, directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: AnchorsComponent, decorators: [{
50
+ type: Component,
51
+ args: [{
52
+ selector: 'emoji-mart-anchors',
53
+ template: `
54
+ <div class="emoji-mart-anchors">
55
+ <ng-template ngFor let-category [ngForOf]="categories" let-idx="index" [ngForTrackBy]="trackByFn">
56
+ <span
57
+ *ngIf="category.anchor !== false"
58
+ [attr.title]="i18n.categories[category.id]"
59
+ (click)="this.handleClick($event, idx)"
60
+ class="emoji-mart-anchor"
61
+ [class.emoji-mart-anchor-selected]="category.name === selected"
62
+ [style.color]="category.name === selected ? color : null"
63
+ >
64
+ <div>
65
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
66
+ <path [attr.d]="icons[category.id]" />
67
+ </svg>
68
+ </div>
69
+ <span class="emoji-mart-anchor-bar" [style.background-color]="color"></span>
70
+ </span>
71
+ </ng-template>
72
+ </div>
73
+ `,
74
+ changeDetection: ChangeDetectionStrategy.OnPush,
75
+ preserveWhitespaces: false,
76
+ }]
77
+ }], propDecorators: { categories: [{
78
+ type: Input
79
+ }], color: [{
80
+ type: Input
81
+ }], selected: [{
82
+ type: Input
83
+ }], i18n: [{
84
+ type: Input
85
+ }], icons: [{
86
+ type: Input
87
+ }], anchorClick: [{
88
+ type: Output
89
+ }] } });
90
+
91
+ class EmojiFrequentlyService {
92
+ constructor(platformId) {
93
+ this.platformId = platformId;
94
+ this.NAMESPACE = 'emoji-mart';
95
+ this.frequently = null;
96
+ this.defaults = {};
97
+ this.initialized = false;
98
+ this.DEFAULTS = [
99
+ '+1',
100
+ 'grinning',
101
+ 'kissing_heart',
102
+ 'heart_eyes',
103
+ 'laughing',
104
+ 'stuck_out_tongue_winking_eye',
105
+ 'sweat_smile',
106
+ 'joy',
107
+ 'scream',
108
+ 'disappointed',
109
+ 'unamused',
110
+ 'weary',
111
+ 'sob',
112
+ 'sunglasses',
113
+ 'heart',
114
+ 'poop',
115
+ ];
116
+ }
117
+ init() {
118
+ this.frequently = JSON.parse((isPlatformBrowser(this.platformId) &&
119
+ localStorage.getItem(`${this.NAMESPACE}.frequently`)) ||
120
+ 'null');
121
+ this.initialized = true;
122
+ }
123
+ add(emoji) {
124
+ if (!this.initialized) {
125
+ this.init();
126
+ }
127
+ if (!this.frequently) {
128
+ this.frequently = this.defaults;
129
+ }
130
+ if (!this.frequently[emoji.id]) {
131
+ this.frequently[emoji.id] = 0;
132
+ }
133
+ this.frequently[emoji.id] += 1;
134
+ if (isPlatformBrowser(this.platformId)) {
135
+ localStorage.setItem(`${this.NAMESPACE}.last`, emoji.id);
136
+ localStorage.setItem(`${this.NAMESPACE}.frequently`, JSON.stringify(this.frequently));
137
+ }
138
+ }
139
+ get(perLine, totalLines) {
140
+ if (!this.initialized) {
141
+ this.init();
142
+ }
143
+ if (this.frequently === null) {
144
+ this.defaults = {};
145
+ const result = [];
146
+ for (let i = 0; i < perLine; i++) {
147
+ this.defaults[this.DEFAULTS[i]] = perLine - i;
148
+ result.push(this.DEFAULTS[i]);
149
+ }
150
+ return result;
151
+ }
152
+ const quantity = perLine * totalLines;
153
+ const frequentlyKeys = Object.keys(this.frequently);
154
+ const sorted = frequentlyKeys
155
+ .sort((a, b) => this.frequently[a] - this.frequently[b])
156
+ .reverse();
157
+ const sliced = sorted.slice(0, quantity);
158
+ const last = isPlatformBrowser(this.platformId) && localStorage.getItem(`${this.NAMESPACE}.last`);
159
+ if (last && !sliced.includes(last)) {
160
+ sliced.pop();
161
+ sliced.push(last);
162
+ }
163
+ return sliced;
164
+ }
165
+ }
166
+ EmojiFrequentlyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: EmojiFrequentlyService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
167
+ EmojiFrequentlyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: EmojiFrequentlyService, providedIn: 'root' });
168
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: EmojiFrequentlyService, decorators: [{
169
+ type: Injectable,
170
+ args: [{ providedIn: 'root' }]
171
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
172
+ type: Inject,
173
+ args: [PLATFORM_ID]
174
+ }] }]; } });
175
+
176
+ class CategoryComponent {
177
+ constructor(ref, emojiService, frequently) {
178
+ this.ref = ref;
179
+ this.emojiService = emojiService;
180
+ this.frequently = frequently;
181
+ this.emojis = null;
182
+ this.hasStickyPosition = true;
183
+ this.name = '';
184
+ this.perLine = 9;
185
+ this.totalFrequentLines = 4;
186
+ this.recent = [];
187
+ this.custom = [];
188
+ this.hideObsolete = true;
189
+ this.virtualize = false;
190
+ this.virtualizeOffset = 0;
191
+ this.emojiOver = new EventEmitter();
192
+ this.emojiLeave = new EventEmitter();
193
+ this.emojiClick = new EventEmitter();
194
+ this.containerStyles = {};
195
+ this.emojisToDisplay = [];
196
+ this.filteredEmojisSubject = new Subject();
197
+ this.filteredEmojis$ = this.filteredEmojisSubject.asObservable();
198
+ this.labelStyles = {};
199
+ this.labelSpanStyles = {};
200
+ this.margin = 0;
201
+ this.minMargin = 0;
202
+ this.maxMargin = 0;
203
+ this.top = 0;
204
+ this.rows = 0;
205
+ }
206
+ ngOnInit() {
207
+ this.updateRecentEmojis();
208
+ this.emojisToDisplay = this.filterEmojis();
209
+ if (this.noEmojiToDisplay) {
210
+ this.containerStyles = { display: 'none' };
211
+ }
212
+ if (!this.hasStickyPosition) {
213
+ this.labelStyles = { height: 28 };
214
+ // this.labelSpanStyles = { position: 'absolute' };
215
+ }
216
+ }
217
+ ngOnChanges(changes) {
218
+ if (changes.emojis?.currentValue?.length !== changes.emojis?.previousValue?.length) {
219
+ this.emojisToDisplay = this.filterEmojis();
220
+ this.ngAfterViewInit();
221
+ }
222
+ }
223
+ ngAfterViewInit() {
224
+ if (!this.virtualize) {
225
+ return;
226
+ }
227
+ const { width } = this.container.nativeElement.getBoundingClientRect();
228
+ const perRow = Math.floor(width / (this.emojiSize + 12));
229
+ this.rows = Math.ceil(this.emojisToDisplay.length / perRow);
230
+ this.containerStyles = {
231
+ ...this.containerStyles,
232
+ minHeight: `${this.rows * (this.emojiSize + 12) + 28}px`,
233
+ };
234
+ this.ref?.detectChanges();
235
+ this.handleScroll(this.container.nativeElement.parentNode.parentNode.scrollTop);
236
+ }
237
+ get noEmojiToDisplay() {
238
+ return this.emojisToDisplay.length === 0;
239
+ }
240
+ memoizeSize() {
241
+ const parent = this.container.nativeElement.parentNode.parentNode;
242
+ const { top, height } = this.container.nativeElement.getBoundingClientRect();
243
+ const parentTop = parent.getBoundingClientRect().top;
244
+ const labelHeight = this.label.nativeElement.getBoundingClientRect().height;
245
+ this.top = top - parentTop + parent.scrollTop;
246
+ if (height === 0) {
247
+ this.maxMargin = 0;
248
+ }
249
+ else {
250
+ this.maxMargin = height - labelHeight;
251
+ }
252
+ }
253
+ handleScroll(scrollTop) {
254
+ let margin = scrollTop - this.top;
255
+ margin = margin < this.minMargin ? this.minMargin : margin;
256
+ margin = margin > this.maxMargin ? this.maxMargin : margin;
257
+ if (this.virtualize) {
258
+ const { top, height } = this.container.nativeElement.getBoundingClientRect();
259
+ const parentHeight = this.container.nativeElement.parentNode.parentNode.clientHeight;
260
+ if (parentHeight + (parentHeight + this.virtualizeOffset) >= top && -height - (parentHeight + this.virtualizeOffset) <= top) {
261
+ this.filteredEmojisSubject.next(this.emojisToDisplay);
262
+ }
263
+ else {
264
+ this.filteredEmojisSubject.next([]);
265
+ }
266
+ }
267
+ if (margin === this.margin) {
268
+ this.ref.detectChanges();
269
+ return false;
270
+ }
271
+ if (!this.hasStickyPosition) {
272
+ this.label.nativeElement.style.top = `${margin}px`;
273
+ }
274
+ this.margin = margin;
275
+ this.ref.detectChanges();
276
+ return true;
277
+ }
278
+ updateRecentEmojis() {
279
+ if (this.name !== 'Recent') {
280
+ return;
281
+ }
282
+ let frequentlyUsed = this.recent || this.frequently.get(this.perLine, this.totalFrequentLines);
283
+ if (!frequentlyUsed || !frequentlyUsed.length) {
284
+ frequentlyUsed = this.frequently.get(this.perLine, this.totalFrequentLines);
285
+ }
286
+ if (!frequentlyUsed.length) {
287
+ return;
288
+ }
289
+ this.emojis = frequentlyUsed
290
+ .map(id => {
291
+ const emoji = this.custom.filter((e) => e.id === id)[0];
292
+ if (emoji) {
293
+ return emoji;
294
+ }
295
+ return id;
296
+ })
297
+ .filter(id => !!this.emojiService.getData(id));
298
+ }
299
+ updateDisplay(display) {
300
+ this.containerStyles.display = display;
301
+ this.updateRecentEmojis();
302
+ this.ref.detectChanges();
303
+ }
304
+ trackById(index, item) {
305
+ return item;
306
+ }
307
+ filterEmojis() {
308
+ const newEmojis = [];
309
+ for (const emoji of this.emojis || []) {
310
+ if (!emoji) {
311
+ continue;
312
+ }
313
+ const data = this.emojiService.getData(emoji);
314
+ if (!data || (data.obsoletedBy && this.hideObsolete) || (!data.unified && !data.custom)) {
315
+ continue;
316
+ }
317
+ newEmojis.push(emoji);
318
+ }
319
+ return newEmojis;
320
+ }
321
+ }
322
+ CategoryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CategoryComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.EmojiService }, { token: EmojiFrequentlyService }], target: i0.ɵɵFactoryTarget.Component });
323
+ CategoryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: CategoryComponent, selector: "emoji-category", inputs: { emojis: "emojis", hasStickyPosition: "hasStickyPosition", name: "name", perLine: "perLine", totalFrequentLines: "totalFrequentLines", recent: "recent", custom: "custom", i18n: "i18n", id: "id", hideObsolete: "hideObsolete", notFoundEmoji: "notFoundEmoji", virtualize: "virtualize", virtualizeOffset: "virtualizeOffset", emojiIsNative: "emojiIsNative", emojiSkin: "emojiSkin", emojiSize: "emojiSize", emojiSet: "emojiSet", emojiSheetSize: "emojiSheetSize", emojiForceSize: "emojiForceSize", emojiTooltip: "emojiTooltip", emojiBackgroundImageFn: "emojiBackgroundImageFn", emojiImageUrlFn: "emojiImageUrlFn", emojiUseButton: "emojiUseButton" }, outputs: { emojiOver: "emojiOver", emojiLeave: "emojiLeave", emojiClick: "emojiClick" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, static: true }, { propertyName: "label", first: true, predicate: ["label"], descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: `
324
+ <section
325
+ #container
326
+ class="emoji-mart-category"
327
+ [attr.aria-label]="i18n.categories[id]"
328
+ [class.emoji-mart-no-results]="noEmojiToDisplay"
329
+ [ngStyle]="containerStyles"
330
+ >
331
+ <div class="emoji-mart-category-label" [ngStyle]="labelStyles" [attr.data-name]="name">
332
+ <!-- already labeled by the section aria-label -->
333
+ <span #label [ngStyle]="labelSpanStyles" aria-hidden="true">
334
+ {{ i18n.categories[id] }}
335
+ </span>
336
+ </div>
337
+
338
+ <div
339
+ *ngIf="virtualize; else normalRenderTemplate"
340
+ >
341
+ <div *ngIf="filteredEmojis$ | async as filteredEmojis">
342
+ <ngx-emoji
343
+ *ngFor="let emoji of filteredEmojis; trackBy: trackById"
344
+ [emoji]="emoji"
345
+ [size]="emojiSize"
346
+ [skin]="emojiSkin"
347
+ [isNative]="emojiIsNative"
348
+ [set]="emojiSet"
349
+ [sheetSize]="emojiSheetSize"
350
+ [forceSize]="emojiForceSize"
351
+ [tooltip]="emojiTooltip"
352
+ [backgroundImageFn]="emojiBackgroundImageFn"
353
+ [imageUrlFn]="emojiImageUrlFn"
354
+ [hideObsolete]="hideObsolete"
355
+ [useButton]="emojiUseButton"
356
+ (emojiOver)="emojiOver.emit($event)"
357
+ (emojiLeave)="emojiLeave.emit($event)"
358
+ (emojiClick)="emojiClick.emit($event)"
359
+ ></ngx-emoji>
360
+ </div>
361
+ </div>
362
+
363
+ <div *ngIf="noEmojiToDisplay">
364
+ <div>
365
+ <ngx-emoji
366
+ [emoji]="notFoundEmoji"
367
+ [size]="38"
368
+ [skin]="emojiSkin"
369
+ [isNative]="emojiIsNative"
370
+ [set]="emojiSet"
371
+ [sheetSize]="emojiSheetSize"
372
+ [forceSize]="emojiForceSize"
373
+ [tooltip]="emojiTooltip"
374
+ [backgroundImageFn]="emojiBackgroundImageFn"
375
+ [useButton]="emojiUseButton"
376
+ ></ngx-emoji>
377
+ </div>
378
+
379
+ <div class="emoji-mart-no-results-label">
380
+ {{ i18n.notfound }}
381
+ </div>
382
+ </div>
383
+ </section>
384
+
385
+ <ng-template #normalRenderTemplate>
386
+ <ngx-emoji
387
+ *ngFor="let emoji of emojisToDisplay; trackBy: trackById"
388
+ [emoji]="emoji"
389
+ [size]="emojiSize"
390
+ [skin]="emojiSkin"
391
+ [isNative]="emojiIsNative"
392
+ [set]="emojiSet"
393
+ [sheetSize]="emojiSheetSize"
394
+ [forceSize]="emojiForceSize"
395
+ [tooltip]="emojiTooltip"
396
+ [backgroundImageFn]="emojiBackgroundImageFn"
397
+ [imageUrlFn]="emojiImageUrlFn"
398
+ [hideObsolete]="hideObsolete"
399
+ [useButton]="emojiUseButton"
400
+ (emojiOver)="emojiOver.emit($event)"
401
+ (emojiLeave)="emojiLeave.emit($event)"
402
+ (emojiClick)="emojiClick.emit($event)"
403
+ ></ngx-emoji>
404
+ </ng-template>
405
+ `, isInline: true, components: [{ type: i1.EmojiComponent, selector: "ngx-emoji", inputs: ["skin", "set", "sheetSize", "isNative", "forceSize", "tooltip", "size", "emoji", "fallback", "hideObsolete", "sheetRows", "sheetColumns", "useButton", "backgroundImageFn", "imageUrlFn"], outputs: ["emojiOver", "emojiLeave", "emojiClick"] }], directives: [{ type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i3.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
406
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CategoryComponent, decorators: [{
407
+ type: Component,
408
+ args: [{
409
+ selector: 'emoji-category',
410
+ template: `
411
+ <section
412
+ #container
413
+ class="emoji-mart-category"
414
+ [attr.aria-label]="i18n.categories[id]"
415
+ [class.emoji-mart-no-results]="noEmojiToDisplay"
416
+ [ngStyle]="containerStyles"
417
+ >
418
+ <div class="emoji-mart-category-label" [ngStyle]="labelStyles" [attr.data-name]="name">
419
+ <!-- already labeled by the section aria-label -->
420
+ <span #label [ngStyle]="labelSpanStyles" aria-hidden="true">
421
+ {{ i18n.categories[id] }}
422
+ </span>
423
+ </div>
424
+
425
+ <div
426
+ *ngIf="virtualize; else normalRenderTemplate"
427
+ >
428
+ <div *ngIf="filteredEmojis$ | async as filteredEmojis">
429
+ <ngx-emoji
430
+ *ngFor="let emoji of filteredEmojis; trackBy: trackById"
431
+ [emoji]="emoji"
432
+ [size]="emojiSize"
433
+ [skin]="emojiSkin"
434
+ [isNative]="emojiIsNative"
435
+ [set]="emojiSet"
436
+ [sheetSize]="emojiSheetSize"
437
+ [forceSize]="emojiForceSize"
438
+ [tooltip]="emojiTooltip"
439
+ [backgroundImageFn]="emojiBackgroundImageFn"
440
+ [imageUrlFn]="emojiImageUrlFn"
441
+ [hideObsolete]="hideObsolete"
442
+ [useButton]="emojiUseButton"
443
+ (emojiOver)="emojiOver.emit($event)"
444
+ (emojiLeave)="emojiLeave.emit($event)"
445
+ (emojiClick)="emojiClick.emit($event)"
446
+ ></ngx-emoji>
447
+ </div>
448
+ </div>
449
+
450
+ <div *ngIf="noEmojiToDisplay">
451
+ <div>
452
+ <ngx-emoji
453
+ [emoji]="notFoundEmoji"
454
+ [size]="38"
455
+ [skin]="emojiSkin"
456
+ [isNative]="emojiIsNative"
457
+ [set]="emojiSet"
458
+ [sheetSize]="emojiSheetSize"
459
+ [forceSize]="emojiForceSize"
460
+ [tooltip]="emojiTooltip"
461
+ [backgroundImageFn]="emojiBackgroundImageFn"
462
+ [useButton]="emojiUseButton"
463
+ ></ngx-emoji>
464
+ </div>
465
+
466
+ <div class="emoji-mart-no-results-label">
467
+ {{ i18n.notfound }}
468
+ </div>
469
+ </div>
470
+ </section>
471
+
472
+ <ng-template #normalRenderTemplate>
473
+ <ngx-emoji
474
+ *ngFor="let emoji of emojisToDisplay; trackBy: trackById"
475
+ [emoji]="emoji"
476
+ [size]="emojiSize"
477
+ [skin]="emojiSkin"
478
+ [isNative]="emojiIsNative"
479
+ [set]="emojiSet"
480
+ [sheetSize]="emojiSheetSize"
481
+ [forceSize]="emojiForceSize"
482
+ [tooltip]="emojiTooltip"
483
+ [backgroundImageFn]="emojiBackgroundImageFn"
484
+ [imageUrlFn]="emojiImageUrlFn"
485
+ [hideObsolete]="hideObsolete"
486
+ [useButton]="emojiUseButton"
487
+ (emojiOver)="emojiOver.emit($event)"
488
+ (emojiLeave)="emojiLeave.emit($event)"
489
+ (emojiClick)="emojiClick.emit($event)"
490
+ ></ngx-emoji>
491
+ </ng-template>
492
+ `,
493
+ changeDetection: ChangeDetectionStrategy.OnPush,
494
+ preserveWhitespaces: false,
495
+ }]
496
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.EmojiService }, { type: EmojiFrequentlyService }]; }, propDecorators: { emojis: [{
497
+ type: Input
498
+ }], hasStickyPosition: [{
499
+ type: Input
500
+ }], name: [{
501
+ type: Input
502
+ }], perLine: [{
503
+ type: Input
504
+ }], totalFrequentLines: [{
505
+ type: Input
506
+ }], recent: [{
507
+ type: Input
508
+ }], custom: [{
509
+ type: Input
510
+ }], i18n: [{
511
+ type: Input
512
+ }], id: [{
513
+ type: Input
514
+ }], hideObsolete: [{
515
+ type: Input
516
+ }], notFoundEmoji: [{
517
+ type: Input
518
+ }], virtualize: [{
519
+ type: Input
520
+ }], virtualizeOffset: [{
521
+ type: Input
522
+ }], emojiIsNative: [{
523
+ type: Input
524
+ }], emojiSkin: [{
525
+ type: Input
526
+ }], emojiSize: [{
527
+ type: Input
528
+ }], emojiSet: [{
529
+ type: Input
530
+ }], emojiSheetSize: [{
531
+ type: Input
532
+ }], emojiForceSize: [{
533
+ type: Input
534
+ }], emojiTooltip: [{
535
+ type: Input
536
+ }], emojiBackgroundImageFn: [{
537
+ type: Input
538
+ }], emojiImageUrlFn: [{
539
+ type: Input
540
+ }], emojiUseButton: [{
541
+ type: Input
542
+ }], emojiOver: [{
543
+ type: Output
544
+ }], emojiLeave: [{
545
+ type: Output
546
+ }], emojiClick: [{
547
+ type: Output
548
+ }], container: [{
549
+ type: ViewChild,
550
+ args: ['container', { static: true }]
551
+ }], label: [{
552
+ type: ViewChild,
553
+ args: ['label', { static: true }]
554
+ }] } });
555
+
556
+ function uniq(arr) {
557
+ return arr.reduce((acc, item) => {
558
+ if (!acc.includes(item)) {
559
+ acc.push(item);
560
+ }
561
+ return acc;
562
+ }, []);
563
+ }
564
+ function intersect(a, b) {
565
+ const uniqA = uniq(a);
566
+ const uniqB = uniq(b);
567
+ return uniqA.filter((item) => uniqB.indexOf(item) >= 0);
568
+ }
569
+ // https://github.com/sonicdoe/measure-scrollbar
570
+ function measureScrollbar() {
571
+ if (typeof document === 'undefined') {
572
+ return 0;
573
+ }
574
+ const div = document.createElement('div');
575
+ div.style.width = '100px';
576
+ div.style.height = '100px';
577
+ div.style.overflow = 'scroll';
578
+ div.style.position = 'absolute';
579
+ div.style.top = '-9999px';
580
+ document.body.appendChild(div);
581
+ const scrollbarWidth = div.offsetWidth - div.clientWidth;
582
+ document.body.removeChild(div);
583
+ return scrollbarWidth;
584
+ }
585
+
586
+ class EmojiSearch {
587
+ constructor(emojiService) {
588
+ this.emojiService = emojiService;
589
+ this.originalPool = {};
590
+ this.index = {};
591
+ this.emojisList = {};
592
+ this.emoticonsList = {};
593
+ this.emojiSearch = {};
594
+ for (const emojiData of this.emojiService.emojis) {
595
+ const { shortNames, emoticons } = emojiData;
596
+ const id = shortNames[0];
597
+ for (const emoticon of emoticons) {
598
+ if (this.emoticonsList[emoticon]) {
599
+ continue;
600
+ }
601
+ this.emoticonsList[emoticon] = id;
602
+ }
603
+ this.emojisList[id] = this.emojiService.getSanitizedData(id);
604
+ this.originalPool[id] = emojiData;
605
+ }
606
+ }
607
+ addCustomToPool(custom, pool) {
608
+ for (const emoji of custom) {
609
+ const emojiId = emoji.id || emoji.shortNames[0];
610
+ if (emojiId && !pool[emojiId]) {
611
+ pool[emojiId] = this.emojiService.getData(emoji);
612
+ this.emojisList[emojiId] = this.emojiService.getSanitizedData(emoji);
613
+ }
614
+ }
615
+ }
616
+ search(value, emojisToShowFilter, maxResults = 75, include = [], exclude = [], custom = []) {
617
+ this.addCustomToPool(custom, this.originalPool);
618
+ let results;
619
+ let pool = this.originalPool;
620
+ if (value.length) {
621
+ if (value === '-' || value === '-1') {
622
+ return [this.emojisList['-1']];
623
+ }
624
+ if (value === '+' || value === '+1') {
625
+ return [this.emojisList['+1']];
626
+ }
627
+ let values = value.toLowerCase().split(/[\s|,|\-|_]+/);
628
+ let allResults = [];
629
+ if (values.length > 2) {
630
+ values = [values[0], values[1]];
631
+ }
632
+ if (include.length || exclude.length) {
633
+ pool = {};
634
+ for (const category of categories$1 || []) {
635
+ const isIncluded = include && include.length ? include.indexOf(category.id) > -1 : true;
636
+ const isExcluded = exclude && exclude.length ? exclude.indexOf(category.id) > -1 : false;
637
+ if (!isIncluded || isExcluded) {
638
+ continue;
639
+ }
640
+ for (const emojiId of category.emojis || []) {
641
+ // Need to make sure that pool gets keyed
642
+ // with the correct id, which is why we call emojiService.getData below
643
+ const emoji = this.emojiService.getData(emojiId);
644
+ pool[emoji?.id ?? ''] = emoji;
645
+ }
646
+ }
647
+ if (custom.length) {
648
+ const customIsIncluded = include && include.length ? include.indexOf('custom') > -1 : true;
649
+ const customIsExcluded = exclude && exclude.length ? exclude.indexOf('custom') > -1 : false;
650
+ if (customIsIncluded && !customIsExcluded) {
651
+ this.addCustomToPool(custom, pool);
652
+ }
653
+ }
654
+ }
655
+ allResults = values
656
+ .map(v => {
657
+ let aPool = pool;
658
+ let aIndex = this.index;
659
+ let length = 0;
660
+ // eslint-disable-next-line @typescript-eslint/prefer-for-of
661
+ for (let charIndex = 0; charIndex < v.length; charIndex++) {
662
+ const char = v[charIndex];
663
+ length++;
664
+ if (!aIndex[char]) {
665
+ aIndex[char] = {};
666
+ }
667
+ aIndex = aIndex[char];
668
+ if (!aIndex.results) {
669
+ const scores = {};
670
+ aIndex.results = [];
671
+ aIndex.pool = {};
672
+ for (const id of Object.keys(aPool)) {
673
+ const emoji = aPool[id];
674
+ if (!this.emojiSearch[id]) {
675
+ this.emojiSearch[id] = this.buildSearch(emoji.short_names, emoji.name, emoji.id, emoji.keywords, emoji.emoticons);
676
+ }
677
+ const query = this.emojiSearch[id];
678
+ const sub = v.substr(0, length);
679
+ const subIndex = query.indexOf(sub);
680
+ if (subIndex !== -1) {
681
+ let score = subIndex + 1;
682
+ if (sub === id) {
683
+ score = 0;
684
+ }
685
+ aIndex.results.push(this.emojisList[id]);
686
+ aIndex.pool[id] = emoji;
687
+ scores[id] = score;
688
+ }
689
+ }
690
+ aIndex.results.sort((a, b) => {
691
+ const aScore = scores[a.id];
692
+ const bScore = scores[b.id];
693
+ return aScore - bScore;
694
+ });
695
+ }
696
+ aPool = aIndex.pool;
697
+ }
698
+ return aIndex.results;
699
+ })
700
+ .filter(a => a);
701
+ if (allResults.length > 1) {
702
+ results = intersect.apply(null, allResults);
703
+ }
704
+ else if (allResults.length) {
705
+ results = allResults[0];
706
+ }
707
+ else {
708
+ results = [];
709
+ }
710
+ }
711
+ if (results) {
712
+ if (emojisToShowFilter) {
713
+ results = results.filter((result) => {
714
+ if (result && result.id) {
715
+ return emojisToShowFilter(this.emojiService.names[result.id]);
716
+ }
717
+ return false;
718
+ });
719
+ }
720
+ if (results && results.length > maxResults) {
721
+ results = results.slice(0, maxResults);
722
+ }
723
+ }
724
+ return results || null;
725
+ }
726
+ buildSearch(shortNames, name, id, keywords, emoticons) {
727
+ const search = [];
728
+ const addToSearch = (strings, split) => {
729
+ if (!strings) {
730
+ return;
731
+ }
732
+ const arr = Array.isArray(strings) ? strings : [strings];
733
+ for (const str of arr) {
734
+ const substrings = split ? str.split(/[-|_|\s]+/) : [str];
735
+ for (let s of substrings) {
736
+ s = s.toLowerCase();
737
+ if (!search.includes(s)) {
738
+ search.push(s);
739
+ }
740
+ }
741
+ }
742
+ };
743
+ addToSearch(shortNames, true);
744
+ addToSearch(name, true);
745
+ addToSearch(id, true);
746
+ addToSearch(keywords, true);
747
+ addToSearch(emoticons, false);
748
+ return search.join(',');
749
+ }
750
+ }
751
+ EmojiSearch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: EmojiSearch, deps: [{ token: i1.EmojiService }], target: i0.ɵɵFactoryTarget.Injectable });
752
+ EmojiSearch.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: EmojiSearch, providedIn: 'root' });
753
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: EmojiSearch, decorators: [{
754
+ type: Injectable,
755
+ args: [{ providedIn: 'root' }]
756
+ }], ctorParameters: function () { return [{ type: i1.EmojiService }]; } });
757
+
758
+ class SkinComponent {
759
+ constructor() {
760
+ this.changeSkin = new EventEmitter();
761
+ this.opened = false;
762
+ this.skinTones = [1, 2, 3, 4, 5, 6];
763
+ }
764
+ toggleOpen() {
765
+ this.opened = !this.opened;
766
+ }
767
+ isSelected(skinTone) {
768
+ return skinTone === this.skin;
769
+ }
770
+ isVisible(skinTone) {
771
+ return this.opened || this.isSelected(skinTone);
772
+ }
773
+ pressed(skinTone) {
774
+ return this.opened ? !!this.isSelected(skinTone) : '';
775
+ }
776
+ tabIndex(skinTone) {
777
+ return this.isVisible(skinTone) ? '0' : '';
778
+ }
779
+ expanded(skinTone) {
780
+ return this.isSelected(skinTone) ? this.opened : '';
781
+ }
782
+ handleClick(skin) {
783
+ if (!this.opened) {
784
+ this.opened = true;
785
+ return;
786
+ }
787
+ this.opened = false;
788
+ if (skin !== this.skin) {
789
+ this.changeSkin.emit(skin);
790
+ }
791
+ }
792
+ }
793
+ SkinComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: SkinComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
794
+ SkinComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: SkinComponent, selector: "emoji-skins", inputs: { skin: "skin", i18n: "i18n" }, outputs: { changeSkin: "changeSkin" }, ngImport: i0, template: `
795
+ <section
796
+ class="emoji-mart-skin-swatches"
797
+ [class.opened]="opened"
798
+ >
799
+ <span
800
+ *ngFor="let skinTone of skinTones"
801
+ class="emoji-mart-skin-swatch"
802
+ [class.selected]="skinTone === skin"
803
+ >
804
+ <span
805
+ (click)="handleClick(skinTone)"
806
+ (keyup.enter)="handleClick(skinTone)"
807
+ (keyup.space)="handleClick(skinTone)"
808
+ class="emoji-mart-skin emoji-mart-skin-tone-{{ skinTone }}"
809
+ role="button"
810
+ [tabIndex]="tabIndex(skinTone)"
811
+ [attr.aria-hidden]="!isVisible(skinTone)"
812
+ [attr.aria-pressed]="pressed(skinTone)"
813
+ [attr.aria-haspopup]="!!isSelected(skinTone)"
814
+ [attr.aria-expanded]="expanded(skinTone)"
815
+ [attr.aria-label]="i18n.skintones[skinTone]"
816
+ [title]="i18n.skintones[skinTone]"
817
+ ></span>
818
+ </span>
819
+ </section>
820
+ `, isInline: true, directives: [{ type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
821
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: SkinComponent, decorators: [{
822
+ type: Component,
823
+ args: [{
824
+ selector: 'emoji-skins',
825
+ template: `
826
+ <section
827
+ class="emoji-mart-skin-swatches"
828
+ [class.opened]="opened"
829
+ >
830
+ <span
831
+ *ngFor="let skinTone of skinTones"
832
+ class="emoji-mart-skin-swatch"
833
+ [class.selected]="skinTone === skin"
834
+ >
835
+ <span
836
+ (click)="handleClick(skinTone)"
837
+ (keyup.enter)="handleClick(skinTone)"
838
+ (keyup.space)="handleClick(skinTone)"
839
+ class="emoji-mart-skin emoji-mart-skin-tone-{{ skinTone }}"
840
+ role="button"
841
+ [tabIndex]="tabIndex(skinTone)"
842
+ [attr.aria-hidden]="!isVisible(skinTone)"
843
+ [attr.aria-pressed]="pressed(skinTone)"
844
+ [attr.aria-haspopup]="!!isSelected(skinTone)"
845
+ [attr.aria-expanded]="expanded(skinTone)"
846
+ [attr.aria-label]="i18n.skintones[skinTone]"
847
+ [title]="i18n.skintones[skinTone]"
848
+ ></span>
849
+ </span>
850
+ </section>
851
+ `,
852
+ changeDetection: ChangeDetectionStrategy.OnPush,
853
+ preserveWhitespaces: false,
854
+ }]
855
+ }], propDecorators: { skin: [{
856
+ type: Input
857
+ }], i18n: [{
858
+ type: Input
859
+ }], changeSkin: [{
860
+ type: Output
861
+ }] } });
862
+
863
+ class PreviewComponent {
864
+ constructor(ref, emojiService) {
865
+ this.ref = ref;
866
+ this.emojiService = emojiService;
867
+ this.skinChange = new EventEmitter();
868
+ this.emojiData = {};
869
+ }
870
+ ngOnChanges() {
871
+ if (!this.emoji) {
872
+ return;
873
+ }
874
+ this.emojiData = this.emojiService.getData(this.emoji, this.emojiSkin, this.emojiSet);
875
+ const knownEmoticons = [];
876
+ const listedEmoticons = [];
877
+ const emoitcons = this.emojiData.emoticons || [];
878
+ emoitcons.forEach((emoticon) => {
879
+ if (knownEmoticons.indexOf(emoticon.toLowerCase()) >= 0) {
880
+ return;
881
+ }
882
+ knownEmoticons.push(emoticon.toLowerCase());
883
+ listedEmoticons.push(emoticon);
884
+ });
885
+ this.listedEmoticons = listedEmoticons;
886
+ this.ref?.detectChanges();
887
+ }
888
+ }
889
+ PreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: PreviewComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.EmojiService }], target: i0.ɵɵFactoryTarget.Component });
890
+ PreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: PreviewComponent, selector: "emoji-preview", inputs: { title: "title", emoji: "emoji", idleEmoji: "idleEmoji", i18n: "i18n", emojiIsNative: "emojiIsNative", emojiSkin: "emojiSkin", emojiSize: "emojiSize", emojiSet: "emojiSet", emojiSheetSize: "emojiSheetSize", emojiBackgroundImageFn: "emojiBackgroundImageFn", emojiImageUrlFn: "emojiImageUrlFn" }, outputs: { skinChange: "skinChange" }, usesOnChanges: true, ngImport: i0, template: `
891
+ <div class="emoji-mart-preview" *ngIf="emoji && emojiData">
892
+ <div class="emoji-mart-preview-emoji">
893
+ <ngx-emoji
894
+ [emoji]="emoji"
895
+ [size]="38"
896
+ [isNative]="emojiIsNative"
897
+ [skin]="emojiSkin"
898
+ [size]="emojiSize"
899
+ [set]="emojiSet"
900
+ [sheetSize]="emojiSheetSize"
901
+ [backgroundImageFn]="emojiBackgroundImageFn"
902
+ [imageUrlFn]="emojiImageUrlFn"
903
+ ></ngx-emoji>
904
+ </div>
905
+
906
+ <div class="emoji-mart-preview-data">
907
+ <div class="emoji-mart-preview-name">{{ emojiData.name }}</div>
908
+ <div class="emoji-mart-preview-shortname">
909
+ <span
910
+ class="emoji-mart-preview-shortname"
911
+ *ngFor="let short_name of emojiData.shortNames"
912
+ >
913
+ :{{ short_name }}:
914
+ </span>
915
+ </div>
916
+ <div class="emoji-mart-preview-emoticons">
917
+ <span class="emoji-mart-preview-emoticon" *ngFor="let emoticon of listedEmoticons">
918
+ {{ emoticon }}
919
+ </span>
920
+ </div>
921
+ </div>
922
+ </div>
923
+
924
+ <div class="emoji-mart-preview" *ngIf="!emoji">
925
+ <div class="emoji-mart-preview-emoji">
926
+ <ngx-emoji
927
+ *ngIf="idleEmoji && idleEmoji.length"
928
+ [isNative]="emojiIsNative"
929
+ [skin]="emojiSkin"
930
+ [set]="emojiSet"
931
+ [emoji]="idleEmoji"
932
+ [backgroundImageFn]="emojiBackgroundImageFn"
933
+ [size]="38"
934
+ [imageUrlFn]="emojiImageUrlFn"
935
+ ></ngx-emoji>
936
+ </div>
937
+
938
+ <div class="emoji-mart-preview-data">
939
+ <span class="emoji-mart-title-label">{{ title }}</span>
940
+ </div>
941
+
942
+ <div class="emoji-mart-preview-skins">
943
+ <emoji-skins [skin]="emojiSkin" (changeSkin)="skinChange.emit($event)" [i18n]="i18n">
944
+ </emoji-skins>
945
+ </div>
946
+ </div>
947
+ `, isInline: true, components: [{ type: i1.EmojiComponent, selector: "ngx-emoji", inputs: ["skin", "set", "sheetSize", "isNative", "forceSize", "tooltip", "size", "emoji", "fallback", "hideObsolete", "sheetRows", "sheetColumns", "useButton", "backgroundImageFn", "imageUrlFn"], outputs: ["emojiOver", "emojiLeave", "emojiClick"] }, { type: SkinComponent, selector: "emoji-skins", inputs: ["skin", "i18n"], outputs: ["changeSkin"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
948
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: PreviewComponent, decorators: [{
949
+ type: Component,
950
+ args: [{
951
+ selector: 'emoji-preview',
952
+ template: `
953
+ <div class="emoji-mart-preview" *ngIf="emoji && emojiData">
954
+ <div class="emoji-mart-preview-emoji">
955
+ <ngx-emoji
956
+ [emoji]="emoji"
957
+ [size]="38"
958
+ [isNative]="emojiIsNative"
959
+ [skin]="emojiSkin"
960
+ [size]="emojiSize"
961
+ [set]="emojiSet"
962
+ [sheetSize]="emojiSheetSize"
963
+ [backgroundImageFn]="emojiBackgroundImageFn"
964
+ [imageUrlFn]="emojiImageUrlFn"
965
+ ></ngx-emoji>
966
+ </div>
967
+
968
+ <div class="emoji-mart-preview-data">
969
+ <div class="emoji-mart-preview-name">{{ emojiData.name }}</div>
970
+ <div class="emoji-mart-preview-shortname">
971
+ <span
972
+ class="emoji-mart-preview-shortname"
973
+ *ngFor="let short_name of emojiData.shortNames"
974
+ >
975
+ :{{ short_name }}:
976
+ </span>
977
+ </div>
978
+ <div class="emoji-mart-preview-emoticons">
979
+ <span class="emoji-mart-preview-emoticon" *ngFor="let emoticon of listedEmoticons">
980
+ {{ emoticon }}
981
+ </span>
982
+ </div>
983
+ </div>
984
+ </div>
985
+
986
+ <div class="emoji-mart-preview" *ngIf="!emoji">
987
+ <div class="emoji-mart-preview-emoji">
988
+ <ngx-emoji
989
+ *ngIf="idleEmoji && idleEmoji.length"
990
+ [isNative]="emojiIsNative"
991
+ [skin]="emojiSkin"
992
+ [set]="emojiSet"
993
+ [emoji]="idleEmoji"
994
+ [backgroundImageFn]="emojiBackgroundImageFn"
995
+ [size]="38"
996
+ [imageUrlFn]="emojiImageUrlFn"
997
+ ></ngx-emoji>
998
+ </div>
999
+
1000
+ <div class="emoji-mart-preview-data">
1001
+ <span class="emoji-mart-title-label">{{ title }}</span>
1002
+ </div>
1003
+
1004
+ <div class="emoji-mart-preview-skins">
1005
+ <emoji-skins [skin]="emojiSkin" (changeSkin)="skinChange.emit($event)" [i18n]="i18n">
1006
+ </emoji-skins>
1007
+ </div>
1008
+ </div>
1009
+ `,
1010
+ changeDetection: ChangeDetectionStrategy.OnPush,
1011
+ preserveWhitespaces: false,
1012
+ }]
1013
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.EmojiService }]; }, propDecorators: { title: [{
1014
+ type: Input
1015
+ }], emoji: [{
1016
+ type: Input
1017
+ }], idleEmoji: [{
1018
+ type: Input
1019
+ }], i18n: [{
1020
+ type: Input
1021
+ }], emojiIsNative: [{
1022
+ type: Input
1023
+ }], emojiSkin: [{
1024
+ type: Input
1025
+ }], emojiSize: [{
1026
+ type: Input
1027
+ }], emojiSet: [{
1028
+ type: Input
1029
+ }], emojiSheetSize: [{
1030
+ type: Input
1031
+ }], emojiBackgroundImageFn: [{
1032
+ type: Input
1033
+ }], emojiImageUrlFn: [{
1034
+ type: Input
1035
+ }], skinChange: [{
1036
+ type: Output
1037
+ }] } });
1038
+
1039
+ let id = 0;
1040
+ class SearchComponent {
1041
+ constructor(emojiSearch) {
1042
+ this.emojiSearch = emojiSearch;
1043
+ this.maxResults = 75;
1044
+ this.autoFocus = false;
1045
+ this.include = [];
1046
+ this.exclude = [];
1047
+ this.custom = [];
1048
+ this.searchResults = new EventEmitter();
1049
+ this.enterKey = new EventEmitter();
1050
+ this.isSearching = false;
1051
+ this.query = '';
1052
+ this.inputId = `emoji-mart-search-${++id}`;
1053
+ }
1054
+ ngOnInit() {
1055
+ this.icon = this.icons.search;
1056
+ }
1057
+ ngAfterViewInit() {
1058
+ if (this.autoFocus) {
1059
+ this.inputRef.nativeElement.focus();
1060
+ }
1061
+ }
1062
+ clear() {
1063
+ this.query = '';
1064
+ this.handleSearch('');
1065
+ this.inputRef.nativeElement.focus();
1066
+ }
1067
+ handleEnterKey($event) {
1068
+ if (!this.query) {
1069
+ return;
1070
+ }
1071
+ this.enterKey.emit($event);
1072
+ $event.preventDefault();
1073
+ }
1074
+ handleSearch(value) {
1075
+ if (value === '') {
1076
+ this.icon = this.icons.search;
1077
+ this.isSearching = false;
1078
+ }
1079
+ else {
1080
+ this.icon = this.icons.delete;
1081
+ this.isSearching = true;
1082
+ }
1083
+ const emojis = this.emojiSearch.search(this.query, this.emojisToShowFilter, this.maxResults, this.include, this.exclude, this.custom);
1084
+ this.searchResults.emit(emojis);
1085
+ }
1086
+ handleChange() {
1087
+ this.handleSearch(this.query);
1088
+ }
1089
+ }
1090
+ SearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: SearchComponent, deps: [{ token: EmojiSearch }], target: i0.ɵɵFactoryTarget.Component });
1091
+ SearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: SearchComponent, selector: "emoji-search", inputs: { maxResults: "maxResults", autoFocus: "autoFocus", i18n: "i18n", include: "include", exclude: "exclude", custom: "custom", icons: "icons", emojisToShowFilter: "emojisToShowFilter" }, outputs: { searchResults: "searchResults", enterKey: "enterKey" }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true, static: true }], ngImport: i0, template: `
1092
+ <div class="emoji-mart-search">
1093
+ <input
1094
+ [id]="inputId"
1095
+ #inputRef
1096
+ type="search"
1097
+ (keyup.enter)="handleEnterKey($event)"
1098
+ [placeholder]="i18n.search"
1099
+ [autofocus]="autoFocus"
1100
+ [(ngModel)]="query"
1101
+ (ngModelChange)="handleChange()"
1102
+ />
1103
+ <!--
1104
+ Use a <label> in addition to the placeholder for accessibility, but place it off-screen
1105
+ http://www.maxability.co.in/2016/01/placeholder-attribute-and-why-it-is-not-accessible/
1106
+ -->
1107
+ <label class="emoji-mart-sr-only" [htmlFor]="inputId">
1108
+ {{ i18n.search }}
1109
+ </label>
1110
+ <button
1111
+ type="button"
1112
+ class="emoji-mart-search-icon"
1113
+ (click)="clear()"
1114
+ (keyup.enter)="clear()"
1115
+ [disabled]="!isSearching"
1116
+ [attr.aria-label]="i18n.clear"
1117
+ >
1118
+ <svg
1119
+ xmlns="http://www.w3.org/2000/svg"
1120
+ viewBox="0 0 20 20"
1121
+ width="13"
1122
+ height="13"
1123
+ opacity="0.5"
1124
+ >
1125
+ <path [attr.d]="icon" />
1126
+ </svg>
1127
+ </button>
1128
+ </div>
1129
+ `, isInline: true, directives: [{ type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1130
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: SearchComponent, decorators: [{
1131
+ type: Component,
1132
+ args: [{
1133
+ selector: 'emoji-search',
1134
+ template: `
1135
+ <div class="emoji-mart-search">
1136
+ <input
1137
+ [id]="inputId"
1138
+ #inputRef
1139
+ type="search"
1140
+ (keyup.enter)="handleEnterKey($event)"
1141
+ [placeholder]="i18n.search"
1142
+ [autofocus]="autoFocus"
1143
+ [(ngModel)]="query"
1144
+ (ngModelChange)="handleChange()"
1145
+ />
1146
+ <!--
1147
+ Use a <label> in addition to the placeholder for accessibility, but place it off-screen
1148
+ http://www.maxability.co.in/2016/01/placeholder-attribute-and-why-it-is-not-accessible/
1149
+ -->
1150
+ <label class="emoji-mart-sr-only" [htmlFor]="inputId">
1151
+ {{ i18n.search }}
1152
+ </label>
1153
+ <button
1154
+ type="button"
1155
+ class="emoji-mart-search-icon"
1156
+ (click)="clear()"
1157
+ (keyup.enter)="clear()"
1158
+ [disabled]="!isSearching"
1159
+ [attr.aria-label]="i18n.clear"
1160
+ >
1161
+ <svg
1162
+ xmlns="http://www.w3.org/2000/svg"
1163
+ viewBox="0 0 20 20"
1164
+ width="13"
1165
+ height="13"
1166
+ opacity="0.5"
1167
+ >
1168
+ <path [attr.d]="icon" />
1169
+ </svg>
1170
+ </button>
1171
+ </div>
1172
+ `,
1173
+ preserveWhitespaces: false,
1174
+ }]
1175
+ }], ctorParameters: function () { return [{ type: EmojiSearch }]; }, propDecorators: { maxResults: [{
1176
+ type: Input
1177
+ }], autoFocus: [{
1178
+ type: Input
1179
+ }], i18n: [{
1180
+ type: Input
1181
+ }], include: [{
1182
+ type: Input
1183
+ }], exclude: [{
1184
+ type: Input
1185
+ }], custom: [{
1186
+ type: Input
1187
+ }], icons: [{
1188
+ type: Input
1189
+ }], emojisToShowFilter: [{
1190
+ type: Input
1191
+ }], searchResults: [{
1192
+ type: Output
1193
+ }], enterKey: [{
1194
+ type: Output
1195
+ }], inputRef: [{
1196
+ type: ViewChild,
1197
+ args: ['inputRef', { static: true }]
1198
+ }] } });
1199
+
1200
+ /* eslint-disable max-len */
1201
+ const categories = {
1202
+ activity: `M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24m10 11h-5c.3-2.5 1.3-4.8 2-6.1a10 10 0 0 1 3 6.1m-9 0V2a10 10 0 0 1 4.4 1.6A18 18 0 0 0 15 11h-2zm-2 0H9a18 18 0 0 0-2.4-7.4A10 10 0 0 1 11 2.1V11zm0 2v9a10 10 0 0 1-4.4-1.6A18 18 0 0 0 9 13h2zm4 0a18 18 0 0 0 2.4 7.4 10 10 0 0 1-4.4 1.5V13h2zM5 4.9c.7 1.3 1.7 3.6 2 6.1H2a10 10 0 0 1 3-6.1M2 13h5c-.3 2.5-1.3 4.8-2 6.1A10 10 0 0 1 2 13m17 6.1c-.7-1.3-1.7-3.6-2-6.1h5a10 10 0 0 1-3 6.1`,
1203
+ custom: `M10 1h3v21h-3zm10.186 4l1.5 2.598L3.5 18.098 2 15.5zM2 7.598L3.5 5l18.186 10.5-1.5 2.598z`,
1204
+ flags: `M0 0l6 24h2L2 0zm21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.6 3h7.8l2 8H8.6l-2-8zm8.8 10l-2.9 1.9-.4-1.9h3.3zm3.6 0l-1.5-6h2l2 8H16l3-2z`,
1205
+ foods: `M17 5c-1.8 0-2.9.4-3.7 1 .5-1.3 1.8-3 4.7-3a1 1 0 0 0 0-2c-3 0-4.6 1.3-5.5 2.5l-.2.2c-.6-1.9-1.5-3.7-3-3.7C8.5 0 7.7.3 7 1c-2 1.5-1.7 2.9-.5 4C3.6 5.2 0 7.4 0 13c0 4.6 5 11 9 11 2 0 2.4-.5 3-1 .6.5 1 1 3 1 4 0 9-6.4 9-11 0-6-4-8-7-8M8.2 2.5c.7-.5 1-.5 1-.5.4.2 1 1.4 1.4 3-1.6-.6-2.8-1.3-3-1.8l.6-.7M15 22c-1 0-1.2-.1-1.6-.4l-.1-.2a2 2 0 0 0-2.6 0l-.1.2c-.4.3-.5.4-1.6.4-2.8 0-7-5.4-7-9 0-6 4.5-6 5-6 2 0 2.5.4 3.4 1.2l.3.3a2 2 0 0 0 2.6 0l.3-.3c1-.8 1.5-1.2 3.4-1.2.5 0 5 .1 5 6 0 3.6-4.2 9-7 9`,
1206
+ nature: `M15.5 8a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3m-7 0a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3m10.43-8h-.02c-.97 0-2.14.79-3.02 1.5A13.88 13.88 0 0 0 12 .99c-1.28 0-2.62.13-3.87.51C7.24.8 6.07 0 5.09 0h-.02C3.35 0 .07 2.67 0 7.03c-.04 2.47.28 4.23 1.04 5 .26.27.88.69 1.3.9.19 3.17.92 5.23 2.53 6.37.9.64 2.19.95 3.2 1.1-.03.2-.07.4-.07.6 0 1.77 2.35 3 4 3s4-1.23 4-3c0-.2-.04-.4-.07-.59 2.57-.38 5.43-1.87 5.92-7.58.4-.22.89-.57 1.1-.8.77-.76 1.09-2.52 1.05-5C23.93 2.67 20.65 0 18.93 0M3.23 9.13c-.24.29-.84 1.16-.9 1.24A9.67 9.67 0 0 1 2 7.08c.05-3.28 2.48-4.97 3.1-5.03.25.02.72.27 1.26.65A7.95 7.95 0 0 0 4 7.82c-.14.55-.4.86-.79 1.31M12 22c-.9 0-1.95-.7-2-1 0-.65.47-1.24 1-1.6v.6a1 1 0 1 0 2 0v-.6c.52.36 1 .95 1 1.6-.05.3-1.1 1-2 1m3-3.48v.02a4.75 4.75 0 0 0-1.26-1.02c1.09-.52 2.24-1.33 2.24-2.22 0-1.84-1.78-2.2-3.98-2.2s-3.98.36-3.98 2.2c0 .89 1.15 1.7 2.24 2.22A4.8 4.8 0 0 0 9 18.54v-.03a6.1 6.1 0 0 1-2.97-.84c-1.3-.92-1.84-3.04-1.86-6.48l.03-.04c.5-.82 1.49-1.45 1.8-3.1C6 6 7.36 4.42 8.36 3.53c1.01-.35 2.2-.53 3.59-.53 1.45 0 2.68.2 3.73.57 1 .9 2.32 2.46 2.32 4.48.31 1.65 1.3 2.27 1.8 3.1l.1.18c-.06 5.97-1.95 7.01-4.9 7.19m6.63-8.2l-.11-.2a7.59 7.59 0 0 0-.74-.98 3.02 3.02 0 0 1-.79-1.32 7.93 7.93 0 0 0-2.35-5.12c.53-.38 1-.63 1.26-.65.64.07 3.05 1.77 3.1 5.03.02 1.81-.35 3.22-.37 3.24`,
1207
+ objects: `M12 0a9 9 0 0 0-5 16.5V21s2 3 5 3 5-3 5-3v-4.5A9 9 0 0 0 12 0zm0 2a7 7 0 1 1 0 14 7 7 0 0 1 0-14zM9 17.5a9 9 0 0 0 6 0v.8a7 7 0 0 1-3 .7 7 7 0 0 1-3-.7v-.8zm.2 3a8.9 8.9 0 0 0 2.8.5c1 0 1.9-.2 2.8-.5-.6.7-1.6 1.5-2.8 1.5-1.1 0-2.1-.8-2.8-1.5zm5.5-8.1c-.8 0-1.1-.8-1.5-1.8-.5-1-.7-1.5-1.2-1.5s-.8.5-1.3 1.5c-.4 1-.8 1.8-1.6 1.8h-.3c-.5-.2-.8-.7-1.3-1.8l-.2-1A3 3 0 0 0 7 9a1 1 0 0 1 0-2c1.7 0 2 1.4 2.2 2.1.5-1 1.3-2 2.8-2 1.5 0 2.3 1.1 2.7 2.1.2-.8.6-2.2 2.3-2.2a1 1 0 1 1 0 2c-.2 0-.3.5-.3.7a6.5 6.5 0 0 1-.3 1c-.5 1-.8 1.7-1.7 1.7`,
1208
+ people: `M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24m0 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20M8 7a2 2 0 1 0 0 4 2 2 0 0 0 0-4m8 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4m-.8 8c-.7 1.2-1.8 2-3.3 2-1.5 0-2.7-.8-3.4-2H15m3-2H6a6 6 0 1 0 12 0`,
1209
+ places: `M6.5 12a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5m0 3c-.3 0-.5-.2-.5-.5s.2-.5.5-.5.5.2.5.5-.2.5-.5.5m11-3a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5m0 3c-.3 0-.5-.2-.5-.5s.2-.5.5-.5.5.2.5.5-.2.5-.5.5m5-5.5l-1-.4-.1-.1h.6c.6 0 1-.4 1-1 0-1-.9-2-2-2h-.6l-.8-1.7A3 3 0 0 0 16.8 2H7.2a3 3 0 0 0-2.8 2.3L3.6 6H3a2 2 0 0 0-2 2c0 .6.4 1 1 1h.6v.1l-1 .4a2 2 0 0 0-1.4 2l.7 7.6a1 1 0 0 0 1 .9H3v1c0 1.1.9 2 2 2h2a2 2 0 0 0 2-2v-1h6v1c0 1.1.9 2 2 2h2a2 2 0 0 0 2-2v-1h1.1a1 1 0 0 0 1-.9l.7-7.5a2 2 0 0 0-1.3-2.1M6.3 4.9c.1-.5.5-.9 1-.9h9.5c.4 0 .8.4 1 .9L19.2 9H4.7l1.6-4.1zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.2-3H2.8l-.7-6.6.9-.4h18l.9.4-.7 6.6z`,
1210
+ recent: `M13 4h-2v7H9v2h2v2h2v-2h4v-2h-4zm-1-4a12 12 0 1 0 0 24 12 12 0 0 0 0-24m0 22a10 10 0 1 1 0-20 10 10 0 0 1 0 20`,
1211
+ symbols: `M0 0h11v2H0zm4 11h3V6h4V4H0v2h4zm11.5 6a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5m0-2.99a.5.5 0 0 1 0 .99c-.28 0-.5-.22-.5-.5s.22-.49.5-.49m6 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5m0 2.99a.5.5 0 0 1-.5-.5.5.5 0 0 1 1 .01.5.5 0 0 1-.5.49m.5-9l-9 9 1.51 1.5 9-9zm-5-2c2.2 0 4-1.12 4-2.5V2s.98-.16 1.5.95C23 4.05 23 6 23 6s1-1.12 1-3.13C24-.02 21 0 21 0h-2v6.35A5.85 5.85 0 0 0 17 6c-2.2 0-4 1.12-4 2.5s1.8 2.5 4 2.5m-6.7 9.48L8.82 18.9a47.54 47.54 0 0 1-1.44 1.13c-.3-.3-.99-1.02-2.04-2.19.9-.83 1.47-1.46 1.72-1.89s.38-.87.38-1.33c0-.6-.27-1.18-.82-1.76-.54-.58-1.33-.87-2.35-.87-1 0-1.79.29-2.34.87-.56.6-.83 1.18-.83 1.79 0 .81.42 1.75 1.25 2.8a6.57 6.57 0 0 0-1.8 1.79 3.46 3.46 0 0 0-.51 1.83c0 .86.3 1.56.92 2.1a3.5 3.5 0 0 0 2.42.83c1.17 0 2.44-.38 3.81-1.14L8.23 24h2.82l-2.09-2.38 1.34-1.14zM3.56 14.1a1.02 1.02 0 0 1 .73-.28c.31 0 .56.08.75.25a.85.85 0 0 1 .28.66c0 .52-.42 1.11-1.26 1.78-.53-.65-.8-1.23-.8-1.74a.9.9 0 0 1 .3-.67m.18 7.9c-.43 0-.78-.12-1.06-.35-.28-.23-.41-.49-.41-.76 0-.6.5-1.3 1.52-2.09a31.23 31.23 0 0 0 2.25 2.44c-.92.5-1.69.76-2.3.76`,
1212
+ };
1213
+ const search = {
1214
+ search: `M12.9 14.32a8 8 0 1 1 1.41-1.41l5.35 5.33-1.42 1.42-5.33-5.34zM8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z`,
1215
+ delete: `M10 8.586L2.929 1.515 1.515 2.929 8.586 10l-7.071 7.071 1.414 1.414L10 11.414l7.071 7.071 1.414-1.414L11.414 10l7.071-7.071-1.414-1.414L10 8.586z`,
1216
+ };
1217
+
1218
+ const I18N = {
1219
+ search: 'Search',
1220
+ emojilist: 'List of emoji',
1221
+ notfound: 'No Emoji Found',
1222
+ clear: 'Clear',
1223
+ categories: {
1224
+ search: 'Search Results',
1225
+ recent: 'Frequently Used',
1226
+ people: 'Smileys & People',
1227
+ nature: 'Animals & Nature',
1228
+ foods: 'Food & Drink',
1229
+ activity: 'Activity',
1230
+ places: 'Travel & Places',
1231
+ objects: 'Objects',
1232
+ symbols: 'Symbols',
1233
+ flags: 'Flags',
1234
+ custom: 'Custom',
1235
+ },
1236
+ skintones: {
1237
+ 1: 'Default Skin Tone',
1238
+ 2: 'Light Skin Tone',
1239
+ 3: 'Medium-Light Skin Tone',
1240
+ 4: 'Medium Skin Tone',
1241
+ 5: 'Medium-Dark Skin Tone',
1242
+ 6: 'Dark Skin Tone',
1243
+ },
1244
+ };
1245
+ class PickerComponent {
1246
+ constructor(ngZone, renderer, ref, frequently, platformId) {
1247
+ this.ngZone = ngZone;
1248
+ this.renderer = renderer;
1249
+ this.ref = ref;
1250
+ this.frequently = frequently;
1251
+ this.platformId = platformId;
1252
+ this.perLine = 9;
1253
+ this.totalFrequentLines = 4;
1254
+ this.i18n = {};
1255
+ this.style = {};
1256
+ this.title = 'Emoji Mart™';
1257
+ this.emoji = 'department_store';
1258
+ this.darkMode = !!(typeof matchMedia === 'function' && matchMedia('(prefers-color-scheme: dark)').matches);
1259
+ this.color = '#ae65c5';
1260
+ this.hideObsolete = true;
1261
+ /** all categories shown */
1262
+ this.categories = [];
1263
+ /** used to temporarily draw categories */
1264
+ this.activeCategories = [];
1265
+ this.set = 'apple';
1266
+ this.skin = 1;
1267
+ /** Renders the native unicode emoji */
1268
+ this.isNative = false;
1269
+ this.emojiSize = 24;
1270
+ this.sheetSize = 64;
1271
+ this.showPreview = true;
1272
+ this.emojiTooltip = false;
1273
+ this.autoFocus = false;
1274
+ this.custom = [];
1275
+ this.hideRecent = true;
1276
+ this.notFoundEmoji = 'sleuth_or_spy';
1277
+ this.categoriesIcons = categories;
1278
+ this.searchIcons = search;
1279
+ this.useButton = false;
1280
+ this.enableFrequentEmojiSort = false;
1281
+ this.enableSearch = true;
1282
+ this.showSingleCategory = false;
1283
+ this.virtualize = false;
1284
+ this.virtualizeOffset = 0;
1285
+ this.emojiClick = new EventEmitter();
1286
+ this.emojiSelect = new EventEmitter();
1287
+ this.skinChange = new EventEmitter();
1288
+ this.scrollHeight = 0;
1289
+ this.clientHeight = 0;
1290
+ this.clientWidth = 0;
1291
+ this.firstRender = true;
1292
+ this.animationFrameRequestId = null;
1293
+ this.NAMESPACE = 'emoji-mart';
1294
+ this.measureScrollbar = 0;
1295
+ this.RECENT_CATEGORY = {
1296
+ id: 'recent',
1297
+ name: 'Recent',
1298
+ emojis: null,
1299
+ };
1300
+ this.SEARCH_CATEGORY = {
1301
+ id: 'search',
1302
+ name: 'Search',
1303
+ emojis: null,
1304
+ anchor: false,
1305
+ };
1306
+ this.CUSTOM_CATEGORY = {
1307
+ id: 'custom',
1308
+ name: 'Custom',
1309
+ emojis: [],
1310
+ };
1311
+ this.backgroundImageFn = (set, sheetSize) => `https://unpkg.com/emoji-datasource-${this.set}@6.0.1/img/${this.set}/sheets-256/${this.sheetSize}.png`;
1312
+ }
1313
+ ngOnInit() {
1314
+ // measure scroll
1315
+ this.measureScrollbar = measureScrollbar();
1316
+ this.i18n = { ...I18N, ...this.i18n };
1317
+ this.i18n.categories = { ...I18N.categories, ...this.i18n.categories };
1318
+ this.skin =
1319
+ JSON.parse((isPlatformBrowser(this.platformId) && localStorage.getItem(`${this.NAMESPACE}.skin`)) ||
1320
+ 'null') || this.skin;
1321
+ const allCategories = [...categories$1];
1322
+ if (this.custom.length > 0) {
1323
+ this.CUSTOM_CATEGORY.emojis = this.custom.map(emoji => {
1324
+ return {
1325
+ ...emoji,
1326
+ // `<Category />` expects emoji to have an `id`.
1327
+ id: emoji.shortNames[0],
1328
+ custom: true,
1329
+ };
1330
+ });
1331
+ allCategories.push(this.CUSTOM_CATEGORY);
1332
+ }
1333
+ if (this.include !== undefined) {
1334
+ allCategories.sort((a, b) => {
1335
+ if (this.include.indexOf(a.id) > this.include.indexOf(b.id)) {
1336
+ return 1;
1337
+ }
1338
+ return -1;
1339
+ });
1340
+ }
1341
+ for (const category of allCategories) {
1342
+ const isIncluded = this.include && this.include.length ? this.include.indexOf(category.id) > -1 : true;
1343
+ const isExcluded = this.exclude && this.exclude.length ? this.exclude.indexOf(category.id) > -1 : false;
1344
+ if (!isIncluded || isExcluded) {
1345
+ continue;
1346
+ }
1347
+ if (this.emojisToShowFilter) {
1348
+ const newEmojis = [];
1349
+ const { emojis } = category;
1350
+ // eslint-disable-next-line @typescript-eslint/prefer-for-of
1351
+ for (let emojiIndex = 0; emojiIndex < emojis.length; emojiIndex++) {
1352
+ const emoji = emojis[emojiIndex];
1353
+ if (this.emojisToShowFilter(emoji)) {
1354
+ newEmojis.push(emoji);
1355
+ }
1356
+ }
1357
+ if (newEmojis.length) {
1358
+ const newCategory = {
1359
+ emojis: newEmojis,
1360
+ name: category.name,
1361
+ id: category.id,
1362
+ };
1363
+ this.categories.push(newCategory);
1364
+ }
1365
+ }
1366
+ else {
1367
+ this.categories.push(category);
1368
+ }
1369
+ this.categoriesIcons = { ...categories, ...this.categoriesIcons };
1370
+ this.searchIcons = { ...search, ...this.searchIcons };
1371
+ }
1372
+ const includeRecent = this.include && this.include.length
1373
+ ? this.include.indexOf(this.RECENT_CATEGORY.id) > -1
1374
+ : true;
1375
+ const excludeRecent = this.exclude && this.exclude.length
1376
+ ? this.exclude.indexOf(this.RECENT_CATEGORY.id) > -1
1377
+ : false;
1378
+ if (includeRecent && !excludeRecent) {
1379
+ this.hideRecent = false;
1380
+ this.categories.unshift(this.RECENT_CATEGORY);
1381
+ }
1382
+ if (this.categories[0]) {
1383
+ this.categories[0].first = true;
1384
+ }
1385
+ this.categories.unshift(this.SEARCH_CATEGORY);
1386
+ this.selected = this.categories.filter(category => category.first)[0].name;
1387
+ // Need to be careful if small number of categories
1388
+ const categoriesToLoadFirst = Math.min(this.categories.length, 3);
1389
+ this.setActiveCategories((this.activeCategories = this.categories.slice(0, categoriesToLoadFirst)));
1390
+ // Trim last active category
1391
+ const lastActiveCategoryEmojis = this.categories[categoriesToLoadFirst - 1].emojis.slice();
1392
+ this.categories[categoriesToLoadFirst - 1].emojis = lastActiveCategoryEmojis.slice(0, 60);
1393
+ setTimeout(() => {
1394
+ // Restore last category
1395
+ this.categories[categoriesToLoadFirst - 1].emojis = lastActiveCategoryEmojis;
1396
+ this.setActiveCategories(this.categories);
1397
+ // The `setTimeout` will trigger the change detection, but since we're inside
1398
+ // the OnPush component we can run change detection locally starting from this
1399
+ // component and going down to the children.
1400
+ this.ref.detectChanges();
1401
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
1402
+ isPlatformBrowser(this.platformId) &&
1403
+ this.ngZone.runOutsideAngular(() => {
1404
+ // The `updateCategoriesSize` doesn't change properties that are used
1405
+ // in templates, thus this is run in the context of the root zone to avoid
1406
+ // running change detection.
1407
+ requestAnimationFrame(() => {
1408
+ this.updateCategoriesSize();
1409
+ });
1410
+ });
1411
+ });
1412
+ this.ngZone.runOutsideAngular(() => {
1413
+ // DOM events that are listened by Angular inside the template trigger change detection
1414
+ // and also wrapped into additional functions that call `markForCheck()`. We listen `scroll`
1415
+ // in the context of the root zone since it will not trigger change detection each time
1416
+ // the `scroll` event is dispatched.
1417
+ this.scrollListener = this.renderer.listen(this.scrollRef.nativeElement, 'scroll', () => {
1418
+ this.handleScroll();
1419
+ });
1420
+ });
1421
+ }
1422
+ ngOnDestroy() {
1423
+ this.scrollListener();
1424
+ // This is called here because the component might be destroyed
1425
+ // but there will still be a `requestAnimationFrame` callback in the queue
1426
+ // that calls `detectChanges()` on the `ViewRef`. This will lead to a runtime
1427
+ // exception if the `detectChanges()` is called after the `ViewRef` is destroyed.
1428
+ this.cancelAnimationFrame();
1429
+ }
1430
+ setActiveCategories(categoriesToMakeActive) {
1431
+ if (this.showSingleCategory) {
1432
+ this.activeCategories = categoriesToMakeActive.filter(x => x.name === this.selected || x === this.SEARCH_CATEGORY);
1433
+ }
1434
+ else {
1435
+ this.activeCategories = categoriesToMakeActive;
1436
+ }
1437
+ }
1438
+ updateCategoriesSize() {
1439
+ this.categoryRefs.forEach(component => component.memoizeSize());
1440
+ if (this.scrollRef) {
1441
+ const target = this.scrollRef.nativeElement;
1442
+ this.scrollHeight = target.scrollHeight;
1443
+ this.clientHeight = target.clientHeight;
1444
+ this.clientWidth = target.clientWidth;
1445
+ }
1446
+ }
1447
+ handleAnchorClick($event) {
1448
+ this.updateCategoriesSize();
1449
+ this.selected = $event.category.name;
1450
+ this.setActiveCategories(this.categories);
1451
+ if (this.SEARCH_CATEGORY.emojis) {
1452
+ this.handleSearch(null);
1453
+ this.searchRef?.clear();
1454
+ this.handleAnchorClick($event);
1455
+ return;
1456
+ }
1457
+ const component = this.categoryRefs.find(n => n.id === $event.category.id);
1458
+ if (component) {
1459
+ let { top } = component;
1460
+ if ($event.category.first) {
1461
+ top = 0;
1462
+ }
1463
+ else {
1464
+ top += 1;
1465
+ }
1466
+ this.scrollRef.nativeElement.scrollTop = top;
1467
+ }
1468
+ this.nextScroll = $event.category.name;
1469
+ // handle component scrolling to load emojis
1470
+ for (const category of this.categories) {
1471
+ const componentToScroll = this.categoryRefs.find(({ id }) => id === category.id);
1472
+ componentToScroll?.handleScroll(this.scrollRef.nativeElement.scrollTop);
1473
+ }
1474
+ }
1475
+ categoryTrack(index, item) {
1476
+ return item.id;
1477
+ }
1478
+ handleScroll(noSelectionChange = false) {
1479
+ if (this.nextScroll) {
1480
+ this.selected = this.nextScroll;
1481
+ this.nextScroll = undefined;
1482
+ this.ref.detectChanges();
1483
+ return;
1484
+ }
1485
+ if (!this.scrollRef) {
1486
+ return;
1487
+ }
1488
+ if (this.showSingleCategory) {
1489
+ return;
1490
+ }
1491
+ let activeCategory;
1492
+ if (this.SEARCH_CATEGORY.emojis) {
1493
+ activeCategory = this.SEARCH_CATEGORY;
1494
+ }
1495
+ else {
1496
+ const target = this.scrollRef.nativeElement;
1497
+ // check scroll is not at bottom
1498
+ if (target.scrollTop === 0) {
1499
+ // hit the TOP
1500
+ activeCategory = this.categories.find(n => n.first === true);
1501
+ }
1502
+ else if (target.scrollHeight - target.scrollTop === this.clientHeight) {
1503
+ // scrolled to bottom activate last category
1504
+ activeCategory = this.categories[this.categories.length - 1];
1505
+ }
1506
+ else {
1507
+ // scrolling
1508
+ for (const category of this.categories) {
1509
+ const component = this.categoryRefs.find(({ id }) => id === category.id);
1510
+ const active = component?.handleScroll(target.scrollTop);
1511
+ if (active) {
1512
+ activeCategory = category;
1513
+ }
1514
+ }
1515
+ }
1516
+ this.scrollTop = target.scrollTop;
1517
+ }
1518
+ // This will allow us to run the change detection only when the category changes.
1519
+ if (!noSelectionChange && activeCategory && activeCategory.name !== this.selected) {
1520
+ this.selected = activeCategory.name;
1521
+ this.ref.detectChanges();
1522
+ }
1523
+ else if (noSelectionChange) {
1524
+ this.ref.detectChanges();
1525
+ }
1526
+ }
1527
+ handleSearch($emojis) {
1528
+ this.SEARCH_CATEGORY.emojis = $emojis;
1529
+ for (const component of this.categoryRefs.toArray()) {
1530
+ if (component.name === 'Search') {
1531
+ component.emojis = $emojis;
1532
+ component.updateDisplay($emojis ? 'block' : 'none');
1533
+ }
1534
+ else {
1535
+ component.updateDisplay($emojis ? 'none' : 'block');
1536
+ }
1537
+ }
1538
+ this.scrollRef.nativeElement.scrollTop = 0;
1539
+ this.handleScroll();
1540
+ }
1541
+ handleEnterKey($event, emoji) {
1542
+ if (!emoji) {
1543
+ if (this.SEARCH_CATEGORY.emojis !== null && this.SEARCH_CATEGORY.emojis.length) {
1544
+ emoji = this.SEARCH_CATEGORY.emojis[0];
1545
+ if (emoji) {
1546
+ this.emojiSelect.emit({ $event, emoji });
1547
+ }
1548
+ else {
1549
+ return;
1550
+ }
1551
+ }
1552
+ }
1553
+ if (!this.hideRecent && !this.recent && emoji) {
1554
+ this.frequently.add(emoji);
1555
+ }
1556
+ const component = this.categoryRefs.toArray()[1];
1557
+ if (component && this.enableFrequentEmojiSort) {
1558
+ component.updateRecentEmojis();
1559
+ component.ref.markForCheck();
1560
+ }
1561
+ }
1562
+ handleEmojiOver($event) {
1563
+ if (!this.showPreview || !this.previewRef) {
1564
+ return;
1565
+ }
1566
+ const emojiData = this.CUSTOM_CATEGORY.emojis.find((customEmoji) => customEmoji.id === $event.emoji.id);
1567
+ if (emojiData) {
1568
+ $event.emoji = { ...emojiData };
1569
+ }
1570
+ this.previewEmoji = $event.emoji;
1571
+ this.cancelAnimationFrame();
1572
+ this.ref?.detectChanges();
1573
+ }
1574
+ handleEmojiLeave() {
1575
+ if (!this.showPreview || !this.previewRef) {
1576
+ return;
1577
+ }
1578
+ this.ngZone.runOutsideAngular(() => {
1579
+ this.animationFrameRequestId = requestAnimationFrame(() => {
1580
+ this.previewEmoji = null;
1581
+ this.ref.detectChanges();
1582
+ });
1583
+ });
1584
+ }
1585
+ handleEmojiClick($event) {
1586
+ this.emojiClick.emit($event);
1587
+ this.emojiSelect.emit($event);
1588
+ this.handleEnterKey($event.$event, $event.emoji);
1589
+ }
1590
+ handleSkinChange(skin) {
1591
+ this.skin = skin;
1592
+ localStorage.setItem(`${this.NAMESPACE}.skin`, String(skin));
1593
+ this.skinChange.emit(skin);
1594
+ }
1595
+ getWidth() {
1596
+ if (this.style && this.style.width) {
1597
+ return this.style.width;
1598
+ }
1599
+ return this.perLine * (this.emojiSize + 12) + 12 + 2 + this.measureScrollbar + 'px';
1600
+ }
1601
+ cancelAnimationFrame() {
1602
+ if (this.animationFrameRequestId !== null) {
1603
+ cancelAnimationFrame(this.animationFrameRequestId);
1604
+ this.animationFrameRequestId = null;
1605
+ }
1606
+ }
1607
+ }
1608
+ PickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: PickerComponent, deps: [{ token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: EmojiFrequentlyService }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
1609
+ PickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: PickerComponent, selector: "emoji-mart", inputs: { perLine: "perLine", totalFrequentLines: "totalFrequentLines", i18n: "i18n", style: "style", title: "title", emoji: "emoji", darkMode: "darkMode", color: "color", hideObsolete: "hideObsolete", categories: "categories", activeCategories: "activeCategories", set: "set", skin: "skin", isNative: "isNative", emojiSize: "emojiSize", sheetSize: "sheetSize", emojisToShowFilter: "emojisToShowFilter", showPreview: "showPreview", emojiTooltip: "emojiTooltip", autoFocus: "autoFocus", custom: "custom", hideRecent: "hideRecent", imageUrlFn: "imageUrlFn", include: "include", exclude: "exclude", notFoundEmoji: "notFoundEmoji", categoriesIcons: "categoriesIcons", searchIcons: "searchIcons", useButton: "useButton", enableFrequentEmojiSort: "enableFrequentEmojiSort", enableSearch: "enableSearch", showSingleCategory: "showSingleCategory", virtualize: "virtualize", virtualizeOffset: "virtualizeOffset", recent: "recent", backgroundImageFn: "backgroundImageFn" }, outputs: { emojiClick: "emojiClick", emojiSelect: "emojiSelect", skinChange: "skinChange" }, viewQueries: [{ propertyName: "scrollRef", first: true, predicate: ["scrollRef"], descendants: true, static: true }, { propertyName: "previewRef", first: true, predicate: PreviewComponent, descendants: true }, { propertyName: "searchRef", first: true, predicate: SearchComponent, descendants: true }, { propertyName: "categoryRefs", predicate: CategoryComponent, descendants: true }], ngImport: i0, template: "<section\n class=\"emoji-mart {{ darkMode ? 'emoji-mart-dark' : '' }}\"\n [style.width]=\"getWidth()\"\n [ngStyle]=\"style\"\n>\n <div class=\"emoji-mart-bar\">\n <emoji-mart-anchors\n [categories]=\"categories\"\n (anchorClick)=\"handleAnchorClick($event)\"\n [color]=\"color\"\n [selected]=\"selected\"\n [i18n]=\"i18n\"\n [icons]=\"categoriesIcons\"\n ></emoji-mart-anchors>\n </div>\n <emoji-search\n *ngIf=\"enableSearch\"\n [i18n]=\"i18n\"\n (searchResults)=\"handleSearch($event)\"\n (enterKey)=\"handleEnterKey($event)\"\n [include]=\"include\"\n [exclude]=\"exclude\"\n [custom]=\"custom\"\n [autoFocus]=\"autoFocus\"\n [icons]=\"searchIcons\"\n [emojisToShowFilter]=\"emojisToShowFilter\"\n ></emoji-search>\n <section #scrollRef class=\"emoji-mart-scroll\" [attr.aria-label]=\"i18n.emojilist\">\n <emoji-category\n *ngFor=\"let category of activeCategories; let idx = index; trackBy: categoryTrack\"\n [id]=\"category.id\"\n [name]=\"category.name\"\n [emojis]=\"category.emojis\"\n [perLine]=\"perLine\"\n [totalFrequentLines]=\"totalFrequentLines\"\n [hasStickyPosition]=\"isNative\"\n [i18n]=\"i18n\"\n [hideObsolete]=\"hideObsolete\"\n [notFoundEmoji]=\"notFoundEmoji\"\n [custom]=\"category.id === RECENT_CATEGORY.id ? CUSTOM_CATEGORY.emojis : undefined\"\n [recent]=\"category.id === RECENT_CATEGORY.id ? recent : undefined\"\n [virtualize]=\"virtualize\"\n [virtualizeOffset]=\"virtualizeOffset\"\n [emojiIsNative]=\"isNative\"\n [emojiSkin]=\"skin\"\n [emojiSize]=\"emojiSize\"\n [emojiSet]=\"set\"\n [emojiSheetSize]=\"sheetSize\"\n [emojiForceSize]=\"isNative\"\n [emojiTooltip]=\"emojiTooltip\"\n [emojiBackgroundImageFn]=\"backgroundImageFn\"\n [emojiImageUrlFn]=\"imageUrlFn\"\n [emojiUseButton]=\"useButton\"\n (emojiOver)=\"handleEmojiOver($event)\"\n (emojiLeave)=\"handleEmojiLeave()\"\n (emojiClick)=\"handleEmojiClick($event)\"\n ></emoji-category>\n </section>\n <div class=\"emoji-mart-bar\" *ngIf=\"showPreview\">\n <emoji-preview\n [title]=\"title\"\n [emoji]=\"previewEmoji\"\n [idleEmoji]=\"emoji\"\n [emojiIsNative]=\"isNative\"\n [emojiSize]=\"38\"\n [emojiSkin]=\"skin\"\n [emojiSet]=\"set\"\n [i18n]=\"i18n\"\n [emojiSheetSize]=\"sheetSize\"\n [emojiBackgroundImageFn]=\"backgroundImageFn\"\n [emojiImageUrlFn]=\"imageUrlFn\"\n (skinChange)=\"handleSkinChange($event)\"\n ></emoji-preview>\n </div>\n</section>\n", components: [{ type: AnchorsComponent, selector: "emoji-mart-anchors", inputs: ["categories", "color", "selected", "i18n", "icons"], outputs: ["anchorClick"] }, { type: SearchComponent, selector: "emoji-search", inputs: ["maxResults", "autoFocus", "i18n", "include", "exclude", "custom", "icons", "emojisToShowFilter"], outputs: ["searchResults", "enterKey"] }, { type: CategoryComponent, selector: "emoji-category", inputs: ["emojis", "hasStickyPosition", "name", "perLine", "totalFrequentLines", "recent", "custom", "i18n", "id", "hideObsolete", "notFoundEmoji", "virtualize", "virtualizeOffset", "emojiIsNative", "emojiSkin", "emojiSize", "emojiSet", "emojiSheetSize", "emojiForceSize", "emojiTooltip", "emojiBackgroundImageFn", "emojiImageUrlFn", "emojiUseButton"], outputs: ["emojiOver", "emojiLeave", "emojiClick"] }, { type: PreviewComponent, selector: "emoji-preview", inputs: ["title", "emoji", "idleEmoji", "i18n", "emojiIsNative", "emojiSkin", "emojiSize", "emojiSet", "emojiSheetSize", "emojiBackgroundImageFn", "emojiImageUrlFn"], outputs: ["skinChange"] }], directives: [{ type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1610
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: PickerComponent, decorators: [{
1611
+ type: Component,
1612
+ args: [{ selector: 'emoji-mart', changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<section\n class=\"emoji-mart {{ darkMode ? 'emoji-mart-dark' : '' }}\"\n [style.width]=\"getWidth()\"\n [ngStyle]=\"style\"\n>\n <div class=\"emoji-mart-bar\">\n <emoji-mart-anchors\n [categories]=\"categories\"\n (anchorClick)=\"handleAnchorClick($event)\"\n [color]=\"color\"\n [selected]=\"selected\"\n [i18n]=\"i18n\"\n [icons]=\"categoriesIcons\"\n ></emoji-mart-anchors>\n </div>\n <emoji-search\n *ngIf=\"enableSearch\"\n [i18n]=\"i18n\"\n (searchResults)=\"handleSearch($event)\"\n (enterKey)=\"handleEnterKey($event)\"\n [include]=\"include\"\n [exclude]=\"exclude\"\n [custom]=\"custom\"\n [autoFocus]=\"autoFocus\"\n [icons]=\"searchIcons\"\n [emojisToShowFilter]=\"emojisToShowFilter\"\n ></emoji-search>\n <section #scrollRef class=\"emoji-mart-scroll\" [attr.aria-label]=\"i18n.emojilist\">\n <emoji-category\n *ngFor=\"let category of activeCategories; let idx = index; trackBy: categoryTrack\"\n [id]=\"category.id\"\n [name]=\"category.name\"\n [emojis]=\"category.emojis\"\n [perLine]=\"perLine\"\n [totalFrequentLines]=\"totalFrequentLines\"\n [hasStickyPosition]=\"isNative\"\n [i18n]=\"i18n\"\n [hideObsolete]=\"hideObsolete\"\n [notFoundEmoji]=\"notFoundEmoji\"\n [custom]=\"category.id === RECENT_CATEGORY.id ? CUSTOM_CATEGORY.emojis : undefined\"\n [recent]=\"category.id === RECENT_CATEGORY.id ? recent : undefined\"\n [virtualize]=\"virtualize\"\n [virtualizeOffset]=\"virtualizeOffset\"\n [emojiIsNative]=\"isNative\"\n [emojiSkin]=\"skin\"\n [emojiSize]=\"emojiSize\"\n [emojiSet]=\"set\"\n [emojiSheetSize]=\"sheetSize\"\n [emojiForceSize]=\"isNative\"\n [emojiTooltip]=\"emojiTooltip\"\n [emojiBackgroundImageFn]=\"backgroundImageFn\"\n [emojiImageUrlFn]=\"imageUrlFn\"\n [emojiUseButton]=\"useButton\"\n (emojiOver)=\"handleEmojiOver($event)\"\n (emojiLeave)=\"handleEmojiLeave()\"\n (emojiClick)=\"handleEmojiClick($event)\"\n ></emoji-category>\n </section>\n <div class=\"emoji-mart-bar\" *ngIf=\"showPreview\">\n <emoji-preview\n [title]=\"title\"\n [emoji]=\"previewEmoji\"\n [idleEmoji]=\"emoji\"\n [emojiIsNative]=\"isNative\"\n [emojiSize]=\"38\"\n [emojiSkin]=\"skin\"\n [emojiSet]=\"set\"\n [i18n]=\"i18n\"\n [emojiSheetSize]=\"sheetSize\"\n [emojiBackgroundImageFn]=\"backgroundImageFn\"\n [emojiImageUrlFn]=\"imageUrlFn\"\n (skinChange)=\"handleSkinChange($event)\"\n ></emoji-preview>\n </div>\n</section>\n" }]
1613
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: EmojiFrequentlyService }, { type: undefined, decorators: [{
1614
+ type: Inject,
1615
+ args: [PLATFORM_ID]
1616
+ }] }]; }, propDecorators: { perLine: [{
1617
+ type: Input
1618
+ }], totalFrequentLines: [{
1619
+ type: Input
1620
+ }], i18n: [{
1621
+ type: Input
1622
+ }], style: [{
1623
+ type: Input
1624
+ }], title: [{
1625
+ type: Input
1626
+ }], emoji: [{
1627
+ type: Input
1628
+ }], darkMode: [{
1629
+ type: Input
1630
+ }], color: [{
1631
+ type: Input
1632
+ }], hideObsolete: [{
1633
+ type: Input
1634
+ }], categories: [{
1635
+ type: Input
1636
+ }], activeCategories: [{
1637
+ type: Input
1638
+ }], set: [{
1639
+ type: Input
1640
+ }], skin: [{
1641
+ type: Input
1642
+ }], isNative: [{
1643
+ type: Input
1644
+ }], emojiSize: [{
1645
+ type: Input
1646
+ }], sheetSize: [{
1647
+ type: Input
1648
+ }], emojisToShowFilter: [{
1649
+ type: Input
1650
+ }], showPreview: [{
1651
+ type: Input
1652
+ }], emojiTooltip: [{
1653
+ type: Input
1654
+ }], autoFocus: [{
1655
+ type: Input
1656
+ }], custom: [{
1657
+ type: Input
1658
+ }], hideRecent: [{
1659
+ type: Input
1660
+ }], imageUrlFn: [{
1661
+ type: Input
1662
+ }], include: [{
1663
+ type: Input
1664
+ }], exclude: [{
1665
+ type: Input
1666
+ }], notFoundEmoji: [{
1667
+ type: Input
1668
+ }], categoriesIcons: [{
1669
+ type: Input
1670
+ }], searchIcons: [{
1671
+ type: Input
1672
+ }], useButton: [{
1673
+ type: Input
1674
+ }], enableFrequentEmojiSort: [{
1675
+ type: Input
1676
+ }], enableSearch: [{
1677
+ type: Input
1678
+ }], showSingleCategory: [{
1679
+ type: Input
1680
+ }], virtualize: [{
1681
+ type: Input
1682
+ }], virtualizeOffset: [{
1683
+ type: Input
1684
+ }], recent: [{
1685
+ type: Input
1686
+ }], emojiClick: [{
1687
+ type: Output
1688
+ }], emojiSelect: [{
1689
+ type: Output
1690
+ }], skinChange: [{
1691
+ type: Output
1692
+ }], scrollRef: [{
1693
+ type: ViewChild,
1694
+ args: ['scrollRef', { static: true }]
1695
+ }], previewRef: [{
1696
+ type: ViewChild,
1697
+ args: [PreviewComponent, { static: false }]
1698
+ }], searchRef: [{
1699
+ type: ViewChild,
1700
+ args: [SearchComponent, { static: false }]
1701
+ }], categoryRefs: [{
1702
+ type: ViewChildren,
1703
+ args: [CategoryComponent]
1704
+ }], backgroundImageFn: [{
1705
+ type: Input
1706
+ }] } });
1707
+
1708
+ class PickerModule {
1709
+ }
1710
+ PickerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: PickerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1711
+ PickerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: PickerModule, declarations: [PickerComponent,
1712
+ AnchorsComponent,
1713
+ CategoryComponent,
1714
+ SearchComponent,
1715
+ PreviewComponent,
1716
+ SkinComponent], imports: [CommonModule, FormsModule, EmojiModule], exports: [PickerComponent,
1717
+ AnchorsComponent,
1718
+ CategoryComponent,
1719
+ SearchComponent,
1720
+ PreviewComponent,
1721
+ SkinComponent] });
1722
+ PickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: PickerModule, imports: [[CommonModule, FormsModule, EmojiModule]] });
1723
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: PickerModule, decorators: [{
1724
+ type: NgModule,
1725
+ args: [{
1726
+ imports: [CommonModule, FormsModule, EmojiModule],
1727
+ exports: [
1728
+ PickerComponent,
1729
+ AnchorsComponent,
1730
+ CategoryComponent,
1731
+ SearchComponent,
1732
+ PreviewComponent,
1733
+ SkinComponent,
1734
+ ],
1735
+ declarations: [
1736
+ PickerComponent,
1737
+ AnchorsComponent,
1738
+ CategoryComponent,
1739
+ SearchComponent,
1740
+ PreviewComponent,
1741
+ SkinComponent,
1742
+ ],
1743
+ }]
1744
+ }] });
1745
+
1746
+ /**
1747
+ * Generated bundle index. Do not edit.
1748
+ */
1749
+
1750
+ export { AnchorsComponent, CategoryComponent, EmojiFrequentlyService, EmojiSearch, PickerComponent, PickerModule, PreviewComponent, SearchComponent, SkinComponent };
1751
+ //# sourceMappingURL=ctrl-ngx-emoji-mart.mjs.map