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