@ctrl/ngx-emoji-mart 8.1.0 → 9.0.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 (54) hide show
  1. package/README.md +39 -14
  2. package/anchors.component.d.ts +1 -1
  3. package/category.component.d.ts +3 -3
  4. package/esm2022/anchors.component.mjs +100 -0
  5. package/esm2022/category.component.mjs +409 -0
  6. package/esm2022/emoji-frequently.service.mjs +90 -0
  7. package/esm2022/emoji-search.service.mjs +178 -0
  8. package/esm2022/ngx-emoji/emoji.component.mjs +299 -0
  9. package/esm2022/ngx-emoji/emoji.module.mjs +17 -0
  10. package/esm2022/ngx-emoji/emoji.service.mjs +145 -0
  11. package/esm2022/picker.component.mjs +522 -0
  12. package/esm2022/picker.module.mjs +40 -0
  13. package/esm2022/preview.component.mjs +206 -0
  14. package/esm2022/search.component.mjs +175 -0
  15. package/esm2022/skins.component.mjs +107 -0
  16. package/{fesm2020 → fesm2022}/ctrl-ngx-emoji-mart-ngx-emoji.mjs +81 -68
  17. package/{fesm2020 → fesm2022}/ctrl-ngx-emoji-mart-ngx-emoji.mjs.map +1 -1
  18. package/{fesm2020 → fesm2022}/ctrl-ngx-emoji-mart.mjs +327 -261
  19. package/fesm2022/ctrl-ngx-emoji-mart.mjs.map +1 -0
  20. package/ngx-emoji/emoji.component.d.ts +10 -9
  21. package/ngx-emoji/emoji.module.d.ts +1 -2
  22. package/package.json +8 -16
  23. package/picker.component.d.ts +2 -2
  24. package/picker.module.d.ts +1 -4
  25. package/preview.component.d.ts +2 -2
  26. package/search.component.d.ts +1 -1
  27. package/skins.component.d.ts +2 -2
  28. package/esm2020/anchors.component.mjs +0 -83
  29. package/esm2020/category.component.mjs +0 -386
  30. package/esm2020/emoji-frequently.service.mjs +0 -88
  31. package/esm2020/emoji-search.service.mjs +0 -177
  32. package/esm2020/ngx-emoji/emoji.component.mjs +0 -283
  33. package/esm2020/ngx-emoji/emoji.module.mjs +0 -18
  34. package/esm2020/ngx-emoji/emoji.service.mjs +0 -144
  35. package/esm2020/picker.component.mjs +0 -508
  36. package/esm2020/picker.module.mjs +0 -49
  37. package/esm2020/preview.component.mjs +0 -187
  38. package/esm2020/search.component.mjs +0 -165
  39. package/esm2020/skins.component.mjs +0 -108
  40. package/fesm2015/ctrl-ngx-emoji-mart-ngx-emoji.mjs +0 -34325
  41. package/fesm2015/ctrl-ngx-emoji-mart-ngx-emoji.mjs.map +0 -1
  42. package/fesm2015/ctrl-ngx-emoji-mart.mjs +0 -1763
  43. package/fesm2015/ctrl-ngx-emoji-mart.mjs.map +0 -1
  44. package/fesm2020/ctrl-ngx-emoji-mart.mjs.map +0 -1
  45. /package/{esm2020 → esm2022}/ctrl-ngx-emoji-mart.mjs +0 -0
  46. /package/{esm2020 → esm2022}/ngx-emoji/ctrl-ngx-emoji-mart-ngx-emoji.mjs +0 -0
  47. /package/{esm2020 → esm2022}/ngx-emoji/data/categories.mjs +0 -0
  48. /package/{esm2020 → esm2022}/ngx-emoji/data/data.interfaces.mjs +0 -0
  49. /package/{esm2020 → esm2022}/ngx-emoji/data/emojis.mjs +0 -0
  50. /package/{esm2020 → esm2022}/ngx-emoji/data/skins.mjs +0 -0
  51. /package/{esm2020 → esm2022}/ngx-emoji/index.mjs +0 -0
  52. /package/{esm2020 → esm2022}/public_api.mjs +0 -0
  53. /package/{esm2020 → esm2022}/svgs/index.mjs +0 -0
  54. /package/{esm2020 → esm2022}/utils/index.mjs +0 -0
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, EventEmitter, inject, NgZone, Component, ChangeDetectionStrategy, Input, Output, ViewChild, NgModule } from '@angular/core';
3
- import { Subject, switchMap, fromEvent, EMPTY, takeUntil } from 'rxjs';
4
3
  import * as i1 from '@angular/common';
5
4
  import { CommonModule } from '@angular/common';
5
+ import { Subject, switchMap, fromEvent, EMPTY, takeUntil } from 'rxjs';
6
6
 
7
7
  const categories = [
8
8
  {
@@ -33896,10 +33896,10 @@ const COLONS_REGEX = /^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/;
33896
33896
  const SKINS = ['1F3FA', '1F3FB', '1F3FC', '1F3FD', '1F3FE', '1F3FF'];
33897
33897
  const DEFAULT_BACKGROUNDFN = (set, sheetSize) => `https://unpkg.com/emoji-datasource-${set}@6.0.1/img/${set}/sheets-256/${sheetSize}.png`;
33898
33898
  class EmojiService {
33899
+ uncompressed = false;
33900
+ names = {};
33901
+ emojis = [];
33899
33902
  constructor() {
33900
- this.uncompressed = false;
33901
- this.names = {};
33902
- this.emojis = [];
33903
33903
  if (!this.uncompressed) {
33904
33904
  this.uncompress(emojis);
33905
33905
  this.uncompressed = true;
@@ -34025,57 +34025,66 @@ class EmojiService {
34025
34025
  getSanitizedData(emoji, skin, set) {
34026
34026
  return this.sanitize(this.getData(emoji, skin, set));
34027
34027
  }
34028
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: EmojiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
34029
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: EmojiService, providedIn: 'root' });
34028
34030
  }
34029
- EmojiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
34030
- EmojiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiService, providedIn: 'root' });
34031
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiService, decorators: [{
34031
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: EmojiService, decorators: [{
34032
34032
  type: Injectable,
34033
34033
  args: [{ providedIn: 'root' }]
34034
34034
  }], ctorParameters: function () { return []; } });
34035
34035
 
34036
34036
  class EmojiComponent {
34037
+ skin = 1;
34038
+ set = 'apple';
34039
+ sheetSize = 64;
34040
+ /** Renders the native unicode emoji */
34041
+ isNative = false;
34042
+ forceSize = false;
34043
+ tooltip = false;
34044
+ size = 24;
34045
+ emoji = '';
34046
+ fallback;
34047
+ hideObsolete = false;
34048
+ sheetRows;
34049
+ sheetColumns;
34050
+ useButton;
34051
+ emojiClick = new EventEmitter();
34052
+ /**
34053
+ * Note: `emojiOver` and `emojiOverOutsideAngular` are dispatched on the same event (`mouseenter`), but
34054
+ * for different purposes. The `emojiOverOutsideAngular` event is listened only in `emoji-category`
34055
+ * component and the category component doesn't care about zone context the callback is being called in.
34056
+ * The `emojiOver` is for backwards compatibility if anyone is listening to this event explicitly in their code.
34057
+ */
34058
+ emojiOver = new EventEmitter();
34059
+ emojiOverOutsideAngular = new EventEmitter();
34060
+ /** See comments above, this serves the same purpose. */
34061
+ emojiLeave = new EventEmitter();
34062
+ emojiLeaveOutsideAngular = new EventEmitter();
34063
+ style;
34064
+ title = undefined;
34065
+ label = '';
34066
+ unified;
34067
+ custom = false;
34068
+ isVisible = true;
34069
+ // TODO: replace 4.0.3 w/ dynamic get verison from emoji-datasource in package.json
34070
+ backgroundImageFn = DEFAULT_BACKGROUNDFN;
34071
+ imageUrlFn;
34037
34072
  set button(button) {
34038
34073
  // Note: `runOutsideAngular` is used to trigger `addEventListener` outside of the Angular zone
34039
34074
  // too. See `setupMouseEnterListener`. The `switchMap` will subscribe to `fromEvent` considering
34040
34075
  // the context where the factory is called in.
34041
34076
  this.ngZone.runOutsideAngular(() => this.button$.next(button?.nativeElement));
34042
34077
  }
34078
+ /**
34079
+ * The subject used to emit whenever view queries are run and `button` or `span` is set/removed.
34080
+ * We use subject to keep the reactive behavior so we don't have to add and remove event listeners manually.
34081
+ */
34082
+ button$ = new Subject();
34083
+ destroy$ = new Subject();
34084
+ ngZone = inject(NgZone);
34085
+ emojiService = inject(EmojiService);
34043
34086
  constructor() {
34044
- this.skin = 1;
34045
- this.set = 'apple';
34046
- this.sheetSize = 64;
34047
- /** Renders the native unicode emoji */
34048
- this.isNative = false;
34049
- this.forceSize = false;
34050
- this.tooltip = false;
34051
- this.size = 24;
34052
- this.emoji = '';
34053
- this.hideObsolete = false;
34054
- this.emojiOver = new EventEmitter();
34055
- /**
34056
- * Note: `emojiLeave` and `emojiLeaveOutsideAngular` are dispatched on the same event, but for different
34057
- * purposes. The `emojiLeaveOutsideAngular` would be set up in category component so we don't care
34058
- * about zone context the callback is being called in. The `emojiLeave` is for backwards compatibility
34059
- * if anyone is listening to this event explicitly in their code.
34060
- */
34061
- this.emojiLeave = new EventEmitter();
34062
- this.emojiLeaveOutsideAngular = new EventEmitter();
34063
- this.emojiClick = new EventEmitter();
34064
- this.title = undefined;
34065
- this.label = '';
34066
- this.custom = false;
34067
- this.isVisible = true;
34068
- // TODO: replace 4.0.3 w/ dynamic get verison from emoji-datasource in package.json
34069
- this.backgroundImageFn = DEFAULT_BACKGROUNDFN;
34070
- /**
34071
- * The subject used to emit whenever view queries are run and `button` or `span` is set/removed.
34072
- * We use subject to keep the reactive behavior so we don't have to add and remove event listeners manually.
34073
- */
34074
- this.button$ = new Subject();
34075
- this.destroy$ = new Subject();
34076
- this.ngZone = inject(NgZone);
34077
- this.emojiService = inject(EmojiService);
34078
- this.setupMouseLeaveListener();
34087
+ this.setupMouseListeners();
34079
34088
  }
34080
34089
  ngOnChanges() {
34081
34090
  if (!this.emoji) {
@@ -34161,16 +34170,21 @@ class EmojiComponent {
34161
34170
  const emoji = this.getSanitizedData();
34162
34171
  this.emojiClick.emit({ emoji, $event });
34163
34172
  }
34164
- handleOver($event) {
34165
- const emoji = this.getSanitizedData();
34166
- this.emojiOver.emit({ emoji, $event });
34167
- }
34168
- setupMouseLeaveListener() {
34169
- this.button$
34170
- .pipe(
34173
+ setupMouseListeners() {
34174
+ const eventListener$ = (eventName) => this.button$.pipe(
34171
34175
  // Note: `EMPTY` is used to remove event listener once the DOM node is removed.
34172
- switchMap(button => (button ? fromEvent(button, 'mouseleave') : EMPTY)), takeUntil(this.destroy$))
34173
- .subscribe($event => {
34176
+ switchMap(button => (button ? fromEvent(button, eventName) : EMPTY)), takeUntil(this.destroy$));
34177
+ eventListener$('mouseenter').subscribe($event => {
34178
+ const emoji = this.getSanitizedData();
34179
+ this.emojiOverOutsideAngular.emit({ emoji, $event });
34180
+ // Note: this is done for backwards compatibility. We run change detection if developers
34181
+ // are listening to `emojiOver` in their code. For instance:
34182
+ // `<ngx-emoji (emojiOver)="..."></ngx-emoji>`.
34183
+ if (this.emojiOver.observed) {
34184
+ this.ngZone.run(() => this.emojiOver.emit({ emoji, $event }));
34185
+ }
34186
+ });
34187
+ eventListener$('mouseleave').subscribe($event => {
34174
34188
  const emoji = this.getSanitizedData();
34175
34189
  this.emojiLeaveOutsideAngular.emit({ emoji, $event });
34176
34190
  // Note: this is done for backwards compatibility. We run change detection if developers
@@ -34181,16 +34195,14 @@ class EmojiComponent {
34181
34195
  }
34182
34196
  });
34183
34197
  }
34184
- }
34185
- EmojiComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
34186
- EmojiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.8", type: EmojiComponent, selector: "ngx-emoji", inputs: { skin: "skin", set: "set", sheetSize: "sheetSize", isNative: "isNative", forceSize: "forceSize", tooltip: "tooltip", size: "size", emoji: "emoji", fallback: "fallback", hideObsolete: "hideObsolete", sheetRows: "sheetRows", sheetColumns: "sheetColumns", useButton: "useButton", backgroundImageFn: "backgroundImageFn", imageUrlFn: "imageUrlFn" }, outputs: { emojiOver: "emojiOver", emojiLeave: "emojiLeave", emojiLeaveOutsideAngular: "emojiLeaveOutsideAngular", emojiClick: "emojiClick" }, viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
34198
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: EmojiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
34199
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: EmojiComponent, isStandalone: true, selector: "ngx-emoji", inputs: { skin: "skin", set: "set", sheetSize: "sheetSize", isNative: "isNative", forceSize: "forceSize", tooltip: "tooltip", size: "size", emoji: "emoji", fallback: "fallback", hideObsolete: "hideObsolete", sheetRows: "sheetRows", sheetColumns: "sheetColumns", useButton: "useButton", backgroundImageFn: "backgroundImageFn", imageUrlFn: "imageUrlFn" }, outputs: { emojiClick: "emojiClick", emojiOver: "emojiOver", emojiOverOutsideAngular: "emojiOverOutsideAngular", emojiLeave: "emojiLeave", emojiLeaveOutsideAngular: "emojiLeaveOutsideAngular" }, viewQueries: [{ propertyName: "button", first: true, predicate: ["button"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
34187
34200
  <ng-template [ngIf]="isVisible">
34188
34201
  <button
34189
34202
  *ngIf="useButton; else spanTpl"
34190
34203
  #button
34191
34204
  type="button"
34192
34205
  (click)="handleClick($event)"
34193
- (mouseenter)="handleOver($event)"
34194
34206
  [attr.title]="title"
34195
34207
  [attr.aria-label]="label"
34196
34208
  class="emoji-mart-emoji"
@@ -34208,7 +34220,6 @@ EmojiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version
34208
34220
  <span
34209
34221
  #button
34210
34222
  (click)="handleClick($event)"
34211
- (mouseenter)="handleOver($event)"
34212
34223
  [attr.title]="title"
34213
34224
  [attr.aria-label]="label"
34214
34225
  class="emoji-mart-emoji"
@@ -34221,8 +34232,9 @@ EmojiComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version
34221
34232
  </span>
34222
34233
  </span>
34223
34234
  </ng-template>
34224
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
34225
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiComponent, decorators: [{
34235
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
34236
+ }
34237
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: EmojiComponent, decorators: [{
34226
34238
  type: Component,
34227
34239
  args: [{
34228
34240
  selector: 'ngx-emoji',
@@ -34233,7 +34245,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
34233
34245
  #button
34234
34246
  type="button"
34235
34247
  (click)="handleClick($event)"
34236
- (mouseenter)="handleOver($event)"
34237
34248
  [attr.title]="title"
34238
34249
  [attr.aria-label]="label"
34239
34250
  class="emoji-mart-emoji"
@@ -34251,7 +34262,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
34251
34262
  <span
34252
34263
  #button
34253
34264
  (click)="handleClick($event)"
34254
- (mouseenter)="handleOver($event)"
34255
34265
  [attr.title]="title"
34256
34266
  [attr.aria-label]="label"
34257
34267
  class="emoji-mart-emoji"
@@ -34267,6 +34277,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
34267
34277
  `,
34268
34278
  changeDetection: ChangeDetectionStrategy.OnPush,
34269
34279
  preserveWhitespaces: false,
34280
+ standalone: true,
34281
+ imports: [CommonModule],
34270
34282
  }]
34271
34283
  }], ctorParameters: function () { return []; }, propDecorators: { skin: [{
34272
34284
  type: Input
@@ -34294,14 +34306,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
34294
34306
  type: Input
34295
34307
  }], useButton: [{
34296
34308
  type: Input
34309
+ }], emojiClick: [{
34310
+ type: Output
34297
34311
  }], emojiOver: [{
34298
34312
  type: Output
34313
+ }], emojiOverOutsideAngular: [{
34314
+ type: Output
34299
34315
  }], emojiLeave: [{
34300
34316
  type: Output
34301
34317
  }], emojiLeaveOutsideAngular: [{
34302
34318
  type: Output
34303
- }], emojiClick: [{
34304
- type: Output
34305
34319
  }], backgroundImageFn: [{
34306
34320
  type: Input
34307
34321
  }], imageUrlFn: [{
@@ -34312,16 +34326,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
34312
34326
  }] } });
34313
34327
 
34314
34328
  class EmojiModule {
34329
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: EmojiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
34330
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: EmojiModule, imports: [EmojiComponent], exports: [EmojiComponent] });
34331
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: EmojiModule, imports: [EmojiComponent] });
34315
34332
  }
34316
- EmojiModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
34317
- EmojiModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.8", ngImport: i0, type: EmojiModule, declarations: [EmojiComponent], imports: [CommonModule], exports: [EmojiComponent] });
34318
- EmojiModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiModule, imports: [CommonModule] });
34319
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: EmojiModule, decorators: [{
34333
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: EmojiModule, decorators: [{
34320
34334
  type: NgModule,
34321
34335
  args: [{
34322
- imports: [CommonModule],
34336
+ imports: [EmojiComponent],
34323
34337
  exports: [EmojiComponent],
34324
- declarations: [EmojiComponent],
34325
34338
  }]
34326
34339
  }] });
34327
34340