@ctrl/ngx-emoji-mart 5.1.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.
- package/README.md +11 -19
- package/anchors.component.d.ts +3 -0
- package/category.component.d.ts +7 -2
- package/ctrl-ngx-emoji-mart.d.ts +1 -0
- package/emoji-frequently.service.d.ts +3 -0
- package/emoji-search.service.d.ts +3 -0
- package/esm2020/anchors.component.mjs +83 -0
- package/esm2020/category.component.mjs +386 -0
- package/{esm2015/ctrl-ngx-emoji-mart.js → esm2020/ctrl-ngx-emoji-mart.mjs} +0 -0
- package/{esm2015/emoji-frequently.service.js → esm2020/emoji-frequently.service.mjs} +10 -8
- package/esm2020/emoji-search.service.mjs +177 -0
- package/{esm2015/ngx-emoji/ctrl-ngx-emoji-mart-ngx-emoji.js → esm2020/ngx-emoji/ctrl-ngx-emoji-mart-ngx-emoji.mjs} +0 -0
- package/{esm2015/ngx-emoji/data/categories.js → esm2020/ngx-emoji/data/categories.mjs} +4 -4
- package/{esm2015/ngx-emoji/data/data.interfaces.js → esm2020/ngx-emoji/data/data.interfaces.mjs} +0 -0
- package/esm2020/ngx-emoji/data/emojis.mjs +29543 -0
- package/{esm2015/ngx-emoji/data/skins.js → esm2020/ngx-emoji/data/skins.mjs} +0 -0
- package/esm2020/ngx-emoji/emoji.component.mjs +236 -0
- package/esm2020/ngx-emoji/emoji.module.mjs +18 -0
- package/esm2020/ngx-emoji/emoji.service.mjs +144 -0
- package/{esm2015/ngx-emoji/index.js → esm2020/ngx-emoji/index.mjs} +0 -0
- package/esm2020/picker.component.mjs +505 -0
- package/esm2020/picker.module.mjs +49 -0
- package/esm2020/preview.component.mjs +181 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/esm2020/search.component.mjs +165 -0
- package/esm2020/skins.component.mjs +108 -0
- package/esm2020/svgs/index.mjs +18 -0
- package/{esm2015/utils/index.js → esm2020/utils/index.mjs} +0 -0
- package/fesm2015/{ctrl-ngx-emoji-mart-ngx-emoji.js → ctrl-ngx-emoji-mart-ngx-emoji.mjs} +24809 -18497
- package/fesm2015/ctrl-ngx-emoji-mart-ngx-emoji.mjs.map +1 -0
- package/fesm2015/{ctrl-ngx-emoji-mart.js → ctrl-ngx-emoji-mart.mjs} +666 -325
- package/fesm2015/ctrl-ngx-emoji-mart.mjs.map +1 -0
- package/fesm2020/ctrl-ngx-emoji-mart-ngx-emoji.mjs +31829 -0
- package/fesm2020/ctrl-ngx-emoji-mart-ngx-emoji.mjs.map +1 -0
- package/fesm2020/ctrl-ngx-emoji-mart.mjs +1751 -0
- package/fesm2020/ctrl-ngx-emoji-mart.mjs.map +1 -0
- package/ngx-emoji/ctrl-ngx-emoji-mart-ngx-emoji.d.ts +1 -0
- package/ngx-emoji/emoji.component.d.ts +3 -0
- package/ngx-emoji/emoji.module.d.ts +6 -0
- package/ngx-emoji/emoji.service.d.ts +3 -0
- package/ngx-emoji/package.json +6 -7
- package/package.json +29 -10
- package/picker.component.d.ts +3 -0
- package/picker.module.d.ts +13 -0
- package/preview.component.d.ts +4 -1
- package/search.component.d.ts +3 -0
- package/skins.component.d.ts +6 -3
- package/bundles/ctrl-ngx-emoji-mart-ngx-emoji.umd.js +0 -25819
- package/bundles/ctrl-ngx-emoji-mart-ngx-emoji.umd.js.map +0 -1
- package/bundles/ctrl-ngx-emoji-mart-ngx-emoji.umd.min.js +0 -2
- package/bundles/ctrl-ngx-emoji-mart-ngx-emoji.umd.min.js.map +0 -1
- package/bundles/ctrl-ngx-emoji-mart.umd.js +0 -1692
- package/bundles/ctrl-ngx-emoji-mart.umd.js.map +0 -1
- package/bundles/ctrl-ngx-emoji-mart.umd.min.js +0 -2
- package/bundles/ctrl-ngx-emoji-mart.umd.min.js.map +0 -1
- package/ctrl-ngx-emoji-mart.metadata.json +0 -1
- package/esm2015/anchors.component.js +0 -54
- package/esm2015/category.component.js +0 -275
- package/esm2015/emoji-search.service.js +0 -179
- package/esm2015/ngx-emoji/data/emojis.js +0 -23289
- package/esm2015/ngx-emoji/emoji.component.js +0 -174
- package/esm2015/ngx-emoji/emoji.module.js +0 -13
- package/esm2015/ngx-emoji/emoji.service.js +0 -143
- package/esm2015/picker.component.js +0 -459
- package/esm2015/picker.module.js +0 -34
- package/esm2015/preview.component.js +0 -113
- package/esm2015/search.component.js +0 -115
- package/esm2015/skins.component.js +0 -76
- package/esm2015/svgs/index.js +0 -18
- package/fesm2015/ctrl-ngx-emoji-mart-ngx-emoji.js.map +0 -1
- package/fesm2015/ctrl-ngx-emoji-mart.js.map +0 -1
- package/ngx-emoji/ctrl-ngx-emoji-mart-ngx-emoji.metadata.json +0 -1
@@ -1,1692 +0,0 @@
|
|
1
|
-
(function (global, factory) {
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ctrl/ngx-emoji-mart/ngx-emoji'), require('rxjs'), require('@angular/common'), require('@angular/forms')) :
|
3
|
-
typeof define === 'function' && define.amd ? define('@ctrl/ngx-emoji-mart', ['exports', '@angular/core', '@ctrl/ngx-emoji-mart/ngx-emoji', 'rxjs', '@angular/common', '@angular/forms'], factory) :
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ctrl = global.ctrl || {}, global.ctrl['ngx-emoji-mart'] = {}), global.ng.core, global.ctrl['ngx-emoji-mart']['ngx-emoji'], global.rxjs, global.ng.common, global.ng.forms));
|
5
|
-
}(this, (function (exports, i0, i1, rxjs, common, forms) { 'use strict';
|
6
|
-
|
7
|
-
var AnchorsComponent = /** @class */ (function () {
|
8
|
-
function AnchorsComponent() {
|
9
|
-
this.categories = [];
|
10
|
-
this.icons = {};
|
11
|
-
this.anchorClick = new i0.EventEmitter();
|
12
|
-
}
|
13
|
-
AnchorsComponent.prototype.trackByFn = function (idx, cat) {
|
14
|
-
return cat.id;
|
15
|
-
};
|
16
|
-
AnchorsComponent.prototype.handleClick = function ($event, index) {
|
17
|
-
this.anchorClick.emit({
|
18
|
-
category: this.categories[index],
|
19
|
-
index: index,
|
20
|
-
});
|
21
|
-
};
|
22
|
-
return AnchorsComponent;
|
23
|
-
}());
|
24
|
-
AnchorsComponent.decorators = [
|
25
|
-
{ type: i0.Component, args: [{
|
26
|
-
selector: 'emoji-mart-anchors',
|
27
|
-
template: "\n <div class=\"emoji-mart-anchors\">\n <ng-template ngFor let-category [ngForOf]=\"categories\" let-idx=\"index\" [ngForTrackBy]=\"trackByFn\">\n <span\n *ngIf=\"category.anchor !== false\"\n [attr.title]=\"i18n.categories[category.id]\"\n (click)=\"this.handleClick($event, idx)\"\n class=\"emoji-mart-anchor\"\n [class.emoji-mart-anchor-selected]=\"category.name === selected\"\n [style.color]=\"category.name === selected ? color : null\"\n >\n <div>\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" width=\"24\" height=\"24\">\n <path [attr.d]=\"icons[category.id]\" />\n </svg>\n </div>\n <span class=\"emoji-mart-anchor-bar\" [style.background-color]=\"color\"></span>\n </span>\n </ng-template>\n </div>\n ",
|
28
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
29
|
-
preserveWhitespaces: false
|
30
|
-
},] }
|
31
|
-
];
|
32
|
-
AnchorsComponent.propDecorators = {
|
33
|
-
categories: [{ type: i0.Input }],
|
34
|
-
color: [{ type: i0.Input }],
|
35
|
-
selected: [{ type: i0.Input }],
|
36
|
-
i18n: [{ type: i0.Input }],
|
37
|
-
icons: [{ type: i0.Input }],
|
38
|
-
anchorClick: [{ type: i0.Output }]
|
39
|
-
};
|
40
|
-
|
41
|
-
/*! *****************************************************************************
|
42
|
-
Copyright (c) Microsoft Corporation.
|
43
|
-
|
44
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
45
|
-
purpose with or without fee is hereby granted.
|
46
|
-
|
47
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
48
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
49
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
50
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
51
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
52
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
53
|
-
PERFORMANCE OF THIS SOFTWARE.
|
54
|
-
***************************************************************************** */
|
55
|
-
/* global Reflect, Promise */
|
56
|
-
var extendStatics = function (d, b) {
|
57
|
-
extendStatics = Object.setPrototypeOf ||
|
58
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
59
|
-
function (d, b) { for (var p in b)
|
60
|
-
if (Object.prototype.hasOwnProperty.call(b, p))
|
61
|
-
d[p] = b[p]; };
|
62
|
-
return extendStatics(d, b);
|
63
|
-
};
|
64
|
-
function __extends(d, b) {
|
65
|
-
if (typeof b !== "function" && b !== null)
|
66
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
67
|
-
extendStatics(d, b);
|
68
|
-
function __() { this.constructor = d; }
|
69
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
70
|
-
}
|
71
|
-
var __assign = function () {
|
72
|
-
__assign = Object.assign || function __assign(t) {
|
73
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
74
|
-
s = arguments[i];
|
75
|
-
for (var p in s)
|
76
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
77
|
-
t[p] = s[p];
|
78
|
-
}
|
79
|
-
return t;
|
80
|
-
};
|
81
|
-
return __assign.apply(this, arguments);
|
82
|
-
};
|
83
|
-
function __rest(s, e) {
|
84
|
-
var t = {};
|
85
|
-
for (var p in s)
|
86
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
87
|
-
t[p] = s[p];
|
88
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
89
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
90
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
91
|
-
t[p[i]] = s[p[i]];
|
92
|
-
}
|
93
|
-
return t;
|
94
|
-
}
|
95
|
-
function __decorate(decorators, target, key, desc) {
|
96
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
97
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
98
|
-
r = Reflect.decorate(decorators, target, key, desc);
|
99
|
-
else
|
100
|
-
for (var i = decorators.length - 1; i >= 0; i--)
|
101
|
-
if (d = decorators[i])
|
102
|
-
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
103
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
104
|
-
}
|
105
|
-
function __param(paramIndex, decorator) {
|
106
|
-
return function (target, key) { decorator(target, key, paramIndex); };
|
107
|
-
}
|
108
|
-
function __metadata(metadataKey, metadataValue) {
|
109
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
110
|
-
return Reflect.metadata(metadataKey, metadataValue);
|
111
|
-
}
|
112
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
113
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
114
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
115
|
-
function fulfilled(value) { try {
|
116
|
-
step(generator.next(value));
|
117
|
-
}
|
118
|
-
catch (e) {
|
119
|
-
reject(e);
|
120
|
-
} }
|
121
|
-
function rejected(value) { try {
|
122
|
-
step(generator["throw"](value));
|
123
|
-
}
|
124
|
-
catch (e) {
|
125
|
-
reject(e);
|
126
|
-
} }
|
127
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
128
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
129
|
-
});
|
130
|
-
}
|
131
|
-
function __generator(thisArg, body) {
|
132
|
-
var _ = { label: 0, sent: function () { if (t[0] & 1)
|
133
|
-
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
134
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
|
135
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
136
|
-
function step(op) {
|
137
|
-
if (f)
|
138
|
-
throw new TypeError("Generator is already executing.");
|
139
|
-
while (_)
|
140
|
-
try {
|
141
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
142
|
-
return t;
|
143
|
-
if (y = 0, t)
|
144
|
-
op = [op[0] & 2, t.value];
|
145
|
-
switch (op[0]) {
|
146
|
-
case 0:
|
147
|
-
case 1:
|
148
|
-
t = op;
|
149
|
-
break;
|
150
|
-
case 4:
|
151
|
-
_.label++;
|
152
|
-
return { value: op[1], done: false };
|
153
|
-
case 5:
|
154
|
-
_.label++;
|
155
|
-
y = op[1];
|
156
|
-
op = [0];
|
157
|
-
continue;
|
158
|
-
case 7:
|
159
|
-
op = _.ops.pop();
|
160
|
-
_.trys.pop();
|
161
|
-
continue;
|
162
|
-
default:
|
163
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
164
|
-
_ = 0;
|
165
|
-
continue;
|
166
|
-
}
|
167
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
|
168
|
-
_.label = op[1];
|
169
|
-
break;
|
170
|
-
}
|
171
|
-
if (op[0] === 6 && _.label < t[1]) {
|
172
|
-
_.label = t[1];
|
173
|
-
t = op;
|
174
|
-
break;
|
175
|
-
}
|
176
|
-
if (t && _.label < t[2]) {
|
177
|
-
_.label = t[2];
|
178
|
-
_.ops.push(op);
|
179
|
-
break;
|
180
|
-
}
|
181
|
-
if (t[2])
|
182
|
-
_.ops.pop();
|
183
|
-
_.trys.pop();
|
184
|
-
continue;
|
185
|
-
}
|
186
|
-
op = body.call(thisArg, _);
|
187
|
-
}
|
188
|
-
catch (e) {
|
189
|
-
op = [6, e];
|
190
|
-
y = 0;
|
191
|
-
}
|
192
|
-
finally {
|
193
|
-
f = t = 0;
|
194
|
-
}
|
195
|
-
if (op[0] & 5)
|
196
|
-
throw op[1];
|
197
|
-
return { value: op[0] ? op[1] : void 0, done: true };
|
198
|
-
}
|
199
|
-
}
|
200
|
-
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
201
|
-
if (k2 === undefined)
|
202
|
-
k2 = k;
|
203
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
204
|
-
}) : (function (o, m, k, k2) {
|
205
|
-
if (k2 === undefined)
|
206
|
-
k2 = k;
|
207
|
-
o[k2] = m[k];
|
208
|
-
});
|
209
|
-
function __exportStar(m, o) {
|
210
|
-
for (var p in m)
|
211
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
|
212
|
-
__createBinding(o, m, p);
|
213
|
-
}
|
214
|
-
function __values(o) {
|
215
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
216
|
-
if (m)
|
217
|
-
return m.call(o);
|
218
|
-
if (o && typeof o.length === "number")
|
219
|
-
return {
|
220
|
-
next: function () {
|
221
|
-
if (o && i >= o.length)
|
222
|
-
o = void 0;
|
223
|
-
return { value: o && o[i++], done: !o };
|
224
|
-
}
|
225
|
-
};
|
226
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
227
|
-
}
|
228
|
-
function __read(o, n) {
|
229
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
230
|
-
if (!m)
|
231
|
-
return o;
|
232
|
-
var i = m.call(o), r, ar = [], e;
|
233
|
-
try {
|
234
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
|
235
|
-
ar.push(r.value);
|
236
|
-
}
|
237
|
-
catch (error) {
|
238
|
-
e = { error: error };
|
239
|
-
}
|
240
|
-
finally {
|
241
|
-
try {
|
242
|
-
if (r && !r.done && (m = i["return"]))
|
243
|
-
m.call(i);
|
244
|
-
}
|
245
|
-
finally {
|
246
|
-
if (e)
|
247
|
-
throw e.error;
|
248
|
-
}
|
249
|
-
}
|
250
|
-
return ar;
|
251
|
-
}
|
252
|
-
/** @deprecated */
|
253
|
-
function __spread() {
|
254
|
-
for (var ar = [], i = 0; i < arguments.length; i++)
|
255
|
-
ar = ar.concat(__read(arguments[i]));
|
256
|
-
return ar;
|
257
|
-
}
|
258
|
-
/** @deprecated */
|
259
|
-
function __spreadArrays() {
|
260
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
|
261
|
-
s += arguments[i].length;
|
262
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
263
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
264
|
-
r[k] = a[j];
|
265
|
-
return r;
|
266
|
-
}
|
267
|
-
function __spreadArray(to, from) {
|
268
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
269
|
-
to[j] = from[i];
|
270
|
-
return to;
|
271
|
-
}
|
272
|
-
function __await(v) {
|
273
|
-
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
274
|
-
}
|
275
|
-
function __asyncGenerator(thisArg, _arguments, generator) {
|
276
|
-
if (!Symbol.asyncIterator)
|
277
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
278
|
-
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
279
|
-
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
280
|
-
function verb(n) { if (g[n])
|
281
|
-
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
282
|
-
function resume(n, v) { try {
|
283
|
-
step(g[n](v));
|
284
|
-
}
|
285
|
-
catch (e) {
|
286
|
-
settle(q[0][3], e);
|
287
|
-
} }
|
288
|
-
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
289
|
-
function fulfill(value) { resume("next", value); }
|
290
|
-
function reject(value) { resume("throw", value); }
|
291
|
-
function settle(f, v) { if (f(v), q.shift(), q.length)
|
292
|
-
resume(q[0][0], q[0][1]); }
|
293
|
-
}
|
294
|
-
function __asyncDelegator(o) {
|
295
|
-
var i, p;
|
296
|
-
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
297
|
-
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
298
|
-
}
|
299
|
-
function __asyncValues(o) {
|
300
|
-
if (!Symbol.asyncIterator)
|
301
|
-
throw new TypeError("Symbol.asyncIterator is not defined.");
|
302
|
-
var m = o[Symbol.asyncIterator], i;
|
303
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
304
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
305
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
|
306
|
-
}
|
307
|
-
function __makeTemplateObject(cooked, raw) {
|
308
|
-
if (Object.defineProperty) {
|
309
|
-
Object.defineProperty(cooked, "raw", { value: raw });
|
310
|
-
}
|
311
|
-
else {
|
312
|
-
cooked.raw = raw;
|
313
|
-
}
|
314
|
-
return cooked;
|
315
|
-
}
|
316
|
-
;
|
317
|
-
var __setModuleDefault = Object.create ? (function (o, v) {
|
318
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
319
|
-
}) : function (o, v) {
|
320
|
-
o["default"] = v;
|
321
|
-
};
|
322
|
-
function __importStar(mod) {
|
323
|
-
if (mod && mod.__esModule)
|
324
|
-
return mod;
|
325
|
-
var result = {};
|
326
|
-
if (mod != null)
|
327
|
-
for (var k in mod)
|
328
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
|
329
|
-
__createBinding(result, mod, k);
|
330
|
-
__setModuleDefault(result, mod);
|
331
|
-
return result;
|
332
|
-
}
|
333
|
-
function __importDefault(mod) {
|
334
|
-
return (mod && mod.__esModule) ? mod : { default: mod };
|
335
|
-
}
|
336
|
-
function __classPrivateFieldGet(receiver, privateMap) {
|
337
|
-
if (!privateMap.has(receiver)) {
|
338
|
-
throw new TypeError("attempted to get private field on non-instance");
|
339
|
-
}
|
340
|
-
return privateMap.get(receiver);
|
341
|
-
}
|
342
|
-
function __classPrivateFieldSet(receiver, privateMap, value) {
|
343
|
-
if (!privateMap.has(receiver)) {
|
344
|
-
throw new TypeError("attempted to set private field on non-instance");
|
345
|
-
}
|
346
|
-
privateMap.set(receiver, value);
|
347
|
-
return value;
|
348
|
-
}
|
349
|
-
|
350
|
-
var EmojiFrequentlyService = /** @class */ (function () {
|
351
|
-
function EmojiFrequentlyService(platformId) {
|
352
|
-
this.platformId = platformId;
|
353
|
-
this.NAMESPACE = 'emoji-mart';
|
354
|
-
this.frequently = null;
|
355
|
-
this.defaults = {};
|
356
|
-
this.initialized = false;
|
357
|
-
this.DEFAULTS = [
|
358
|
-
'+1',
|
359
|
-
'grinning',
|
360
|
-
'kissing_heart',
|
361
|
-
'heart_eyes',
|
362
|
-
'laughing',
|
363
|
-
'stuck_out_tongue_winking_eye',
|
364
|
-
'sweat_smile',
|
365
|
-
'joy',
|
366
|
-
'scream',
|
367
|
-
'disappointed',
|
368
|
-
'unamused',
|
369
|
-
'weary',
|
370
|
-
'sob',
|
371
|
-
'sunglasses',
|
372
|
-
'heart',
|
373
|
-
'poop',
|
374
|
-
];
|
375
|
-
}
|
376
|
-
EmojiFrequentlyService.prototype.init = function () {
|
377
|
-
this.frequently = JSON.parse((common.isPlatformBrowser(this.platformId) &&
|
378
|
-
localStorage.getItem(this.NAMESPACE + ".frequently")) ||
|
379
|
-
'null');
|
380
|
-
this.initialized = true;
|
381
|
-
};
|
382
|
-
EmojiFrequentlyService.prototype.add = function (emoji) {
|
383
|
-
if (!this.initialized) {
|
384
|
-
this.init();
|
385
|
-
}
|
386
|
-
if (!this.frequently) {
|
387
|
-
this.frequently = this.defaults;
|
388
|
-
}
|
389
|
-
if (!this.frequently[emoji.id]) {
|
390
|
-
this.frequently[emoji.id] = 0;
|
391
|
-
}
|
392
|
-
this.frequently[emoji.id] += 1;
|
393
|
-
if (common.isPlatformBrowser(this.platformId)) {
|
394
|
-
localStorage.setItem(this.NAMESPACE + ".last", emoji.id);
|
395
|
-
localStorage.setItem(this.NAMESPACE + ".frequently", JSON.stringify(this.frequently));
|
396
|
-
}
|
397
|
-
};
|
398
|
-
EmojiFrequentlyService.prototype.get = function (perLine, totalLines) {
|
399
|
-
var _this = this;
|
400
|
-
if (!this.initialized) {
|
401
|
-
this.init();
|
402
|
-
}
|
403
|
-
if (this.frequently === null) {
|
404
|
-
this.defaults = {};
|
405
|
-
var result = [];
|
406
|
-
for (var i = 0; i < perLine; i++) {
|
407
|
-
this.defaults[this.DEFAULTS[i]] = perLine - i;
|
408
|
-
result.push(this.DEFAULTS[i]);
|
409
|
-
}
|
410
|
-
return result;
|
411
|
-
}
|
412
|
-
var quantity = perLine * totalLines;
|
413
|
-
var frequentlyKeys = Object.keys(this.frequently);
|
414
|
-
var sorted = frequentlyKeys
|
415
|
-
.sort(function (a, b) { return _this.frequently[a] - _this.frequently[b]; })
|
416
|
-
.reverse();
|
417
|
-
var sliced = sorted.slice(0, quantity);
|
418
|
-
var last = common.isPlatformBrowser(this.platformId) && localStorage.getItem(this.NAMESPACE + ".last");
|
419
|
-
if (last && !sliced.includes(last)) {
|
420
|
-
sliced.pop();
|
421
|
-
sliced.push(last);
|
422
|
-
}
|
423
|
-
return sliced;
|
424
|
-
};
|
425
|
-
return EmojiFrequentlyService;
|
426
|
-
}());
|
427
|
-
EmojiFrequentlyService.ɵprov = i0.ɵɵdefineInjectable({ factory: function EmojiFrequentlyService_Factory() { return new EmojiFrequentlyService(i0.ɵɵinject(i0.PLATFORM_ID)); }, token: EmojiFrequentlyService, providedIn: "root" });
|
428
|
-
EmojiFrequentlyService.decorators = [
|
429
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
430
|
-
];
|
431
|
-
EmojiFrequentlyService.ctorParameters = function () { return [
|
432
|
-
{ type: String, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] }
|
433
|
-
]; };
|
434
|
-
|
435
|
-
var CategoryComponent = /** @class */ (function () {
|
436
|
-
function CategoryComponent(ref, emojiService, frequently) {
|
437
|
-
this.ref = ref;
|
438
|
-
this.emojiService = emojiService;
|
439
|
-
this.frequently = frequently;
|
440
|
-
this.hasStickyPosition = true;
|
441
|
-
this.name = '';
|
442
|
-
this.perLine = 9;
|
443
|
-
this.totalFrequentLines = 4;
|
444
|
-
this.recent = [];
|
445
|
-
this.custom = [];
|
446
|
-
this.hideObsolete = true;
|
447
|
-
this.virtualize = false;
|
448
|
-
this.virtualizeOffset = 0;
|
449
|
-
this.emojiOver = new i0.EventEmitter();
|
450
|
-
this.emojiLeave = new i0.EventEmitter();
|
451
|
-
this.emojiClick = new i0.EventEmitter();
|
452
|
-
this.containerStyles = {};
|
453
|
-
this.filteredEmojisSubject = new rxjs.Subject();
|
454
|
-
this.filteredEmojis$ = this.filteredEmojisSubject.asObservable();
|
455
|
-
this.labelStyles = {};
|
456
|
-
this.labelSpanStyles = {};
|
457
|
-
this.margin = 0;
|
458
|
-
this.minMargin = 0;
|
459
|
-
this.maxMargin = 0;
|
460
|
-
this.top = 0;
|
461
|
-
this.rows = 0;
|
462
|
-
}
|
463
|
-
CategoryComponent.prototype.ngOnInit = function () {
|
464
|
-
this.emojis = this.getEmojis();
|
465
|
-
if (!this.emojis) {
|
466
|
-
this.containerStyles = { display: 'none' };
|
467
|
-
}
|
468
|
-
if (!this.hasStickyPosition) {
|
469
|
-
this.labelStyles = { height: 28 };
|
470
|
-
// this.labelSpanStyles = { position: 'absolute' };
|
471
|
-
}
|
472
|
-
};
|
473
|
-
CategoryComponent.prototype.ngOnChanges = function (changes) {
|
474
|
-
var _a, _b, _c, _d;
|
475
|
-
if (((_b = (_a = changes.emojis) === null || _a === void 0 ? void 0 : _a.currentValue) === null || _b === void 0 ? void 0 : _b.length) !== ((_d = (_c = changes.emojis) === null || _c === void 0 ? void 0 : _c.previousValue) === null || _d === void 0 ? void 0 : _d.length)) {
|
476
|
-
this.ngAfterViewInit();
|
477
|
-
}
|
478
|
-
};
|
479
|
-
CategoryComponent.prototype.ngAfterViewInit = function () {
|
480
|
-
var _a, _b;
|
481
|
-
if (!this.virtualize || !((_a = this.emojis) === null || _a === void 0 ? void 0 : _a.length)) {
|
482
|
-
return;
|
483
|
-
}
|
484
|
-
this.emojis = this.filterEmojis();
|
485
|
-
var width = this.container.nativeElement.getBoundingClientRect().width;
|
486
|
-
var perRow = Math.floor(width / (this.emojiSize + 12));
|
487
|
-
this.rows = Math.ceil(this.emojis.length / perRow);
|
488
|
-
this.containerStyles = Object.assign(Object.assign({}, this.containerStyles), { minHeight: this.rows * (this.emojiSize + 12) + 28 + "px" });
|
489
|
-
(_b = this.ref) === null || _b === void 0 ? void 0 : _b.detectChanges();
|
490
|
-
this.handleScroll(this.container.nativeElement.parentNode.parentNode.scrollTop);
|
491
|
-
};
|
492
|
-
CategoryComponent.prototype.memoizeSize = function () {
|
493
|
-
var parent = this.container.nativeElement.parentNode.parentNode;
|
494
|
-
var _e = this.container.nativeElement.getBoundingClientRect(), top = _e.top, height = _e.height;
|
495
|
-
var parentTop = parent.getBoundingClientRect().top;
|
496
|
-
var labelHeight = this.label.nativeElement.getBoundingClientRect().height;
|
497
|
-
this.top = top - parentTop + parent.scrollTop;
|
498
|
-
if (height === 0) {
|
499
|
-
this.maxMargin = 0;
|
500
|
-
}
|
501
|
-
else {
|
502
|
-
this.maxMargin = height - labelHeight;
|
503
|
-
}
|
504
|
-
};
|
505
|
-
CategoryComponent.prototype.handleScroll = function (scrollTop) {
|
506
|
-
var margin = scrollTop - this.top;
|
507
|
-
margin = margin < this.minMargin ? this.minMargin : margin;
|
508
|
-
margin = margin > this.maxMargin ? this.maxMargin : margin;
|
509
|
-
if (this.virtualize) {
|
510
|
-
var _e = this.container.nativeElement.getBoundingClientRect(), top = _e.top, height = _e.height;
|
511
|
-
var parentHeight = this.container.nativeElement.parentNode.parentNode.clientHeight;
|
512
|
-
if (parentHeight + (parentHeight + this.virtualizeOffset) >= top && -height - (parentHeight + this.virtualizeOffset) <= top) {
|
513
|
-
this.filteredEmojisSubject.next(this.emojis);
|
514
|
-
}
|
515
|
-
else {
|
516
|
-
this.filteredEmojisSubject.next([]);
|
517
|
-
}
|
518
|
-
}
|
519
|
-
if (margin === this.margin) {
|
520
|
-
this.ref.detectChanges();
|
521
|
-
return false;
|
522
|
-
}
|
523
|
-
if (!this.hasStickyPosition) {
|
524
|
-
this.label.nativeElement.style.top = margin + "px";
|
525
|
-
}
|
526
|
-
this.margin = margin;
|
527
|
-
this.ref.detectChanges();
|
528
|
-
return true;
|
529
|
-
};
|
530
|
-
CategoryComponent.prototype.getEmojis = function () {
|
531
|
-
var _this = this;
|
532
|
-
if (this.name === 'Recent') {
|
533
|
-
var frequentlyUsed = this.recent || this.frequently.get(this.perLine, this.totalFrequentLines);
|
534
|
-
if (!frequentlyUsed || !frequentlyUsed.length) {
|
535
|
-
frequentlyUsed = this.frequently.get(this.perLine, this.totalFrequentLines);
|
536
|
-
}
|
537
|
-
if (frequentlyUsed.length) {
|
538
|
-
this.emojis = frequentlyUsed
|
539
|
-
.map(function (id) {
|
540
|
-
var emoji = _this.custom.filter(function (e) { return e.id === id; })[0];
|
541
|
-
if (emoji) {
|
542
|
-
return emoji;
|
543
|
-
}
|
544
|
-
return id;
|
545
|
-
})
|
546
|
-
.filter(function (id) { return !!_this.emojiService.getData(id); });
|
547
|
-
}
|
548
|
-
if ((!this.emojis || this.emojis.length === 0) && frequentlyUsed.length > 0) {
|
549
|
-
return null;
|
550
|
-
}
|
551
|
-
}
|
552
|
-
if (this.emojis) {
|
553
|
-
this.emojis = this.emojis.slice(0);
|
554
|
-
}
|
555
|
-
return this.emojis;
|
556
|
-
};
|
557
|
-
CategoryComponent.prototype.updateDisplay = function (display) {
|
558
|
-
this.containerStyles.display = display;
|
559
|
-
this.getEmojis();
|
560
|
-
this.ref.detectChanges();
|
561
|
-
};
|
562
|
-
CategoryComponent.prototype.trackById = function (index, item) {
|
563
|
-
return item;
|
564
|
-
};
|
565
|
-
CategoryComponent.prototype.filterEmojis = function () {
|
566
|
-
var e_1, _e;
|
567
|
-
var newEmojis = [];
|
568
|
-
try {
|
569
|
-
for (var _f = __values(this.emojis || []), _g = _f.next(); !_g.done; _g = _f.next()) {
|
570
|
-
var emoji = _g.value;
|
571
|
-
if (!emoji) {
|
572
|
-
continue;
|
573
|
-
}
|
574
|
-
var data = this.emojiService.getData(emoji);
|
575
|
-
if (!data || (data.obsoletedBy && this.hideObsolete) || (!data.unified && !data.custom)) {
|
576
|
-
continue;
|
577
|
-
}
|
578
|
-
newEmojis.push(emoji);
|
579
|
-
}
|
580
|
-
}
|
581
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
582
|
-
finally {
|
583
|
-
try {
|
584
|
-
if (_g && !_g.done && (_e = _f.return)) _e.call(_f);
|
585
|
-
}
|
586
|
-
finally { if (e_1) throw e_1.error; }
|
587
|
-
}
|
588
|
-
return newEmojis;
|
589
|
-
};
|
590
|
-
return CategoryComponent;
|
591
|
-
}());
|
592
|
-
CategoryComponent.decorators = [
|
593
|
-
{ type: i0.Component, args: [{
|
594
|
-
selector: 'emoji-category',
|
595
|
-
template: "\n <section\n #container\n class=\"emoji-mart-category\"\n [attr.aria-label]=\"i18n.categories[id]\"\n [class.emoji-mart-no-results]=\"emojis && !emojis.length\"\n [ngStyle]=\"containerStyles\"\n >\n <div class=\"emoji-mart-category-label\" [ngStyle]=\"labelStyles\" [attr.data-name]=\"name\">\n <!-- already labeled by the section aria-label -->\n <span #label [ngStyle]=\"labelSpanStyles\" aria-hidden=\"true\">\n {{ i18n.categories[id] }}\n </span>\n </div>\n\n <div\n *ngIf=\"virtualize; else normalRenderTemplate\"\n >\n <div *ngIf=\"filteredEmojis$ | async as filteredEmojis\">\n <ngx-emoji\n *ngFor=\"let emoji of filteredEmojis; trackBy: trackById\"\n [emoji]=\"emoji\"\n [size]=\"emojiSize\"\n [skin]=\"emojiSkin\"\n [isNative]=\"emojiIsNative\"\n [set]=\"emojiSet\"\n [sheetSize]=\"emojiSheetSize\"\n [forceSize]=\"emojiForceSize\"\n [tooltip]=\"emojiTooltip\"\n [backgroundImageFn]=\"emojiBackgroundImageFn\"\n [imageUrlFn]=\"emojiImageUrlFn\"\n [hideObsolete]=\"hideObsolete\"\n [useButton]=\"emojiUseButton\"\n (emojiOver)=\"emojiOver.emit($event)\"\n (emojiLeave)=\"emojiLeave.emit($event)\"\n (emojiClick)=\"emojiClick.emit($event)\"\n ></ngx-emoji>\n </div>\n </div>\n\n <div *ngIf=\"emojis && !emojis.length\">\n <div>\n <ngx-emoji\n [emoji]=\"notFoundEmoji\"\n size=\"38\"\n [skin]=\"emojiSkin\"\n [isNative]=\"emojiIsNative\"\n [set]=\"emojiSet\"\n [sheetSize]=\"emojiSheetSize\"\n [forceSize]=\"emojiForceSize\"\n [tooltip]=\"emojiTooltip\"\n [backgroundImageFn]=\"emojiBackgroundImageFn\"\n [useButton]=\"emojiUseButton\"\n ></ngx-emoji>\n </div>\n\n <div class=\"emoji-mart-no-results-label\">\n {{ i18n.notfound }}\n </div>\n </div>\n </section>\n\n <ng-template #normalRenderTemplate>\n <div *ngIf=\"emojis\">\n <ngx-emoji\n *ngFor=\"let emoji of emojis; trackBy: trackById\"\n [emoji]=\"emoji\"\n [size]=\"emojiSize\"\n [skin]=\"emojiSkin\"\n [isNative]=\"emojiIsNative\"\n [set]=\"emojiSet\"\n [sheetSize]=\"emojiSheetSize\"\n [forceSize]=\"emojiForceSize\"\n [tooltip]=\"emojiTooltip\"\n [backgroundImageFn]=\"emojiBackgroundImageFn\"\n [imageUrlFn]=\"emojiImageUrlFn\"\n [hideObsolete]=\"hideObsolete\"\n (emojiOver)=\"emojiOver.emit($event)\"\n (emojiLeave)=\"emojiLeave.emit($event)\"\n (emojiClick)=\"emojiClick.emit($event)\"\n ></ngx-emoji>\n </div>\n </ng-template>\n ",
|
596
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
597
|
-
preserveWhitespaces: false
|
598
|
-
},] }
|
599
|
-
];
|
600
|
-
CategoryComponent.ctorParameters = function () { return [
|
601
|
-
{ type: i0.ChangeDetectorRef },
|
602
|
-
{ type: i1.EmojiService },
|
603
|
-
{ type: EmojiFrequentlyService }
|
604
|
-
]; };
|
605
|
-
CategoryComponent.propDecorators = {
|
606
|
-
emojis: [{ type: i0.Input }],
|
607
|
-
hasStickyPosition: [{ type: i0.Input }],
|
608
|
-
name: [{ type: i0.Input }],
|
609
|
-
perLine: [{ type: i0.Input }],
|
610
|
-
totalFrequentLines: [{ type: i0.Input }],
|
611
|
-
recent: [{ type: i0.Input }],
|
612
|
-
custom: [{ type: i0.Input }],
|
613
|
-
i18n: [{ type: i0.Input }],
|
614
|
-
id: [{ type: i0.Input }],
|
615
|
-
hideObsolete: [{ type: i0.Input }],
|
616
|
-
notFoundEmoji: [{ type: i0.Input }],
|
617
|
-
virtualize: [{ type: i0.Input }],
|
618
|
-
virtualizeOffset: [{ type: i0.Input }],
|
619
|
-
emojiIsNative: [{ type: i0.Input }],
|
620
|
-
emojiSkin: [{ type: i0.Input }],
|
621
|
-
emojiSize: [{ type: i0.Input }],
|
622
|
-
emojiSet: [{ type: i0.Input }],
|
623
|
-
emojiSheetSize: [{ type: i0.Input }],
|
624
|
-
emojiForceSize: [{ type: i0.Input }],
|
625
|
-
emojiTooltip: [{ type: i0.Input }],
|
626
|
-
emojiBackgroundImageFn: [{ type: i0.Input }],
|
627
|
-
emojiImageUrlFn: [{ type: i0.Input }],
|
628
|
-
emojiUseButton: [{ type: i0.Input }],
|
629
|
-
emojiOver: [{ type: i0.Output }],
|
630
|
-
emojiLeave: [{ type: i0.Output }],
|
631
|
-
emojiClick: [{ type: i0.Output }],
|
632
|
-
container: [{ type: i0.ViewChild, args: ['container', { static: true },] }],
|
633
|
-
label: [{ type: i0.ViewChild, args: ['label', { static: true },] }]
|
634
|
-
};
|
635
|
-
|
636
|
-
function uniq(arr) {
|
637
|
-
return arr.reduce(function (acc, item) {
|
638
|
-
if (!acc.includes(item)) {
|
639
|
-
acc.push(item);
|
640
|
-
}
|
641
|
-
return acc;
|
642
|
-
}, []);
|
643
|
-
}
|
644
|
-
function intersect(a, b) {
|
645
|
-
var uniqA = uniq(a);
|
646
|
-
var uniqB = uniq(b);
|
647
|
-
return uniqA.filter(function (item) { return uniqB.indexOf(item) >= 0; });
|
648
|
-
}
|
649
|
-
// https://github.com/sonicdoe/measure-scrollbar
|
650
|
-
function measureScrollbar() {
|
651
|
-
if (typeof document === 'undefined') {
|
652
|
-
return 0;
|
653
|
-
}
|
654
|
-
var div = document.createElement('div');
|
655
|
-
div.style.width = '100px';
|
656
|
-
div.style.height = '100px';
|
657
|
-
div.style.overflow = 'scroll';
|
658
|
-
div.style.position = 'absolute';
|
659
|
-
div.style.top = '-9999px';
|
660
|
-
document.body.appendChild(div);
|
661
|
-
var scrollbarWidth = div.offsetWidth - div.clientWidth;
|
662
|
-
document.body.removeChild(div);
|
663
|
-
return scrollbarWidth;
|
664
|
-
}
|
665
|
-
|
666
|
-
var EmojiSearch = /** @class */ (function () {
|
667
|
-
function EmojiSearch(emojiService) {
|
668
|
-
var e_1, _b, e_2, _c;
|
669
|
-
this.emojiService = emojiService;
|
670
|
-
this.originalPool = {};
|
671
|
-
this.index = {};
|
672
|
-
this.emojisList = {};
|
673
|
-
this.emoticonsList = {};
|
674
|
-
this.emojiSearch = {};
|
675
|
-
try {
|
676
|
-
for (var _d = __values(this.emojiService.emojis), _e = _d.next(); !_e.done; _e = _d.next()) {
|
677
|
-
var emojiData = _e.value;
|
678
|
-
var shortNames = emojiData.shortNames, emoticons = emojiData.emoticons;
|
679
|
-
var id = shortNames[0];
|
680
|
-
try {
|
681
|
-
for (var emoticons_1 = (e_2 = void 0, __values(emoticons)), emoticons_1_1 = emoticons_1.next(); !emoticons_1_1.done; emoticons_1_1 = emoticons_1.next()) {
|
682
|
-
var emoticon = emoticons_1_1.value;
|
683
|
-
if (this.emoticonsList[emoticon]) {
|
684
|
-
continue;
|
685
|
-
}
|
686
|
-
this.emoticonsList[emoticon] = id;
|
687
|
-
}
|
688
|
-
}
|
689
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
690
|
-
finally {
|
691
|
-
try {
|
692
|
-
if (emoticons_1_1 && !emoticons_1_1.done && (_c = emoticons_1.return)) _c.call(emoticons_1);
|
693
|
-
}
|
694
|
-
finally { if (e_2) throw e_2.error; }
|
695
|
-
}
|
696
|
-
this.emojisList[id] = this.emojiService.getSanitizedData(id);
|
697
|
-
this.originalPool[id] = emojiData;
|
698
|
-
}
|
699
|
-
}
|
700
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
701
|
-
finally {
|
702
|
-
try {
|
703
|
-
if (_e && !_e.done && (_b = _d.return)) _b.call(_d);
|
704
|
-
}
|
705
|
-
finally { if (e_1) throw e_1.error; }
|
706
|
-
}
|
707
|
-
}
|
708
|
-
EmojiSearch.prototype.addCustomToPool = function (custom, pool) {
|
709
|
-
var e_3, _b;
|
710
|
-
try {
|
711
|
-
for (var custom_1 = __values(custom), custom_1_1 = custom_1.next(); !custom_1_1.done; custom_1_1 = custom_1.next()) {
|
712
|
-
var emoji = custom_1_1.value;
|
713
|
-
var emojiId = emoji.id || emoji.shortNames[0];
|
714
|
-
if (emojiId && !pool[emojiId]) {
|
715
|
-
pool[emojiId] = this.emojiService.getData(emoji);
|
716
|
-
this.emojisList[emojiId] = this.emojiService.getSanitizedData(emoji);
|
717
|
-
}
|
718
|
-
}
|
719
|
-
}
|
720
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
721
|
-
finally {
|
722
|
-
try {
|
723
|
-
if (custom_1_1 && !custom_1_1.done && (_b = custom_1.return)) _b.call(custom_1);
|
724
|
-
}
|
725
|
-
finally { if (e_3) throw e_3.error; }
|
726
|
-
}
|
727
|
-
};
|
728
|
-
EmojiSearch.prototype.search = function (value, emojisToShowFilter, maxResults, include, exclude, custom) {
|
729
|
-
var e_4, _b, e_5, _c;
|
730
|
-
var _this = this;
|
731
|
-
if (maxResults === void 0) { maxResults = 75; }
|
732
|
-
if (include === void 0) { include = []; }
|
733
|
-
if (exclude === void 0) { exclude = []; }
|
734
|
-
if (custom === void 0) { custom = []; }
|
735
|
-
var _a;
|
736
|
-
this.addCustomToPool(custom, this.originalPool);
|
737
|
-
var results;
|
738
|
-
var pool = this.originalPool;
|
739
|
-
if (value.length) {
|
740
|
-
if (value === '-' || value === '-1') {
|
741
|
-
return [this.emojisList['-1']];
|
742
|
-
}
|
743
|
-
if (value === '+' || value === '+1') {
|
744
|
-
return [this.emojisList['+1']];
|
745
|
-
}
|
746
|
-
var values = value.toLowerCase().split(/[\s|,|\-|_]+/);
|
747
|
-
var allResults = [];
|
748
|
-
if (values.length > 2) {
|
749
|
-
values = [values[0], values[1]];
|
750
|
-
}
|
751
|
-
if (include.length || exclude.length) {
|
752
|
-
pool = {};
|
753
|
-
try {
|
754
|
-
for (var _d = __values(i1.categories || []), _e = _d.next(); !_e.done; _e = _d.next()) {
|
755
|
-
var category = _e.value;
|
756
|
-
var isIncluded = include && include.length ? include.indexOf(category.id) > -1 : true;
|
757
|
-
var isExcluded = exclude && exclude.length ? exclude.indexOf(category.id) > -1 : false;
|
758
|
-
if (!isIncluded || isExcluded) {
|
759
|
-
continue;
|
760
|
-
}
|
761
|
-
try {
|
762
|
-
for (var _f = (e_5 = void 0, __values(category.emojis || [])), _g = _f.next(); !_g.done; _g = _f.next()) {
|
763
|
-
var emojiId = _g.value;
|
764
|
-
// Need to make sure that pool gets keyed
|
765
|
-
// with the correct id, which is why we call emojiService.getData below
|
766
|
-
var emoji = this.emojiService.getData(emojiId);
|
767
|
-
pool[(_a = emoji === null || emoji === void 0 ? void 0 : emoji.id) !== null && _a !== void 0 ? _a : ''] = emoji;
|
768
|
-
}
|
769
|
-
}
|
770
|
-
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
771
|
-
finally {
|
772
|
-
try {
|
773
|
-
if (_g && !_g.done && (_c = _f.return)) _c.call(_f);
|
774
|
-
}
|
775
|
-
finally { if (e_5) throw e_5.error; }
|
776
|
-
}
|
777
|
-
}
|
778
|
-
}
|
779
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
780
|
-
finally {
|
781
|
-
try {
|
782
|
-
if (_e && !_e.done && (_b = _d.return)) _b.call(_d);
|
783
|
-
}
|
784
|
-
finally { if (e_4) throw e_4.error; }
|
785
|
-
}
|
786
|
-
if (custom.length) {
|
787
|
-
var customIsIncluded = include && include.length ? include.indexOf('custom') > -1 : true;
|
788
|
-
var customIsExcluded = exclude && exclude.length ? exclude.indexOf('custom') > -1 : false;
|
789
|
-
if (customIsIncluded && !customIsExcluded) {
|
790
|
-
this.addCustomToPool(custom, pool);
|
791
|
-
}
|
792
|
-
}
|
793
|
-
}
|
794
|
-
allResults = values
|
795
|
-
.map(function (v) {
|
796
|
-
var aPool = pool;
|
797
|
-
var aIndex = _this.index;
|
798
|
-
var length = 0;
|
799
|
-
var _loop_1 = function (charIndex) {
|
800
|
-
var e_6, _b;
|
801
|
-
var char = v[charIndex];
|
802
|
-
length++;
|
803
|
-
if (!aIndex[char]) {
|
804
|
-
aIndex[char] = {};
|
805
|
-
}
|
806
|
-
aIndex = aIndex[char];
|
807
|
-
if (!aIndex.results) {
|
808
|
-
var scores_1 = {};
|
809
|
-
aIndex.results = [];
|
810
|
-
aIndex.pool = {};
|
811
|
-
try {
|
812
|
-
for (var _c = (e_6 = void 0, __values(Object.keys(aPool))), _d = _c.next(); !_d.done; _d = _c.next()) {
|
813
|
-
var id = _d.value;
|
814
|
-
var emoji = aPool[id];
|
815
|
-
if (!_this.emojiSearch[id]) {
|
816
|
-
_this.emojiSearch[id] = _this.buildSearch(emoji.short_names, emoji.name, emoji.id, emoji.keywords, emoji.emoticons);
|
817
|
-
}
|
818
|
-
var query = _this.emojiSearch[id];
|
819
|
-
var sub = v.substr(0, length);
|
820
|
-
var subIndex = query.indexOf(sub);
|
821
|
-
if (subIndex !== -1) {
|
822
|
-
var score = subIndex + 1;
|
823
|
-
if (sub === id) {
|
824
|
-
score = 0;
|
825
|
-
}
|
826
|
-
aIndex.results.push(_this.emojisList[id]);
|
827
|
-
aIndex.pool[id] = emoji;
|
828
|
-
scores_1[id] = score;
|
829
|
-
}
|
830
|
-
}
|
831
|
-
}
|
832
|
-
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
833
|
-
finally {
|
834
|
-
try {
|
835
|
-
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
836
|
-
}
|
837
|
-
finally { if (e_6) throw e_6.error; }
|
838
|
-
}
|
839
|
-
aIndex.results.sort(function (a, b) {
|
840
|
-
var aScore = scores_1[a.id];
|
841
|
-
var bScore = scores_1[b.id];
|
842
|
-
return aScore - bScore;
|
843
|
-
});
|
844
|
-
}
|
845
|
-
aPool = aIndex.pool;
|
846
|
-
};
|
847
|
-
// tslint:disable-next-line: prefer-for-of
|
848
|
-
for (var charIndex = 0; charIndex < v.length; charIndex++) {
|
849
|
-
_loop_1(charIndex);
|
850
|
-
}
|
851
|
-
return aIndex.results;
|
852
|
-
})
|
853
|
-
.filter(function (a) { return a; });
|
854
|
-
if (allResults.length > 1) {
|
855
|
-
results = intersect.apply(null, allResults);
|
856
|
-
}
|
857
|
-
else if (allResults.length) {
|
858
|
-
results = allResults[0];
|
859
|
-
}
|
860
|
-
else {
|
861
|
-
results = [];
|
862
|
-
}
|
863
|
-
}
|
864
|
-
if (results) {
|
865
|
-
if (emojisToShowFilter) {
|
866
|
-
results = results.filter(function (result) {
|
867
|
-
if (result && result.id) {
|
868
|
-
return emojisToShowFilter(_this.emojiService.names[result.id]);
|
869
|
-
}
|
870
|
-
return false;
|
871
|
-
});
|
872
|
-
}
|
873
|
-
if (results && results.length > maxResults) {
|
874
|
-
results = results.slice(0, maxResults);
|
875
|
-
}
|
876
|
-
}
|
877
|
-
return results || null;
|
878
|
-
};
|
879
|
-
EmojiSearch.prototype.buildSearch = function (shortNames, name, id, keywords, emoticons) {
|
880
|
-
var search = [];
|
881
|
-
var addToSearch = function (strings, split) {
|
882
|
-
var e_7, _b, e_8, _c;
|
883
|
-
if (!strings) {
|
884
|
-
return;
|
885
|
-
}
|
886
|
-
var arr = Array.isArray(strings) ? strings : [strings];
|
887
|
-
try {
|
888
|
-
for (var arr_1 = __values(arr), arr_1_1 = arr_1.next(); !arr_1_1.done; arr_1_1 = arr_1.next()) {
|
889
|
-
var str = arr_1_1.value;
|
890
|
-
var substrings = split ? str.split(/[-|_|\s]+/) : [str];
|
891
|
-
try {
|
892
|
-
for (var substrings_1 = (e_8 = void 0, __values(substrings)), substrings_1_1 = substrings_1.next(); !substrings_1_1.done; substrings_1_1 = substrings_1.next()) {
|
893
|
-
var s = substrings_1_1.value;
|
894
|
-
s = s.toLowerCase();
|
895
|
-
if (!search.includes(s)) {
|
896
|
-
search.push(s);
|
897
|
-
}
|
898
|
-
}
|
899
|
-
}
|
900
|
-
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
901
|
-
finally {
|
902
|
-
try {
|
903
|
-
if (substrings_1_1 && !substrings_1_1.done && (_c = substrings_1.return)) _c.call(substrings_1);
|
904
|
-
}
|
905
|
-
finally { if (e_8) throw e_8.error; }
|
906
|
-
}
|
907
|
-
}
|
908
|
-
}
|
909
|
-
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
910
|
-
finally {
|
911
|
-
try {
|
912
|
-
if (arr_1_1 && !arr_1_1.done && (_b = arr_1.return)) _b.call(arr_1);
|
913
|
-
}
|
914
|
-
finally { if (e_7) throw e_7.error; }
|
915
|
-
}
|
916
|
-
};
|
917
|
-
addToSearch(shortNames, true);
|
918
|
-
addToSearch(name, true);
|
919
|
-
addToSearch(id, true);
|
920
|
-
addToSearch(keywords, true);
|
921
|
-
addToSearch(emoticons, false);
|
922
|
-
return search.join(',');
|
923
|
-
};
|
924
|
-
return EmojiSearch;
|
925
|
-
}());
|
926
|
-
EmojiSearch.ɵprov = i0.ɵɵdefineInjectable({ factory: function EmojiSearch_Factory() { return new EmojiSearch(i0.ɵɵinject(i1.EmojiService)); }, token: EmojiSearch, providedIn: "root" });
|
927
|
-
EmojiSearch.decorators = [
|
928
|
-
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
929
|
-
];
|
930
|
-
EmojiSearch.ctorParameters = function () { return [
|
931
|
-
{ type: i1.EmojiService }
|
932
|
-
]; };
|
933
|
-
|
934
|
-
var PreviewComponent = /** @class */ (function () {
|
935
|
-
function PreviewComponent(ref, emojiService) {
|
936
|
-
this.ref = ref;
|
937
|
-
this.emojiService = emojiService;
|
938
|
-
this.skinChange = new i0.EventEmitter();
|
939
|
-
this.emojiData = {};
|
940
|
-
}
|
941
|
-
PreviewComponent.prototype.ngOnChanges = function () {
|
942
|
-
var _a;
|
943
|
-
if (!this.emoji) {
|
944
|
-
return;
|
945
|
-
}
|
946
|
-
this.emojiData = this.emojiService.getData(this.emoji, this.emojiSkin, this.emojiSet);
|
947
|
-
var knownEmoticons = [];
|
948
|
-
var listedEmoticons = [];
|
949
|
-
var emoitcons = this.emojiData.emoticons || [];
|
950
|
-
emoitcons.forEach(function (emoticon) {
|
951
|
-
if (knownEmoticons.indexOf(emoticon.toLowerCase()) >= 0) {
|
952
|
-
return;
|
953
|
-
}
|
954
|
-
knownEmoticons.push(emoticon.toLowerCase());
|
955
|
-
listedEmoticons.push(emoticon);
|
956
|
-
});
|
957
|
-
this.listedEmoticons = listedEmoticons;
|
958
|
-
(_a = this.ref) === null || _a === void 0 ? void 0 : _a.detectChanges();
|
959
|
-
};
|
960
|
-
return PreviewComponent;
|
961
|
-
}());
|
962
|
-
PreviewComponent.decorators = [
|
963
|
-
{ type: i0.Component, args: [{
|
964
|
-
selector: 'emoji-preview',
|
965
|
-
template: "\n <div class=\"emoji-mart-preview\" *ngIf=\"emoji && emojiData\">\n <div class=\"emoji-mart-preview-emoji\">\n <ngx-emoji\n [emoji]=\"emoji\"\n [size]=\"38\"\n [isNative]=\"emojiIsNative\"\n [skin]=\"emojiSkin\"\n [size]=\"emojiSize\"\n [set]=\"emojiSet\"\n [sheetSize]=\"emojiSheetSize\"\n [backgroundImageFn]=\"emojiBackgroundImageFn\"\n [imageUrlFn]=\"emojiImageUrlFn\"\n ></ngx-emoji>\n </div>\n\n <div class=\"emoji-mart-preview-data\">\n <div class=\"emoji-mart-preview-name\">{{ emojiData.name }}</div>\n <div class=\"emoji-mart-preview-shortname\">\n <span\n class=\"emoji-mart-preview-shortname\"\n *ngFor=\"let short_name of emojiData.shortNames\"\n >\n :{{ short_name }}:\n </span>\n </div>\n <div class=\"emoji-mart-preview-emoticons\">\n <span class=\"emoji-mart-preview-emoticon\" *ngFor=\"let emoticon of listedEmoticons\">\n {{ emoticon }}\n </span>\n </div>\n </div>\n </div>\n\n <div class=\"emoji-mart-preview\" *ngIf=\"!emoji\">\n <div class=\"emoji-mart-preview-emoji\">\n <ngx-emoji\n *ngIf=\"idleEmoji && idleEmoji.length\"\n [isNative]=\"emojiIsNative\"\n [skin]=\"emojiSkin\"\n [set]=\"emojiSet\"\n [emoji]=\"idleEmoji\"\n [backgroundImageFn]=\"emojiBackgroundImageFn\"\n [size]=\"38\"\n [imageUrlFn]=\"emojiImageUrlFn\"\n ></ngx-emoji>\n </div>\n\n <div class=\"emoji-mart-preview-data\">\n <span class=\"emoji-mart-title-label\">{{ title }}</span>\n </div>\n\n <div class=\"emoji-mart-preview-skins\">\n <emoji-skins [skin]=\"emojiSkin\" (changeSkin)=\"skinChange.emit($event)\" [i18n]=\"i18n\">\n </emoji-skins>\n </div>\n </div>\n ",
|
966
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
967
|
-
preserveWhitespaces: false
|
968
|
-
},] }
|
969
|
-
];
|
970
|
-
PreviewComponent.ctorParameters = function () { return [
|
971
|
-
{ type: i0.ChangeDetectorRef },
|
972
|
-
{ type: i1.EmojiService }
|
973
|
-
]; };
|
974
|
-
PreviewComponent.propDecorators = {
|
975
|
-
title: [{ type: i0.Input }],
|
976
|
-
emoji: [{ type: i0.Input }],
|
977
|
-
idleEmoji: [{ type: i0.Input }],
|
978
|
-
i18n: [{ type: i0.Input }],
|
979
|
-
emojiIsNative: [{ type: i0.Input }],
|
980
|
-
emojiSkin: [{ type: i0.Input }],
|
981
|
-
emojiSize: [{ type: i0.Input }],
|
982
|
-
emojiSet: [{ type: i0.Input }],
|
983
|
-
emojiSheetSize: [{ type: i0.Input }],
|
984
|
-
emojiBackgroundImageFn: [{ type: i0.Input }],
|
985
|
-
emojiImageUrlFn: [{ type: i0.Input }],
|
986
|
-
skinChange: [{ type: i0.Output }]
|
987
|
-
};
|
988
|
-
|
989
|
-
var id = 0;
|
990
|
-
var SearchComponent = /** @class */ (function () {
|
991
|
-
function SearchComponent(emojiSearch) {
|
992
|
-
this.emojiSearch = emojiSearch;
|
993
|
-
this.maxResults = 75;
|
994
|
-
this.autoFocus = false;
|
995
|
-
this.include = [];
|
996
|
-
this.exclude = [];
|
997
|
-
this.custom = [];
|
998
|
-
this.searchResults = new i0.EventEmitter();
|
999
|
-
this.enterKey = new i0.EventEmitter();
|
1000
|
-
this.isSearching = false;
|
1001
|
-
this.query = '';
|
1002
|
-
this.inputId = "emoji-mart-search-" + ++id;
|
1003
|
-
}
|
1004
|
-
SearchComponent.prototype.ngOnInit = function () {
|
1005
|
-
this.icon = this.icons.search;
|
1006
|
-
};
|
1007
|
-
SearchComponent.prototype.ngAfterViewInit = function () {
|
1008
|
-
if (this.autoFocus) {
|
1009
|
-
this.inputRef.nativeElement.focus();
|
1010
|
-
}
|
1011
|
-
};
|
1012
|
-
SearchComponent.prototype.clear = function () {
|
1013
|
-
this.query = '';
|
1014
|
-
this.handleSearch('');
|
1015
|
-
this.inputRef.nativeElement.focus();
|
1016
|
-
};
|
1017
|
-
SearchComponent.prototype.handleEnterKey = function ($event) {
|
1018
|
-
if (!this.query) {
|
1019
|
-
return;
|
1020
|
-
}
|
1021
|
-
this.enterKey.emit($event);
|
1022
|
-
$event.preventDefault();
|
1023
|
-
};
|
1024
|
-
SearchComponent.prototype.handleSearch = function (value) {
|
1025
|
-
if (value === '') {
|
1026
|
-
this.icon = this.icons.search;
|
1027
|
-
this.isSearching = false;
|
1028
|
-
}
|
1029
|
-
else {
|
1030
|
-
this.icon = this.icons.delete;
|
1031
|
-
this.isSearching = true;
|
1032
|
-
}
|
1033
|
-
var emojis = this.emojiSearch.search(this.query, this.emojisToShowFilter, this.maxResults, this.include, this.exclude, this.custom);
|
1034
|
-
this.searchResults.emit(emojis);
|
1035
|
-
};
|
1036
|
-
SearchComponent.prototype.handleChange = function () {
|
1037
|
-
this.handleSearch(this.query);
|
1038
|
-
};
|
1039
|
-
return SearchComponent;
|
1040
|
-
}());
|
1041
|
-
SearchComponent.decorators = [
|
1042
|
-
{ type: i0.Component, args: [{
|
1043
|
-
selector: 'emoji-search',
|
1044
|
-
template: "\n <div class=\"emoji-mart-search\">\n <input\n [id]=\"inputId\"\n #inputRef\n type=\"search\"\n (keyup.enter)=\"handleEnterKey($event)\"\n [placeholder]=\"i18n.search\"\n [autofocus]=\"autoFocus\"\n [(ngModel)]=\"query\"\n (ngModelChange)=\"handleChange()\"\n />\n <!--\n Use a <label> in addition to the placeholder for accessibility, but place it off-screen\n http://www.maxability.co.in/2016/01/placeholder-attribute-and-why-it-is-not-accessible/\n -->\n <label class=\"emoji-mart-sr-only\" [htmlFor]=\"inputId\">\n {{ i18n.search }}\n </label>\n <button\n type=\"button\"\n class=\"emoji-mart-search-icon\"\n (click)=\"clear()\"\n (keyup.enter)=\"clear()\"\n [disabled]=\"!isSearching\"\n [attr.aria-label]=\"i18n.clear\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 20 20\"\n width=\"13\"\n height=\"13\"\n opacity=\"0.5\"\n >\n <path [attr.d]=\"icon\" />\n </svg>\n </button>\n </div>\n ",
|
1045
|
-
preserveWhitespaces: false
|
1046
|
-
},] }
|
1047
|
-
];
|
1048
|
-
SearchComponent.ctorParameters = function () { return [
|
1049
|
-
{ type: EmojiSearch }
|
1050
|
-
]; };
|
1051
|
-
SearchComponent.propDecorators = {
|
1052
|
-
maxResults: [{ type: i0.Input }],
|
1053
|
-
autoFocus: [{ type: i0.Input }],
|
1054
|
-
i18n: [{ type: i0.Input }],
|
1055
|
-
include: [{ type: i0.Input }],
|
1056
|
-
exclude: [{ type: i0.Input }],
|
1057
|
-
custom: [{ type: i0.Input }],
|
1058
|
-
icons: [{ type: i0.Input }],
|
1059
|
-
emojisToShowFilter: [{ type: i0.Input }],
|
1060
|
-
searchResults: [{ type: i0.Output }],
|
1061
|
-
enterKey: [{ type: i0.Output }],
|
1062
|
-
inputRef: [{ type: i0.ViewChild, args: ['inputRef', { static: true },] }]
|
1063
|
-
};
|
1064
|
-
|
1065
|
-
/* tslint:disable max-line-length */
|
1066
|
-
var categories = {
|
1067
|
-
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",
|
1068
|
-
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",
|
1069
|
-
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",
|
1070
|
-
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",
|
1071
|
-
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",
|
1072
|
-
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",
|
1073
|
-
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",
|
1074
|
-
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",
|
1075
|
-
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",
|
1076
|
-
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",
|
1077
|
-
};
|
1078
|
-
var search = {
|
1079
|
-
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",
|
1080
|
-
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",
|
1081
|
-
};
|
1082
|
-
|
1083
|
-
var I18N = {
|
1084
|
-
search: 'Search',
|
1085
|
-
emojilist: 'List of emoji',
|
1086
|
-
notfound: 'No Emoji Found',
|
1087
|
-
clear: 'Clear',
|
1088
|
-
categories: {
|
1089
|
-
search: 'Search Results',
|
1090
|
-
recent: 'Frequently Used',
|
1091
|
-
people: 'Smileys & People',
|
1092
|
-
nature: 'Animals & Nature',
|
1093
|
-
foods: 'Food & Drink',
|
1094
|
-
activity: 'Activity',
|
1095
|
-
places: 'Travel & Places',
|
1096
|
-
objects: 'Objects',
|
1097
|
-
symbols: 'Symbols',
|
1098
|
-
flags: 'Flags',
|
1099
|
-
custom: 'Custom',
|
1100
|
-
},
|
1101
|
-
skintones: {
|
1102
|
-
1: 'Default Skin Tone',
|
1103
|
-
2: 'Light Skin Tone',
|
1104
|
-
3: 'Medium-Light Skin Tone',
|
1105
|
-
4: 'Medium Skin Tone',
|
1106
|
-
5: 'Medium-Dark Skin Tone',
|
1107
|
-
6: 'Dark Skin Tone',
|
1108
|
-
},
|
1109
|
-
};
|
1110
|
-
var PickerComponent = /** @class */ (function () {
|
1111
|
-
function PickerComponent(ngZone, renderer, ref, frequently, platformId) {
|
1112
|
-
var _this = this;
|
1113
|
-
this.ngZone = ngZone;
|
1114
|
-
this.renderer = renderer;
|
1115
|
-
this.ref = ref;
|
1116
|
-
this.frequently = frequently;
|
1117
|
-
this.platformId = platformId;
|
1118
|
-
this.perLine = 9;
|
1119
|
-
this.totalFrequentLines = 4;
|
1120
|
-
this.i18n = {};
|
1121
|
-
this.style = {};
|
1122
|
-
this.title = 'Emoji Mart™';
|
1123
|
-
this.emoji = 'department_store';
|
1124
|
-
this.darkMode = !!(typeof matchMedia === 'function' && matchMedia('(prefers-color-scheme: dark)').matches);
|
1125
|
-
this.color = '#ae65c5';
|
1126
|
-
this.hideObsolete = true;
|
1127
|
-
/** all categories shown */
|
1128
|
-
this.categories = [];
|
1129
|
-
/** used to temporarily draw categories */
|
1130
|
-
this.activeCategories = [];
|
1131
|
-
this.set = 'apple';
|
1132
|
-
this.skin = 1;
|
1133
|
-
/** Renders the native unicode emoji */
|
1134
|
-
this.isNative = false;
|
1135
|
-
this.emojiSize = 24;
|
1136
|
-
this.sheetSize = 64;
|
1137
|
-
this.showPreview = true;
|
1138
|
-
this.emojiTooltip = false;
|
1139
|
-
this.autoFocus = false;
|
1140
|
-
this.custom = [];
|
1141
|
-
this.hideRecent = true;
|
1142
|
-
this.notFoundEmoji = 'sleuth_or_spy';
|
1143
|
-
this.categoriesIcons = categories;
|
1144
|
-
this.searchIcons = search;
|
1145
|
-
this.useButton = false;
|
1146
|
-
this.enableFrequentEmojiSort = false;
|
1147
|
-
this.enableSearch = true;
|
1148
|
-
this.showSingleCategory = false;
|
1149
|
-
this.virtualize = false;
|
1150
|
-
this.virtualizeOffset = 0;
|
1151
|
-
this.emojiClick = new i0.EventEmitter();
|
1152
|
-
this.emojiSelect = new i0.EventEmitter();
|
1153
|
-
this.skinChange = new i0.EventEmitter();
|
1154
|
-
this.scrollHeight = 0;
|
1155
|
-
this.clientHeight = 0;
|
1156
|
-
this.clientWidth = 0;
|
1157
|
-
this.firstRender = true;
|
1158
|
-
this.animationFrameRequestId = null;
|
1159
|
-
this.NAMESPACE = 'emoji-mart';
|
1160
|
-
this.measureScrollbar = 0;
|
1161
|
-
this.RECENT_CATEGORY = {
|
1162
|
-
id: 'recent',
|
1163
|
-
name: 'Recent',
|
1164
|
-
emojis: null,
|
1165
|
-
};
|
1166
|
-
this.SEARCH_CATEGORY = {
|
1167
|
-
id: 'search',
|
1168
|
-
name: 'Search',
|
1169
|
-
emojis: null,
|
1170
|
-
anchor: false,
|
1171
|
-
};
|
1172
|
-
this.CUSTOM_CATEGORY = {
|
1173
|
-
id: 'custom',
|
1174
|
-
name: 'Custom',
|
1175
|
-
emojis: [],
|
1176
|
-
};
|
1177
|
-
this.backgroundImageFn = function (set, sheetSize) { return "https://unpkg.com/emoji-datasource-" + _this.set + "@6.0.0/img/" + _this.set + "/sheets-256/" + _this.sheetSize + ".png"; };
|
1178
|
-
}
|
1179
|
-
PickerComponent.prototype.ngOnInit = function () {
|
1180
|
-
var e_1, _b;
|
1181
|
-
var _this = this;
|
1182
|
-
// measure scroll
|
1183
|
-
this.measureScrollbar = measureScrollbar();
|
1184
|
-
this.i18n = Object.assign(Object.assign({}, I18N), this.i18n);
|
1185
|
-
this.i18n.categories = Object.assign(Object.assign({}, I18N.categories), this.i18n.categories);
|
1186
|
-
this.skin =
|
1187
|
-
JSON.parse((common.isPlatformBrowser(this.platformId) && localStorage.getItem(this.NAMESPACE + ".skin")) ||
|
1188
|
-
'null') || this.skin;
|
1189
|
-
var allCategories = __spread(i1.categories);
|
1190
|
-
if (this.custom.length > 0) {
|
1191
|
-
this.CUSTOM_CATEGORY.emojis = this.custom.map(function (emoji) {
|
1192
|
-
return Object.assign(Object.assign({}, emoji), {
|
1193
|
-
// `<Category />` expects emoji to have an `id`.
|
1194
|
-
id: emoji.shortNames[0], custom: true
|
1195
|
-
});
|
1196
|
-
});
|
1197
|
-
allCategories.push(this.CUSTOM_CATEGORY);
|
1198
|
-
}
|
1199
|
-
if (this.include !== undefined) {
|
1200
|
-
allCategories.sort(function (a, b) {
|
1201
|
-
if (_this.include.indexOf(a.id) > _this.include.indexOf(b.id)) {
|
1202
|
-
return 1;
|
1203
|
-
}
|
1204
|
-
return -1;
|
1205
|
-
});
|
1206
|
-
}
|
1207
|
-
try {
|
1208
|
-
for (var allCategories_1 = __values(allCategories), allCategories_1_1 = allCategories_1.next(); !allCategories_1_1.done; allCategories_1_1 = allCategories_1.next()) {
|
1209
|
-
var category = allCategories_1_1.value;
|
1210
|
-
var isIncluded = this.include && this.include.length ? this.include.indexOf(category.id) > -1 : true;
|
1211
|
-
var isExcluded = this.exclude && this.exclude.length ? this.exclude.indexOf(category.id) > -1 : false;
|
1212
|
-
if (!isIncluded || isExcluded) {
|
1213
|
-
continue;
|
1214
|
-
}
|
1215
|
-
if (this.emojisToShowFilter) {
|
1216
|
-
var newEmojis = [];
|
1217
|
-
var emojis = category.emojis;
|
1218
|
-
// tslint:disable-next-line: prefer-for-of
|
1219
|
-
for (var emojiIndex = 0; emojiIndex < emojis.length; emojiIndex++) {
|
1220
|
-
var emoji = emojis[emojiIndex];
|
1221
|
-
if (this.emojisToShowFilter(emoji)) {
|
1222
|
-
newEmojis.push(emoji);
|
1223
|
-
}
|
1224
|
-
}
|
1225
|
-
if (newEmojis.length) {
|
1226
|
-
var newCategory = {
|
1227
|
-
emojis: newEmojis,
|
1228
|
-
name: category.name,
|
1229
|
-
id: category.id,
|
1230
|
-
};
|
1231
|
-
this.categories.push(newCategory);
|
1232
|
-
}
|
1233
|
-
}
|
1234
|
-
else {
|
1235
|
-
this.categories.push(category);
|
1236
|
-
}
|
1237
|
-
this.categoriesIcons = Object.assign(Object.assign({}, categories), this.categoriesIcons);
|
1238
|
-
this.searchIcons = Object.assign(Object.assign({}, search), this.searchIcons);
|
1239
|
-
}
|
1240
|
-
}
|
1241
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
1242
|
-
finally {
|
1243
|
-
try {
|
1244
|
-
if (allCategories_1_1 && !allCategories_1_1.done && (_b = allCategories_1.return)) _b.call(allCategories_1);
|
1245
|
-
}
|
1246
|
-
finally { if (e_1) throw e_1.error; }
|
1247
|
-
}
|
1248
|
-
var includeRecent = this.include && this.include.length
|
1249
|
-
? this.include.indexOf(this.RECENT_CATEGORY.id) > -1
|
1250
|
-
: true;
|
1251
|
-
var excludeRecent = this.exclude && this.exclude.length
|
1252
|
-
? this.exclude.indexOf(this.RECENT_CATEGORY.id) > -1
|
1253
|
-
: false;
|
1254
|
-
if (includeRecent && !excludeRecent) {
|
1255
|
-
this.hideRecent = false;
|
1256
|
-
this.categories.unshift(this.RECENT_CATEGORY);
|
1257
|
-
}
|
1258
|
-
if (this.categories[0]) {
|
1259
|
-
this.categories[0].first = true;
|
1260
|
-
}
|
1261
|
-
this.categories.unshift(this.SEARCH_CATEGORY);
|
1262
|
-
this.selected = this.categories.filter(function (category) { return category.first; })[0].name;
|
1263
|
-
// Need to be careful if small number of categories
|
1264
|
-
var categoriesToLoadFirst = Math.min(this.categories.length, 3);
|
1265
|
-
this.setActiveCategories((this.activeCategories = this.categories.slice(0, categoriesToLoadFirst)));
|
1266
|
-
// Trim last active category
|
1267
|
-
var lastActiveCategoryEmojis = this.categories[categoriesToLoadFirst - 1].emojis.slice();
|
1268
|
-
this.categories[categoriesToLoadFirst - 1].emojis = lastActiveCategoryEmojis.slice(0, 60);
|
1269
|
-
setTimeout(function () {
|
1270
|
-
// Restore last category
|
1271
|
-
_this.categories[categoriesToLoadFirst - 1].emojis = lastActiveCategoryEmojis;
|
1272
|
-
_this.setActiveCategories(_this.categories);
|
1273
|
-
// The `setTimeout` will trigger the change detection, but since we're inside
|
1274
|
-
// the OnPush component we can run change detection locally starting from this
|
1275
|
-
// component and going down to the children.
|
1276
|
-
_this.ref.detectChanges();
|
1277
|
-
// tslint:disable-next-line: no-unused-expression
|
1278
|
-
common.isPlatformBrowser(_this.platformId) &&
|
1279
|
-
_this.ngZone.runOutsideAngular(function () {
|
1280
|
-
// The `updateCategoriesSize` doesn't change properties that are used
|
1281
|
-
// in templates, thus this is run in the context of the root zone to avoid
|
1282
|
-
// running change detection.
|
1283
|
-
requestAnimationFrame(function () {
|
1284
|
-
_this.updateCategoriesSize();
|
1285
|
-
});
|
1286
|
-
});
|
1287
|
-
});
|
1288
|
-
this.ngZone.runOutsideAngular(function () {
|
1289
|
-
// DOM events that are listened by Angular inside the template trigger change detection
|
1290
|
-
// and also wrapped into additional functions that call `markForCheck()`. We listen `scroll`
|
1291
|
-
// in the context of the root zone since it will not trigger change detection each time
|
1292
|
-
// the `scroll` event is dispatched.
|
1293
|
-
_this.scrollListener = _this.renderer.listen(_this.scrollRef.nativeElement, 'scroll', function () {
|
1294
|
-
_this.handleScroll();
|
1295
|
-
});
|
1296
|
-
});
|
1297
|
-
};
|
1298
|
-
PickerComponent.prototype.ngOnDestroy = function () {
|
1299
|
-
this.scrollListener();
|
1300
|
-
// This is called here because the component might be destroyed
|
1301
|
-
// but there will still be a `requestAnimationFrame` callback in the queue
|
1302
|
-
// that calls `detectChanges()` on the `ViewRef`. This will lead to a runtime
|
1303
|
-
// exception if the `detectChanges()` is called after the `ViewRef` is destroyed.
|
1304
|
-
this.cancelAnimationFrame();
|
1305
|
-
};
|
1306
|
-
PickerComponent.prototype.setActiveCategories = function (categoriesToMakeActive) {
|
1307
|
-
var _this = this;
|
1308
|
-
if (this.showSingleCategory) {
|
1309
|
-
this.activeCategories = categoriesToMakeActive.filter(function (x) { return x.name === _this.selected || x === _this.SEARCH_CATEGORY; });
|
1310
|
-
}
|
1311
|
-
else {
|
1312
|
-
this.activeCategories = categoriesToMakeActive;
|
1313
|
-
}
|
1314
|
-
};
|
1315
|
-
PickerComponent.prototype.updateCategoriesSize = function () {
|
1316
|
-
this.categoryRefs.forEach(function (component) { return component.memoizeSize(); });
|
1317
|
-
if (this.scrollRef) {
|
1318
|
-
var target = this.scrollRef.nativeElement;
|
1319
|
-
this.scrollHeight = target.scrollHeight;
|
1320
|
-
this.clientHeight = target.clientHeight;
|
1321
|
-
this.clientWidth = target.clientWidth;
|
1322
|
-
}
|
1323
|
-
};
|
1324
|
-
PickerComponent.prototype.handleAnchorClick = function ($event) {
|
1325
|
-
var e_2, _b;
|
1326
|
-
var _a;
|
1327
|
-
this.updateCategoriesSize();
|
1328
|
-
this.selected = $event.category.name;
|
1329
|
-
this.setActiveCategories(this.categories);
|
1330
|
-
if (this.SEARCH_CATEGORY.emojis) {
|
1331
|
-
this.handleSearch(null);
|
1332
|
-
(_a = this.searchRef) === null || _a === void 0 ? void 0 : _a.clear();
|
1333
|
-
this.handleAnchorClick($event);
|
1334
|
-
return;
|
1335
|
-
}
|
1336
|
-
var component = this.categoryRefs.find(function (n) { return n.id === $event.category.id; });
|
1337
|
-
if (component) {
|
1338
|
-
var top = component.top;
|
1339
|
-
if ($event.category.first) {
|
1340
|
-
top = 0;
|
1341
|
-
}
|
1342
|
-
else {
|
1343
|
-
top += 1;
|
1344
|
-
}
|
1345
|
-
this.scrollRef.nativeElement.scrollTop = top;
|
1346
|
-
}
|
1347
|
-
this.nextScroll = $event.category.name;
|
1348
|
-
var _loop_1 = function (category) {
|
1349
|
-
var componentToScroll = this_1.categoryRefs.find(function (_b) {
|
1350
|
-
var id = _b.id;
|
1351
|
-
return id === category.id;
|
1352
|
-
});
|
1353
|
-
componentToScroll === null || componentToScroll === void 0 ? void 0 : componentToScroll.handleScroll(this_1.scrollRef.nativeElement.scrollTop);
|
1354
|
-
};
|
1355
|
-
var this_1 = this;
|
1356
|
-
try {
|
1357
|
-
// handle component scrolling to load emojis
|
1358
|
-
for (var _c = __values(this.categories), _d = _c.next(); !_d.done; _d = _c.next()) {
|
1359
|
-
var category = _d.value;
|
1360
|
-
_loop_1(category);
|
1361
|
-
}
|
1362
|
-
}
|
1363
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
1364
|
-
finally {
|
1365
|
-
try {
|
1366
|
-
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
1367
|
-
}
|
1368
|
-
finally { if (e_2) throw e_2.error; }
|
1369
|
-
}
|
1370
|
-
};
|
1371
|
-
PickerComponent.prototype.categoryTrack = function (index, item) {
|
1372
|
-
return item.id;
|
1373
|
-
};
|
1374
|
-
PickerComponent.prototype.handleScroll = function (noSelectionChange) {
|
1375
|
-
var e_3, _b;
|
1376
|
-
if (noSelectionChange === void 0) { noSelectionChange = false; }
|
1377
|
-
if (this.nextScroll) {
|
1378
|
-
this.selected = this.nextScroll;
|
1379
|
-
this.nextScroll = undefined;
|
1380
|
-
this.ref.detectChanges();
|
1381
|
-
return;
|
1382
|
-
}
|
1383
|
-
if (!this.scrollRef) {
|
1384
|
-
return;
|
1385
|
-
}
|
1386
|
-
if (this.showSingleCategory) {
|
1387
|
-
return;
|
1388
|
-
}
|
1389
|
-
var activeCategory;
|
1390
|
-
if (this.SEARCH_CATEGORY.emojis) {
|
1391
|
-
activeCategory = this.SEARCH_CATEGORY;
|
1392
|
-
}
|
1393
|
-
else {
|
1394
|
-
var target = this.scrollRef.nativeElement;
|
1395
|
-
// check scroll is not at bottom
|
1396
|
-
if (target.scrollTop === 0) {
|
1397
|
-
// hit the TOP
|
1398
|
-
activeCategory = this.categories.find(function (n) { return n.first === true; });
|
1399
|
-
}
|
1400
|
-
else if (target.scrollHeight - target.scrollTop === this.clientHeight) {
|
1401
|
-
// scrolled to bottom activate last category
|
1402
|
-
activeCategory = this.categories[this.categories.length - 1];
|
1403
|
-
}
|
1404
|
-
else {
|
1405
|
-
var _loop_2 = function (category) {
|
1406
|
-
var component = this_2.categoryRefs.find(function (_b) {
|
1407
|
-
var id = _b.id;
|
1408
|
-
return id === category.id;
|
1409
|
-
});
|
1410
|
-
var active = component === null || component === void 0 ? void 0 : component.handleScroll(target.scrollTop);
|
1411
|
-
if (active) {
|
1412
|
-
activeCategory = category;
|
1413
|
-
}
|
1414
|
-
};
|
1415
|
-
var this_2 = this;
|
1416
|
-
try {
|
1417
|
-
// scrolling
|
1418
|
-
for (var _c = __values(this.categories), _d = _c.next(); !_d.done; _d = _c.next()) {
|
1419
|
-
var category = _d.value;
|
1420
|
-
_loop_2(category);
|
1421
|
-
}
|
1422
|
-
}
|
1423
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
1424
|
-
finally {
|
1425
|
-
try {
|
1426
|
-
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
1427
|
-
}
|
1428
|
-
finally { if (e_3) throw e_3.error; }
|
1429
|
-
}
|
1430
|
-
}
|
1431
|
-
this.scrollTop = target.scrollTop;
|
1432
|
-
}
|
1433
|
-
// This will allow us to run the change detection only when the category changes.
|
1434
|
-
if (!noSelectionChange && activeCategory && activeCategory.name !== this.selected) {
|
1435
|
-
this.selected = activeCategory.name;
|
1436
|
-
this.ref.detectChanges();
|
1437
|
-
}
|
1438
|
-
else if (noSelectionChange) {
|
1439
|
-
this.ref.detectChanges();
|
1440
|
-
}
|
1441
|
-
};
|
1442
|
-
PickerComponent.prototype.handleSearch = function ($emojis) {
|
1443
|
-
var e_4, _b;
|
1444
|
-
this.SEARCH_CATEGORY.emojis = $emojis;
|
1445
|
-
try {
|
1446
|
-
for (var _c = __values(this.categoryRefs.toArray()), _d = _c.next(); !_d.done; _d = _c.next()) {
|
1447
|
-
var component = _d.value;
|
1448
|
-
if (component.name === 'Search') {
|
1449
|
-
component.emojis = $emojis;
|
1450
|
-
component.updateDisplay($emojis ? 'block' : 'none');
|
1451
|
-
}
|
1452
|
-
else {
|
1453
|
-
component.updateDisplay($emojis ? 'none' : 'block');
|
1454
|
-
}
|
1455
|
-
}
|
1456
|
-
}
|
1457
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
1458
|
-
finally {
|
1459
|
-
try {
|
1460
|
-
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
1461
|
-
}
|
1462
|
-
finally { if (e_4) throw e_4.error; }
|
1463
|
-
}
|
1464
|
-
this.scrollRef.nativeElement.scrollTop = 0;
|
1465
|
-
this.handleScroll();
|
1466
|
-
};
|
1467
|
-
PickerComponent.prototype.handleEnterKey = function ($event, emoji) {
|
1468
|
-
if (!emoji) {
|
1469
|
-
if (this.SEARCH_CATEGORY.emojis !== null && this.SEARCH_CATEGORY.emojis.length) {
|
1470
|
-
emoji = this.SEARCH_CATEGORY.emojis[0];
|
1471
|
-
if (emoji) {
|
1472
|
-
this.emojiSelect.emit({ $event: $event, emoji: emoji });
|
1473
|
-
}
|
1474
|
-
else {
|
1475
|
-
return;
|
1476
|
-
}
|
1477
|
-
}
|
1478
|
-
}
|
1479
|
-
if (!this.hideRecent && !this.recent && emoji) {
|
1480
|
-
this.frequently.add(emoji);
|
1481
|
-
}
|
1482
|
-
var component = this.categoryRefs.toArray()[1];
|
1483
|
-
if (component && this.enableFrequentEmojiSort) {
|
1484
|
-
component.getEmojis();
|
1485
|
-
component.ref.markForCheck();
|
1486
|
-
}
|
1487
|
-
};
|
1488
|
-
PickerComponent.prototype.handleEmojiOver = function ($event) {
|
1489
|
-
var _a;
|
1490
|
-
if (!this.showPreview || !this.previewRef) {
|
1491
|
-
return;
|
1492
|
-
}
|
1493
|
-
var emojiData = this.CUSTOM_CATEGORY.emojis.find(function (customEmoji) { return customEmoji.id === $event.emoji.id; });
|
1494
|
-
if (emojiData) {
|
1495
|
-
$event.emoji = Object.assign({}, emojiData);
|
1496
|
-
}
|
1497
|
-
this.previewEmoji = $event.emoji;
|
1498
|
-
this.cancelAnimationFrame();
|
1499
|
-
(_a = this.ref) === null || _a === void 0 ? void 0 : _a.detectChanges();
|
1500
|
-
};
|
1501
|
-
PickerComponent.prototype.handleEmojiLeave = function () {
|
1502
|
-
var _this = this;
|
1503
|
-
if (!this.showPreview || !this.previewRef) {
|
1504
|
-
return;
|
1505
|
-
}
|
1506
|
-
this.ngZone.runOutsideAngular(function () {
|
1507
|
-
_this.animationFrameRequestId = requestAnimationFrame(function () {
|
1508
|
-
_this.previewEmoji = null;
|
1509
|
-
_this.ref.detectChanges();
|
1510
|
-
});
|
1511
|
-
});
|
1512
|
-
};
|
1513
|
-
PickerComponent.prototype.handleEmojiClick = function ($event) {
|
1514
|
-
this.emojiClick.emit($event);
|
1515
|
-
this.emojiSelect.emit($event);
|
1516
|
-
this.handleEnterKey($event.$event, $event.emoji);
|
1517
|
-
};
|
1518
|
-
PickerComponent.prototype.handleSkinChange = function (skin) {
|
1519
|
-
this.skin = skin;
|
1520
|
-
localStorage.setItem(this.NAMESPACE + ".skin", String(skin));
|
1521
|
-
this.skinChange.emit(skin);
|
1522
|
-
};
|
1523
|
-
PickerComponent.prototype.getWidth = function () {
|
1524
|
-
if (this.style && this.style.width) {
|
1525
|
-
return this.style.width;
|
1526
|
-
}
|
1527
|
-
return this.perLine * (this.emojiSize + 12) + 12 + 2 + this.measureScrollbar + 'px';
|
1528
|
-
};
|
1529
|
-
PickerComponent.prototype.cancelAnimationFrame = function () {
|
1530
|
-
if (this.animationFrameRequestId !== null) {
|
1531
|
-
cancelAnimationFrame(this.animationFrameRequestId);
|
1532
|
-
this.animationFrameRequestId = null;
|
1533
|
-
}
|
1534
|
-
};
|
1535
|
-
return PickerComponent;
|
1536
|
-
}());
|
1537
|
-
PickerComponent.decorators = [
|
1538
|
-
{ type: i0.Component, args: [{
|
1539
|
-
selector: 'emoji-mart',
|
1540
|
-
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",
|
1541
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
1542
|
-
preserveWhitespaces: false
|
1543
|
-
},] }
|
1544
|
-
];
|
1545
|
-
PickerComponent.ctorParameters = function () { return [
|
1546
|
-
{ type: i0.NgZone },
|
1547
|
-
{ type: i0.Renderer2 },
|
1548
|
-
{ type: i0.ChangeDetectorRef },
|
1549
|
-
{ type: EmojiFrequentlyService },
|
1550
|
-
{ type: String, decorators: [{ type: i0.Inject, args: [i0.PLATFORM_ID,] }] }
|
1551
|
-
]; };
|
1552
|
-
PickerComponent.propDecorators = {
|
1553
|
-
perLine: [{ type: i0.Input }],
|
1554
|
-
totalFrequentLines: [{ type: i0.Input }],
|
1555
|
-
i18n: [{ type: i0.Input }],
|
1556
|
-
style: [{ type: i0.Input }],
|
1557
|
-
title: [{ type: i0.Input }],
|
1558
|
-
emoji: [{ type: i0.Input }],
|
1559
|
-
darkMode: [{ type: i0.Input }],
|
1560
|
-
color: [{ type: i0.Input }],
|
1561
|
-
hideObsolete: [{ type: i0.Input }],
|
1562
|
-
categories: [{ type: i0.Input }],
|
1563
|
-
activeCategories: [{ type: i0.Input }],
|
1564
|
-
set: [{ type: i0.Input }],
|
1565
|
-
skin: [{ type: i0.Input }],
|
1566
|
-
isNative: [{ type: i0.Input }],
|
1567
|
-
emojiSize: [{ type: i0.Input }],
|
1568
|
-
sheetSize: [{ type: i0.Input }],
|
1569
|
-
emojisToShowFilter: [{ type: i0.Input }],
|
1570
|
-
showPreview: [{ type: i0.Input }],
|
1571
|
-
emojiTooltip: [{ type: i0.Input }],
|
1572
|
-
autoFocus: [{ type: i0.Input }],
|
1573
|
-
custom: [{ type: i0.Input }],
|
1574
|
-
hideRecent: [{ type: i0.Input }],
|
1575
|
-
imageUrlFn: [{ type: i0.Input }],
|
1576
|
-
include: [{ type: i0.Input }],
|
1577
|
-
exclude: [{ type: i0.Input }],
|
1578
|
-
notFoundEmoji: [{ type: i0.Input }],
|
1579
|
-
categoriesIcons: [{ type: i0.Input }],
|
1580
|
-
searchIcons: [{ type: i0.Input }],
|
1581
|
-
useButton: [{ type: i0.Input }],
|
1582
|
-
enableFrequentEmojiSort: [{ type: i0.Input }],
|
1583
|
-
enableSearch: [{ type: i0.Input }],
|
1584
|
-
showSingleCategory: [{ type: i0.Input }],
|
1585
|
-
virtualize: [{ type: i0.Input }],
|
1586
|
-
virtualizeOffset: [{ type: i0.Input }],
|
1587
|
-
recent: [{ type: i0.Input }],
|
1588
|
-
emojiClick: [{ type: i0.Output }],
|
1589
|
-
emojiSelect: [{ type: i0.Output }],
|
1590
|
-
skinChange: [{ type: i0.Output }],
|
1591
|
-
scrollRef: [{ type: i0.ViewChild, args: ['scrollRef', { static: true },] }],
|
1592
|
-
previewRef: [{ type: i0.ViewChild, args: [PreviewComponent, { static: false },] }],
|
1593
|
-
searchRef: [{ type: i0.ViewChild, args: [SearchComponent, { static: false },] }],
|
1594
|
-
categoryRefs: [{ type: i0.ViewChildren, args: [CategoryComponent,] }],
|
1595
|
-
backgroundImageFn: [{ type: i0.Input }]
|
1596
|
-
};
|
1597
|
-
|
1598
|
-
var SkinComponent = /** @class */ (function () {
|
1599
|
-
function SkinComponent() {
|
1600
|
-
this.changeSkin = new i0.EventEmitter();
|
1601
|
-
this.opened = false;
|
1602
|
-
this.skinTones = [1, 2, 3, 4, 5, 6];
|
1603
|
-
}
|
1604
|
-
SkinComponent.prototype.toggleOpen = function () {
|
1605
|
-
this.opened = !this.opened;
|
1606
|
-
};
|
1607
|
-
SkinComponent.prototype.isSelected = function (skinTone) {
|
1608
|
-
return skinTone === this.skin;
|
1609
|
-
};
|
1610
|
-
SkinComponent.prototype.isVisible = function (skinTone) {
|
1611
|
-
return this.opened || this.isSelected(skinTone);
|
1612
|
-
};
|
1613
|
-
SkinComponent.prototype.pressed = function (skinTone) {
|
1614
|
-
return this.opened ? !!this.isSelected(skinTone) : '';
|
1615
|
-
};
|
1616
|
-
SkinComponent.prototype.tabIndex = function (skinTone) {
|
1617
|
-
return this.isVisible(skinTone) ? '0' : '';
|
1618
|
-
};
|
1619
|
-
SkinComponent.prototype.expanded = function (skinTone) {
|
1620
|
-
return this.isSelected(skinTone) ? this.opened : '';
|
1621
|
-
};
|
1622
|
-
SkinComponent.prototype.handleClick = function (skin) {
|
1623
|
-
if (!this.opened) {
|
1624
|
-
this.opened = true;
|
1625
|
-
return;
|
1626
|
-
}
|
1627
|
-
this.opened = false;
|
1628
|
-
if (skin !== this.skin) {
|
1629
|
-
this.changeSkin.emit(skin);
|
1630
|
-
}
|
1631
|
-
};
|
1632
|
-
return SkinComponent;
|
1633
|
-
}());
|
1634
|
-
SkinComponent.decorators = [
|
1635
|
-
{ type: i0.Component, args: [{
|
1636
|
-
selector: 'emoji-skins',
|
1637
|
-
template: "\n <section\n class=\"emoji-mart-skin-swatches\"\n [class.opened]=\"opened\"\n >\n <span\n *ngFor=\"let skinTone of skinTones\"\n class=\"emoji-mart-skin-swatch\"\n [class.selected]=\"skinTone === skin\"\n >\n <span\n (click)=\"this.handleClick(skinTone)\"\n (keyup.enter)=\"handleClick(skinTone)\"\n (keyup.space)=\"handleClick(skinTone)\"\n class=\"emoji-mart-skin emoji-mart-skin-tone-{{ skinTone }}\"\n role=\"button\"\n [tabIndex]=\"tabIndex(skinTone)\"\n [attr.aria-hidden]=\"!isVisible(skinTone)\"\n [attr.aria-pressed]=\"pressed(skinTone)\"\n [attr.aria-haspopup]=\"!!isSelected(skinTone)\"\n [attr.aria-expanded]=\"expanded(skinTone)\"\n [attr.aria-label]=\"i18n.skintones[skinTone]\"\n [title]=\"i18n.skintones[skinTone]\"\n ></span>\n </span>\n </section>\n ",
|
1638
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
1639
|
-
preserveWhitespaces: false
|
1640
|
-
},] }
|
1641
|
-
];
|
1642
|
-
SkinComponent.propDecorators = {
|
1643
|
-
skin: [{ type: i0.Input }],
|
1644
|
-
i18n: [{ type: i0.Input }],
|
1645
|
-
changeSkin: [{ type: i0.Output }]
|
1646
|
-
};
|
1647
|
-
|
1648
|
-
var PickerModule = /** @class */ (function () {
|
1649
|
-
function PickerModule() {
|
1650
|
-
}
|
1651
|
-
return PickerModule;
|
1652
|
-
}());
|
1653
|
-
PickerModule.decorators = [
|
1654
|
-
{ type: i0.NgModule, args: [{
|
1655
|
-
imports: [common.CommonModule, forms.FormsModule, i1.EmojiModule],
|
1656
|
-
exports: [
|
1657
|
-
PickerComponent,
|
1658
|
-
AnchorsComponent,
|
1659
|
-
CategoryComponent,
|
1660
|
-
SearchComponent,
|
1661
|
-
PreviewComponent,
|
1662
|
-
SkinComponent,
|
1663
|
-
],
|
1664
|
-
declarations: [
|
1665
|
-
PickerComponent,
|
1666
|
-
AnchorsComponent,
|
1667
|
-
CategoryComponent,
|
1668
|
-
SearchComponent,
|
1669
|
-
PreviewComponent,
|
1670
|
-
SkinComponent,
|
1671
|
-
],
|
1672
|
-
},] }
|
1673
|
-
];
|
1674
|
-
|
1675
|
-
/**
|
1676
|
-
* Generated bundle index. Do not edit.
|
1677
|
-
*/
|
1678
|
-
|
1679
|
-
exports.AnchorsComponent = AnchorsComponent;
|
1680
|
-
exports.CategoryComponent = CategoryComponent;
|
1681
|
-
exports.EmojiFrequentlyService = EmojiFrequentlyService;
|
1682
|
-
exports.EmojiSearch = EmojiSearch;
|
1683
|
-
exports.PickerComponent = PickerComponent;
|
1684
|
-
exports.PickerModule = PickerModule;
|
1685
|
-
exports.PreviewComponent = PreviewComponent;
|
1686
|
-
exports.SearchComponent = SearchComponent;
|
1687
|
-
exports.SkinComponent = SkinComponent;
|
1688
|
-
|
1689
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
1690
|
-
|
1691
|
-
})));
|
1692
|
-
//# sourceMappingURL=ctrl-ngx-emoji-mart.umd.js.map
|