/
emoji-picker.js
3998 lines (3329 loc) · 683 KB
/
emoji-picker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("React"));
else if(typeof define === 'function' && define.amd)
define(["React"], factory);
else if(typeof exports === 'object')
exports["EmojiPicker"] = factory(require("React"));
else
root["EmojiPicker"] = factory(root["React"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_3__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _components = __webpack_require__(1);
Object.defineProperty(exports, 'Picker', {
enumerable: true,
get: function get() {
return _components.Picker;
}
});
Object.defineProperty(exports, 'Emoji', {
enumerable: true,
get: function get() {
return _components.Emoji;
}
});
var _utils = __webpack_require__(16);
Object.defineProperty(exports, 'emojiIndex', {
enumerable: true,
get: function get() {
return _utils.emojiIndex;
}
});
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _anchors = __webpack_require__(2);
Object.defineProperty(exports, 'Anchors', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_anchors).default;
}
});
var _category = __webpack_require__(15);
Object.defineProperty(exports, 'Category', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_category).default;
}
});
var _emoji = __webpack_require__(22);
Object.defineProperty(exports, 'Emoji', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_emoji).default;
}
});
var _picker = __webpack_require__(23);
Object.defineProperty(exports, 'Picker', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_picker).default;
}
});
var _preview = __webpack_require__(25);
Object.defineProperty(exports, 'Preview', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_preview).default;
}
});
var _search = __webpack_require__(26);
Object.defineProperty(exports, 'Search', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_search).default;
}
});
var _skins = __webpack_require__(27);
Object.defineProperty(exports, 'Skins', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_skins).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ },
/* 2 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
var _svgInlineReact = __webpack_require__(4);
var _svgInlineReact2 = _interopRequireDefault(_svgInlineReact);
var _svgs = __webpack_require__(5);
var SVGs = _interopRequireWildcard(_svgs);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Anchors = function (_React$Component) {
_inherits(Anchors, _React$Component);
function Anchors(props) {
_classCallCheck(this, Anchors);
var _this = _possibleConstructorReturn(this, Object.getPrototypeOf(Anchors).call(this, props));
var defaultCategory = props.categories[0];
if (defaultCategory.anchor) {
defaultCategory = defaultCategory.anchor;
}
_this.state = {
selected: defaultCategory.name
};
return _this;
}
_createClass(Anchors, [{
key: 'render',
value: function render() {
var _props = this.props;
var categories = _props.categories;
var onAnchorClick = _props.onAnchorClick;
var selected = this.state.selected;
return _react2.default.createElement(
'div',
{ className: 'emoji-picker-anchors' },
categories.map(function (category, i) {
var name = category.name;
var anchor = category.anchor;
if (anchor) {
return null;
}
return _react2.default.createElement(
'span',
{
key: name,
title: name,
onClick: function onClick() {
return onAnchorClick(category, i);
},
className: 'emoji-picker-anchor ' + (name == selected ? 'emoji-picker-anchor-selected' : '')
},
_react2.default.createElement(_svgInlineReact2.default, { src: SVGs[name] }),
_react2.default.createElement('span', { className: 'emoji-picker-anchor-bar' })
);
})
);
}
}]);
return Anchors;
}(_react2.default.Component);
exports.default = Anchors;
Anchors.propTypes = {
categories: _react2.default.PropTypes.array,
onAnchorClick: _react2.default.PropTypes.func
};
Anchors.defaultProps = {
categories: [],
onAnchorClick: function onAnchorClick() {}
};
/***/ },
/* 3 */
/***/ function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
/***/ },
/* 4 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
var DOMParser = typeof window !== 'undefined' && window.DOMParser;
var process = process || {};
process.env = process.env || {};
var parserAvailable = typeof DOMParser !== 'undefined' && DOMParser.prototype != null && DOMParser.prototype.parseFromString != null;
if ("production" !== process.env.NODE_ENV && !parserAvailable) {
console.info('<InlineSVG />: `raw` prop works only when `window.DOMParser` exists.');
}
function isParsable(src) {
// kinda naive but meh, ain't gonna use full-blown parser for this
return parserAvailable && typeof src === 'string' && src.trim().substr(0, 4) === '<svg';
}
// parse SVG string using `DOMParser`
function parseFromSVGString(src) {
var parser = new DOMParser();
return parser.parseFromString(src, "image/svg+xml");
}
// Transform DOM prop/attr names applicable to `<svg>` element but react-limited
function switchSVGAttrToReactProp(propName) {
switch (propName) {
case 'class':
return 'className';
default:
return propName;
}
}
var InlineSVG = (function (_React$Component) {
_inherits(InlineSVG, _React$Component);
_createClass(InlineSVG, null, [{
key: 'defaultProps',
value: {
element: 'i',
raw: false,
src: ''
},
enumerable: true
}, {
key: 'propTypes',
value: {
src: _react2['default'].PropTypes.string.isRequired,
element: _react2['default'].PropTypes.string,
raw: _react2['default'].PropTypes.bool
},
enumerable: true
}]);
function InlineSVG(props) {
_classCallCheck(this, InlineSVG);
_get(Object.getPrototypeOf(InlineSVG.prototype), 'constructor', this).call(this, props);
this._extractSVGProps = this._extractSVGProps.bind(this);
}
// Serialize `Attr` objects in `NamedNodeMap`
_createClass(InlineSVG, [{
key: '_serializeAttrs',
value: function _serializeAttrs(map) {
var ret = {};
var prop = undefined;
for (var i = 0; i < map.length; i++) {
prop = switchSVGAttrToReactProp(map[i].name);
ret[prop] = map[i].value;
}
return ret;
}
// get <svg /> element props
}, {
key: '_extractSVGProps',
value: function _extractSVGProps(src) {
var map = parseFromSVGString(src).documentElement.attributes;
return map.length > 0 ? this._serializeAttrs(map) : null;
}
// get content inside <svg> element.
}, {
key: '_stripSVG',
value: function _stripSVG(src) {
return parseFromSVGString(src).documentElement.innerHTML;
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(_ref) {
var children = _ref.children;
if ("production" !== process.env.NODE_ENV && children != null) {
console.info('<InlineSVG />: `children` prop will be ignored.');
}
}
}, {
key: 'render',
value: function render() {
var Element = undefined,
__html = undefined,
svgProps = undefined;
var _props = this.props;
var element = _props.element;
var raw = _props.raw;
var src = _props.src;
if (raw === true && isParsable(src)) {
Element = 'svg';
svgProps = this._extractSVGProps(src);
__html = this._stripSVG(src);
}
__html = __html || src;
Element = Element || element;
svgProps = svgProps || {};
return _react2['default'].createElement(Element, _extends({}, svgProps, this.props, { src: null, children: null,
dangerouslySetInnerHTML: { __html: __html } }));
}
}]);
return InlineSVG;
})(_react2['default'].Component);
exports['default'] = InlineSVG;
module.exports = exports['default'];
/***/ },
/* 5 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _activity = __webpack_require__(6);
Object.defineProperty(exports, 'Activity', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_activity).default;
}
});
var _flags = __webpack_require__(7);
Object.defineProperty(exports, 'Flags', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_flags).default;
}
});
var _foods = __webpack_require__(8);
Object.defineProperty(exports, 'Foods', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_foods).default;
}
});
var _nature = __webpack_require__(9);
Object.defineProperty(exports, 'Nature', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_nature).default;
}
});
var _objects = __webpack_require__(10);
Object.defineProperty(exports, 'Objects', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_objects).default;
}
});
var _people = __webpack_require__(11);
Object.defineProperty(exports, 'People', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_people).default;
}
});
var _places = __webpack_require__(12);
Object.defineProperty(exports, 'Places', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_places).default;
}
});
var _recent = __webpack_require__(13);
Object.defineProperty(exports, 'Recent', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_recent).default;
}
});
var _symbols = __webpack_require__(14);
Object.defineProperty(exports, 'Symbols', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_symbols).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ },
/* 6 */
/***/ function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 0C5.373 0 0 5.372 0 12c0 6.627 5.373 12 12 12 6.628 0 12-5.373 12-12 0-6.628-5.372-12-12-12m9.949 11H17.05c.224-2.527 1.232-4.773 1.968-6.113A9.966 9.966 0 0 1 21.949 11M13 11V2.051a9.945 9.945 0 0 1 4.432 1.564c-.858 1.491-2.156 4.22-2.392 7.385H13zm-2 0H8.961c-.238-3.165-1.536-5.894-2.393-7.385A9.95 9.95 0 0 1 11 2.051V11zm0 2v8.949a9.937 9.937 0 0 1-4.432-1.564c.857-1.492 2.155-4.221 2.393-7.385H11zm4.04 0c.236 3.164 1.534 5.893 2.392 7.385A9.92 9.92 0 0 1 13 21.949V13h2.04zM4.982 4.887C5.718 6.227 6.726 8.473 6.951 11h-4.9a9.977 9.977 0 0 1 2.931-6.113M2.051 13h4.9c-.226 2.527-1.233 4.771-1.969 6.113A9.972 9.972 0 0 1 2.051 13m16.967 6.113c-.735-1.342-1.744-3.586-1.968-6.113h4.899a9.961 9.961 0 0 1-2.931 6.113\"></path></svg>"
/***/ },
/* 7 */
/***/ function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M0 0l6.084 24H8L1.916 0zM21 5h-4l-1-4H4l3 12h3l1 4h13L21 5zM6.563 3h7.875l2 8H8.563l-2-8zm8.832 10l-2.856 1.904L12.063 13h3.332zM19 13l-1.5-6h1.938l2 8H16l3-2z\"></path></svg>"
/***/ },
/* 8 */
/***/ function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M17 4.978c-1.838 0-2.876.396-3.68.934.513-1.172 1.768-2.934 4.68-2.934a1 1 0 0 0 0-2c-2.921 0-4.629 1.365-5.547 2.512-.064.078-.119.162-.18.244C11.73 1.838 10.798.023 9.207.023 8.579.022 7.85.306 7 .978 5.027 2.54 5.329 3.902 6.492 4.999 3.609 5.222 0 7.352 0 12.969c0 4.582 4.961 11.009 9 11.009 1.975 0 2.371-.486 3-1 .629.514 1.025 1 3 1 4.039 0 9-6.418 9-11 0-5.953-4.055-8-7-8M8.242 2.546c.641-.508.943-.523.965-.523.426.169.975 1.405 1.357 3.055-1.527-.629-2.741-1.352-2.98-1.846.059-.112.241-.356.658-.686M15 21.978c-1.08 0-1.21-.109-1.559-.402l-.176-.146c-.367-.302-.816-.452-1.266-.452s-.898.15-1.266.452l-.176.146c-.347.292-.477.402-1.557.402-2.813 0-7-5.389-7-9.009 0-5.823 4.488-5.991 5-5.991 1.939 0 2.484.471 3.387 1.251l.323.276a1.995 1.995 0 0 0 2.58 0l.323-.276c.902-.78 1.447-1.251 3.387-1.251.512 0 5 .168 5 6 0 3.617-4.187 9-7 9\"></path></svg>"
/***/ },
/* 9 */
/***/ function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M15.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 15.5 8M8.5 8a1.5 1.5 0 1 0 .001 3.001A1.5 1.5 0 0 0 8.5 8\"></path><path d=\"M18.933 0h-.027c-.97 0-2.138.787-3.018 1.497-1.274-.374-2.612-.51-3.887-.51-1.285 0-2.616.133-3.874.517C7.245.79 6.069 0 5.093 0h-.027C3.352 0 .07 2.67.002 7.026c-.039 2.479.276 4.238 1.04 5.013.254.258.882.677 1.295.882.191 3.177.922 5.238 2.536 6.38.897.637 2.187.949 3.2 1.102C8.04 20.6 8 20.795 8 21c0 1.773 2.35 3 4 3 1.648 0 4-1.227 4-3 0-.201-.038-.393-.072-.586 2.573-.385 5.435-1.877 5.925-7.587.396-.22.887-.568 1.104-.788.763-.774 1.079-2.534 1.04-5.013C23.929 2.67 20.646 0 18.933 0M3.223 9.135c-.237.281-.837 1.155-.884 1.238-.15-.41-.368-1.349-.337-3.291.051-3.281 2.478-4.972 3.091-5.031.256.015.731.27 1.265.646-1.11 1.171-2.275 2.915-2.352 5.125-.133.546-.398.858-.783 1.313M12 22c-.901 0-1.954-.693-2-1 0-.654.475-1.236 1-1.602V20a1 1 0 1 0 2 0v-.602c.524.365 1 .947 1 1.602-.046.307-1.099 1-2 1m3-3.48v.02a4.752 4.752 0 0 0-1.262-1.02c1.092-.516 2.239-1.334 2.239-2.217 0-1.842-1.781-2.195-3.977-2.195-2.196 0-3.978.354-3.978 2.195 0 .883 1.148 1.701 2.238 2.217A4.8 4.8 0 0 0 9 18.539v-.025c-1-.076-2.182-.281-2.973-.842-1.301-.92-1.838-3.045-1.853-6.478l.023-.041c.496-.826 1.49-1.45 1.804-3.102 0-2.047 1.357-3.631 2.362-4.522C9.37 3.178 10.555 3 11.948 3c1.447 0 2.685.192 3.733.57 1 .9 2.316 2.465 2.316 4.48.313 1.651 1.307 2.275 1.803 3.102.035.058.068.117.102.178-.059 5.967-1.949 7.01-4.902 7.19m6.628-8.202c-.037-.065-.074-.13-.113-.195a7.587 7.587 0 0 0-.739-.987c-.385-.455-.648-.768-.782-1.313-.076-2.209-1.241-3.954-2.353-5.124.531-.376 1.004-.63 1.261-.647.636.071 3.044 1.764 3.096 5.031.027 1.81-.347 3.218-.37 3.235\"></path></svg>"
/***/ },
/* 10 */
/***/ function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 0a9 9 0 0 0-5 16.482V21s2.035 3 5 3 5-3 5-3v-4.518A9 9 0 0 0 12 0zm0 2c3.86 0 7 3.141 7 7s-3.14 7-7 7-7-3.141-7-7 3.14-7 7-7zM9 17.477c.94.332 1.946.523 3 .523s2.06-.19 3-.523v.834c-.91.436-1.925.689-3 .689a6.924 6.924 0 0 1-3-.69v-.833zm.236 3.07A8.854 8.854 0 0 0 12 21c.965 0 1.888-.167 2.758-.451C14.155 21.173 13.153 22 12 22c-1.102 0-2.117-.789-2.764-1.453z\"></path><path d=\"M14.745 12.449h-.004c-.852-.024-1.188-.858-1.577-1.824-.421-1.061-.703-1.561-1.182-1.566h-.009c-.481 0-.783.497-1.235 1.537-.436.982-.801 1.811-1.636 1.791l-.276-.043c-.565-.171-.853-.691-1.284-1.794-.125-.313-.202-.632-.27-.913-.051-.213-.127-.53-.195-.634C7.067 9.004 7.039 9 6.99 9A1 1 0 0 1 7 7h.01c1.662.017 2.015 1.373 2.198 2.134.486-.981 1.304-2.058 2.797-2.075 1.531.018 2.28 1.153 2.731 2.141l.002-.008C14.944 8.424 15.327 7 16.979 7h.032A1 1 0 1 1 17 9h-.011c-.149.076-.256.474-.319.709a6.484 6.484 0 0 1-.311.951c-.429.973-.79 1.789-1.614 1.789\"></path></svg>"
/***/ },
/* 11 */
/***/ function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10\"></path><path d=\"M8 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 8 7M16 7a2 2 0 1 0-.001 3.999A2 2 0 0 0 16 7M15.232 15c-.693 1.195-1.87 2-3.349 2-1.477 0-2.655-.805-3.347-2H15m3-2H6a6 6 0 1 0 12 0\"></path></svg>"
/***/ },
/* 12 */
/***/ function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M6.5 12C5.122 12 4 13.121 4 14.5S5.122 17 6.5 17 9 15.879 9 14.5 7.878 12 6.5 12m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5M17.5 12c-1.378 0-2.5 1.121-2.5 2.5s1.122 2.5 2.5 2.5 2.5-1.121 2.5-2.5-1.122-2.5-2.5-2.5m0 3c-.275 0-.5-.225-.5-.5s.225-.5.5-.5.5.225.5.5-.225.5-.5.5\"></path><path d=\"M22.482 9.494l-1.039-.346L21.4 9h.6c.552 0 1-.439 1-.992 0-.006-.003-.008-.003-.008H23c0-1-.889-2-1.984-2h-.642l-.731-1.717C19.262 3.012 18.091 2 16.764 2H7.236C5.909 2 4.738 3.012 4.357 4.283L3.626 6h-.642C1.889 6 1 7 1 8h.003S1 8.002 1 8.008C1 8.561 1.448 9 2 9h.6l-.043.148-1.039.346a2.001 2.001 0 0 0-1.359 2.097l.751 7.508a1 1 0 0 0 .994.901H3v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h6v1c0 1.103.896 2 2 2h2c1.104 0 2-.897 2-2v-1h1.096a.999.999 0 0 0 .994-.901l.751-7.508a2.001 2.001 0 0 0-1.359-2.097M6.273 4.857C6.402 4.43 6.788 4 7.236 4h9.527c.448 0 .834.43.963.857L19.313 9H4.688l1.585-4.143zM7 21H5v-1h2v1zm12 0h-2v-1h2v1zm2.189-3H2.811l-.662-6.607L3 11h18l.852.393L21.189 18z\"></path></svg>"
/***/ },
/* 13 */
/***/ function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z\"></path><path d=\"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0m0 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10\"></path></svg>"
/***/ },
/* 14 */
/***/ function(module, exports) {
module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M0 0h11v2H0zM4 11h3V6h4V4H0v2h4zM15.5 17c1.381 0 2.5-1.116 2.5-2.493s-1.119-2.493-2.5-2.493S13 13.13 13 14.507 14.119 17 15.5 17m0-2.986c.276 0 .5.222.5.493 0 .272-.224.493-.5.493s-.5-.221-.5-.493.224-.493.5-.493M21.5 19.014c-1.381 0-2.5 1.116-2.5 2.493S20.119 24 21.5 24s2.5-1.116 2.5-2.493-1.119-2.493-2.5-2.493m0 2.986a.497.497 0 0 1-.5-.493c0-.271.224-.493.5-.493s.5.222.5.493a.497.497 0 0 1-.5.493M22 13l-9 9 1.513 1.5 8.99-9.009zM17 11c2.209 0 4-1.119 4-2.5V2s.985-.161 1.498.949C23.01 4.055 23 6 23 6s1-1.119 1-3.135C24-.02 21 0 21 0h-2v6.347A5.853 5.853 0 0 0 17 6c-2.209 0-4 1.119-4 2.5s1.791 2.5 4 2.5M10.297 20.482l-1.475-1.585a47.54 47.54 0 0 1-1.442 1.129c-.307-.288-.989-1.016-2.045-2.183.902-.836 1.479-1.466 1.729-1.892s.376-.871.376-1.336c0-.592-.273-1.178-.818-1.759-.546-.581-1.329-.871-2.349-.871-1.008 0-1.79.293-2.344.879-.556.587-.832 1.181-.832 1.784 0 .813.419 1.748 1.256 2.805-.847.614-1.444 1.208-1.794 1.784a3.465 3.465 0 0 0-.523 1.833c0 .857.308 1.56.924 2.107.616.549 1.423.823 2.42.823 1.173 0 2.444-.379 3.813-1.137L8.235 24h2.819l-2.09-2.383 1.333-1.135zm-6.736-6.389a1.02 1.02 0 0 1 .73-.286c.31 0 .559.085.747.254a.849.849 0 0 1 .283.659c0 .518-.419 1.112-1.257 1.784-.536-.651-.805-1.231-.805-1.742a.901.901 0 0 1 .302-.669M3.74 22c-.427 0-.778-.116-1.057-.349-.279-.232-.418-.487-.418-.766 0-.594.509-1.288 1.527-2.083.968 1.134 1.717 1.946 2.248 2.438-.921.507-1.686.76-2.3.76\"></path></svg>"
/***/ },
/* 15 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = __webpack_require__(3);
var _react2 = _interopRequireDefault(_react);
var _utils = __webpack_require__(16);
var _ = __webpack_require__(1);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var LABELS = {
'Search': 'Search Results',
'Recent': 'Frequently Used',
'People': 'Smileys & People',
'Nature': 'Animals & Nature',
'Foods': 'Food & Drink',
'Activity': 'Activity',
'Places': 'Travel & Places',
'Objects': 'Objects',
'Symbols': 'Symbols',
'Flags': 'Flags'
};
var Category = function (_React$Component) {
_inherits(Category, _React$Component);
function Category() {
_classCallCheck(this, Category);
return _possibleConstructorReturn(this, Object.getPrototypeOf(Category).apply(this, arguments));
}
_createClass(Category, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.container = this.refs.container;
this.label = this.refs.label;
this.parent = this.container.parentNode;
this.margin = 0;
this.minMargin = 0;
this.memoizeSize();
}
}, {
key: 'shouldComponentUpdate',
value: function shouldComponentUpdate(nextProps, nextState) {
var _props = this.props;
var name = _props.name;
var perLine = _props.perLine;
var emojis = _props.emojis;
var emojiProps = _props.emojiProps;
var skin = emojiProps.skin;
var size = emojiProps.size;
var sheetURL = emojiProps.sheetURL;
var nextPerLine = nextProps.perLine;
var nextEmojis = nextProps.emojis;
var nextEmojiProps = nextProps.emojiProps;
var nextSkin = nextEmojiProps.skin;
var nextSize = nextEmojiProps.size;
var nextSheetURL = nextEmojiProps.sheetURL;
var shouldUpdate = false;
if (name == 'Recent' && perLine != nextPerLine) {
shouldUpdate = true;
}
if (name == 'Search') {
shouldUpdate = !(emojis == nextEmojis);
}
if (skin != nextSkin || size != nextSize || sheetURL != nextSheetURL) {
shouldUpdate = true;
}
return shouldUpdate;
}
}, {
key: 'memoizeSize',
value: function memoizeSize() {
var _container$getBoundin = this.container.getBoundingClientRect();
var top = _container$getBoundin.top;
var height = _container$getBoundin.height;
var _parent$getBoundingCl = this.parent.getBoundingClientRect();
var parentTop = _parent$getBoundingCl.top;
var _label$getBoundingCli = this.label.getBoundingClientRect();
var labelHeight = _label$getBoundingCli.height;
this.top = top - parentTop + this.parent.scrollTop;
if (height == 0) {
this.maxMargin = 0;
} else {
this.maxMargin = height - labelHeight;
}
}
}, {
key: 'handleScroll',
value: function handleScroll(scrollTop) {
var margin = scrollTop - this.top;
margin = margin < this.minMargin ? this.minMargin : margin;
margin = margin > this.maxMargin ? this.maxMargin : margin;
if (margin == this.margin) return;
var name = this.props.name;
if (!this.props.hasStickyPosition) {
this.label.style.top = margin + 'px';
}
this.margin = margin;
return true;
}
}, {
key: 'getEmojis',
value: function getEmojis() {
var _props2 = this.props;
var name = _props2.name;
var emojis = _props2.emojis;
var perLine = _props2.perLine;
if (name == 'Recent') {
var frequentlyUsed = _utils.frequently.get(perLine * 4);
if (frequentlyUsed.length) {
emojis = frequentlyUsed;
}
}
if (emojis) {
emojis = emojis.slice(0);
}
return emojis;
}
}, {
key: 'updateDisplay',
value: function updateDisplay(display) {
var emojis = this.getEmojis();
if (!display && !emojis) {
return;
}
this.container.style.display = display;
}
}, {
key: 'render',
value: function render() {
var _props3 = this.props;
var name = _props3.name;
var hasStickyPosition = _props3.hasStickyPosition;
var emojiProps = _props3.emojiProps;
var emojis = this.getEmojis();
var labelStyles = {};
var labelSpanStyles = {};
var containerStyles = {};
if (!emojis) {
containerStyles = {
display: 'none'
};
}
if (!hasStickyPosition) {
labelStyles = {
height: 28
};
labelSpanStyles = {
position: 'absolute'
};
}
return _react2.default.createElement(
'div',
{ ref: 'container', className: 'emoji-picker-category', style: containerStyles },
_react2.default.createElement(
'div',
{ style: labelStyles, 'data-name': name, className: 'emoji-picker-category-label' },
_react2.default.createElement(
'span',
{ style: labelSpanStyles, ref: 'label' },
LABELS[name]
)
),
emojis && emojis.map(function (emoji) {
return _react2.default.createElement(_.Emoji, _extends({
key: emoji,
emoji: emoji
}, emojiProps));
}),
emojis && !emojis.length && _react2.default.createElement(
'div',
{ className: 'emoji-picker-no-results' },
_react2.default.createElement(_.Emoji, _extends({}, emojiProps, {
size: 22,
emoji: 'sleuth_or_spy'
})),
_react2.default.createElement(
'span',
{ className: 'emoji-picker-no-results-label' },
'No emoji found'
)
)
);
}
}]);
return Category;
}(_react2.default.Component);
exports.default = Category;
Category.propTypes = {
emojis: _react2.default.PropTypes.array,
hasStickyPosition: _react2.default.PropTypes.bool,
name: _react2.default.PropTypes.string.isRequired,
perLine: _react2.default.PropTypes.number.isRequired,
emojiProps: _react2.default.PropTypes.object.isRequired
};
Category.defaultProps = {
emojis: [],
hasStickyPosition: true
};
/***/ },
/* 16 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _store = __webpack_require__(17);
Object.defineProperty(exports, 'store', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_store).default;
}
});
var _emojiIndex = __webpack_require__(18);
Object.defineProperty(exports, 'emojiIndex', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_emojiIndex).default;
}
});
var _frequently = __webpack_require__(21);
Object.defineProperty(exports, 'frequently', {
enumerable: true,
get: function get() {
return _interopRequireDefault(_frequently).default;
}
});
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/***/ },
/* 17 */
/***/ function(module, exports) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var NAMESPACE = 'emoji-picker';
function update(state) {
for (var key in state) {
var value = state[key];
set(key, value);
}
}
function set(key, value) {
if (!('localStorage' in window)) return;
window.localStorage[NAMESPACE + '.' + key] = JSON.stringify(value);
}
function get(key) {
if (!('localStorage' in window)) return;
var value = window.localStorage[NAMESPACE + '.' + key];
if (value) {
return JSON.parse(value);
}
}
exports.default = { update: update, set: set, get: get };
/***/ },
/* 18 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _lunr = __webpack_require__(19);
var _lunr2 = _interopRequireDefault(_lunr);
var _data = __webpack_require__(20);
var _data2 = _interopRequireDefault(_data);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var index = (0, _lunr2.default)(function () {
this.pipeline.reset();
this.field('short_name', { boost: 2 });
this.field('emoticons');
this.field('name');
this.ref('id');
});
for (var emoji in _data2.default.emojis) {
var emojiData = _data2.default.emojis[emoji];
var short_name = emojiData.short_name;
var name = emojiData.name;
var emoticons = emojiData.emoticons;
index.add({
id: short_name,
emoticons: emoticons,
short_name: tokenize(short_name),
name: tokenize(name)
});
}
function search(value) {
var maxResults = arguments.length <= 1 || arguments[1] === undefined ? 75 : arguments[1];
var results = null;
if (value.length) {
results = index.search(tokenize(value)).map(function (result) {
return result.ref;
});
results = results.slice(0, maxResults);
}
return results;
}
function tokenize(string) {
if (['-', '-1', '+', '+1'].indexOf(string) == 0) {
return string.split('');
}
if (/(:|;|=)-/.test(string)) {
return [string];
}
return string.split(/[-|_|\s]+/);
}
exports.default = { search: search };
/***/ },
/* 19 */
/***/ function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.7.1
* Copyright (C) 2016 Oliver Nightingale
* @license MIT
*/
;(function(){
/**
* Convenience function for instantiating a new lunr index and configuring it
* with the default pipeline functions and the passed config function.
*
* When using this convenience function a new index will be created with the
* following functions already in the pipeline:
*
* lunr.StopWordFilter - filters out any stop words before they enter the
* index