react-input-emoji 4.1.0 → 4.3.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -1,11 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
+ var ReactDOM = require('react-dom');
4
5
  var PropTypes = require('prop-types');
5
6
 
6
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
8
 
8
9
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
10
+ var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
9
11
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
10
12
 
11
13
  function styleInject(css, ref) {
@@ -163,6 +165,7 @@ function handlePasteHtmlAtCaret(html) {
163
165
  if (window.getSelection) {
164
166
  // IE9 and non-IE
165
167
  sel = window.getSelection();
168
+ if (sel === null) return;
166
169
 
167
170
  if (sel.getRangeAt && sel.rangeCount) {
168
171
  range = sel.getRangeAt(0);
@@ -258,7 +261,7 @@ function replaceAllHtmlToString(html) {
258
261
  /**
259
262
  * @typedef {Object} Props
260
263
  * @property {React.Ref<any>} ref
261
- * @property {React.MutableRefObject<import('../text-input').Ref>} textInputRef
264
+ * @property {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef
262
265
  * @property {(value: string) => void} setValue
263
266
  * @property {() => void} emitChange
264
267
  */
@@ -288,10 +291,14 @@ function useExpose({
288
291
  },
289
292
 
290
293
  focus: () => {
294
+ if (textInputRef.current === null) return;
291
295
  textInputRef.current.focus();
292
296
  },
293
297
  blur: () => {
294
- sanitize(textInputRef.current.html);
298
+ if (textInputRef.current !== null) {
299
+ sanitize(textInputRef.current.html);
300
+ }
301
+
295
302
  emitChange();
296
303
  }
297
304
  }));
@@ -301,16 +308,17 @@ function useExpose({
301
308
 
302
309
  /**
303
310
  * useEmit
304
- * @param {React.MutableRefObject<import('../text-input').Ref>} textInputRef
311
+ * @param {React.MutableRefObject<import('../text-input').Ref | null>} textInputRef
305
312
  * @param {(size: {width: number, height: number}) => void} onResize
306
313
  * @param {(text: string) => void} onChange
307
314
  */
308
315
 
309
316
  function useEmit(textInputRef, onResize, onChange) {
317
+ /** @type {React.MutableRefObject<{width: number; height: number} | null>} */
310
318
  const currentSizeRef = React.useRef(null);
311
319
  const onChangeFn = React.useRef(onChange);
312
320
  const checkAndEmitResize = React.useCallback(() => {
313
- if (textInputRef.current) {
321
+ if (textInputRef.current !== null) {
314
322
  const currentSize = currentSizeRef.current;
315
323
  const nextSize = textInputRef.current.size;
316
324
 
@@ -344,7 +352,7 @@ function useEmit(textInputRef, onResize, onChange) {
344
352
  * @property {(event: React.KeyboardEvent) => void} onKeyDown
345
353
  * @property {(event: React.KeyboardEvent) => void} onKeyUp
346
354
  * @property {() => void} onFocus
347
- * @property {() => void=} onBlur
355
+ * @property {() => void} onBlur
348
356
  * @property {(sanitizedText: string) => void=} onChange
349
357
  * @property {(event: React.KeyboardEvent) => void} onArrowUp
350
358
  * @property {(event: React.KeyboardEvent) => void} onArrowDown
@@ -381,40 +389,63 @@ const TextInput = ({
381
389
  }, ref) => {
382
390
  React.useImperativeHandle(ref, () => ({
383
391
  appendContent: html => {
384
- textInputRef.current.focus();
392
+ if (textInputRef.current) {
393
+ textInputRef.current.focus();
394
+ }
395
+
385
396
  handlePasteHtmlAtCaret(html);
386
- textInputRef.current.focus();
387
397
 
388
- if (textInputRef.current.innerHTML.trim() === "") {
398
+ if (textInputRef.current) {
399
+ textInputRef.current.focus();
400
+ }
401
+
402
+ if (textInputRef.current && placeholderRef.current && textInputRef.current.innerHTML.trim() === "") {
389
403
  placeholderRef.current.style.visibility = "visible";
390
- } else {
404
+ } else if (placeholderRef.current) {
391
405
  placeholderRef.current.style.visibility = "hidden";
392
406
  }
393
407
 
394
- onChange(textInputRef.current.innerHTML);
408
+ if (textInputRef.current && typeof onChange === 'function') {
409
+ onChange(textInputRef.current.innerHTML);
410
+ }
395
411
  },
396
412
 
397
413
  set html(value) {
398
- textInputRef.current.innerHTML = value;
414
+ if (textInputRef.current) {
415
+ textInputRef.current.innerHTML = value;
416
+ }
399
417
 
400
- if (value.trim() === "") {
401
- placeholderRef.current.style.visibility = "visible";
402
- } else {
403
- placeholderRef.current.style.visibility = "hidden";
418
+ if (placeholderRef.current) {
419
+ if (value.trim() === "") {
420
+ placeholderRef.current.style.visibility = "visible";
421
+ } else {
422
+ placeholderRef.current.style.visibility = "hidden";
423
+ }
404
424
  }
405
425
 
406
- onChange(textInputRef.current.innerHTML);
426
+ if (typeof onChange === 'function' && textInputRef.current) {
427
+ onChange(textInputRef.current.innerHTML);
428
+ }
407
429
  },
408
430
 
409
431
  get html() {
432
+ if (!textInputRef.current) return '';
410
433
  return textInputRef.current.innerHTML;
411
434
  },
412
435
 
413
436
  get text() {
437
+ if (!textInputRef.current) return '';
414
438
  return textInputRef.current.innerText;
415
439
  },
416
440
 
417
441
  get size() {
442
+ if (!textInputRef.current) {
443
+ return {
444
+ width: 0,
445
+ height: 0
446
+ };
447
+ }
448
+
418
449
  return {
419
450
  width: textInputRef.current.offsetWidth,
420
451
  height: textInputRef.current.offsetHeight
@@ -422,14 +453,15 @@ const TextInput = ({
422
453
  },
423
454
 
424
455
  focus() {
456
+ if (!textInputRef.current) return;
425
457
  textInputRef.current.focus();
426
458
  }
427
459
 
428
460
  }));
429
- /** @type {React.MutableRefObject<HTMLDivElement>} */
461
+ /** @type {React.MutableRefObject<HTMLDivElement | null>} */
430
462
 
431
463
  const placeholderRef = React.useRef(null);
432
- /** @type {React.MutableRefObject<HTMLDivElement>} */
464
+ /** @type {React.MutableRefObject<HTMLDivElement | null>} */
433
465
 
434
466
  const textInputRef = React.useRef(null);
435
467
  /**
@@ -445,7 +477,7 @@ const TextInput = ({
445
477
  } else if (event.key === "ArrowDown") {
446
478
  props.onArrowDown(event);
447
479
  } else {
448
- if (event.key.length === 1) {
480
+ if (event.key.length === 1 && placeholderRef.current) {
449
481
  placeholderRef.current.style.visibility = "hidden";
450
482
  }
451
483
  }
@@ -465,30 +497,32 @@ const TextInput = ({
465
497
 
466
498
 
467
499
  function handleKeyUp(event) {
468
- var _input$innerText;
469
-
470
500
  props.onKeyUp(event);
471
501
  const input = textInputRef.current;
472
502
 
473
- if (((_input$innerText = input.innerText) === null || _input$innerText === void 0 ? void 0 : _input$innerText.trim()) === "") {
474
- placeholderRef.current.style.visibility = "visible";
475
- } else {
476
- placeholderRef.current.style.visibility = "hidden";
503
+ if (placeholderRef.current) {
504
+ if (input?.innerText?.trim() === "") {
505
+ placeholderRef.current.style.visibility = "visible";
506
+ } else {
507
+ placeholderRef.current.style.visibility = "hidden";
508
+ }
477
509
  }
478
510
 
479
- onChange(textInputRef.current.innerHTML);
511
+ if (typeof onChange === 'function' && textInputRef.current) {
512
+ onChange(textInputRef.current.innerHTML);
513
+ }
480
514
  }
481
515
 
482
- return /*#__PURE__*/React__default['default'].createElement("div", {
516
+ return /*#__PURE__*/React__default["default"].createElement("div", {
483
517
  className: "react-input-emoji--container",
484
518
  style: style
485
- }, /*#__PURE__*/React__default['default'].createElement("div", {
519
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
486
520
  className: "react-input-emoji--wrapper",
487
521
  onClick: handleClick
488
- }, /*#__PURE__*/React__default['default'].createElement("div", {
522
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
489
523
  ref: placeholderRef,
490
524
  className: "react-input-emoji--placeholder"
491
- }, placeholder), /*#__PURE__*/React__default['default'].createElement("div", {
525
+ }, placeholder), /*#__PURE__*/React__default["default"].createElement("div", {
492
526
  ref: textInputRef,
493
527
  onKeyDown: handleKeyDown,
494
528
  onKeyUp: handleKeyUp,
@@ -504,6 +538,51 @@ const TextInput = ({
504
538
 
505
539
  const TextInputWithRef = /*#__PURE__*/React.forwardRef(TextInput);
506
540
 
541
+ /* eslint-disable react/prop-types */
542
+ /**
543
+ * @typedef {object} Props
544
+ * @property {boolean} showPicker
545
+ * @property {(event: React.MouseEvent) => void} toggleShowPicker
546
+ * @property {HTMLDivElement=} buttonElement
547
+ */
548
+
549
+ /**
550
+ * Emoji Picker Button Component
551
+ * @param {Props} props
552
+ * @return {JSX.Element}
553
+ */
554
+
555
+ function EmojiPickerButton({
556
+ showPicker,
557
+ toggleShowPicker,
558
+ buttonElement
559
+ }) {
560
+ const buttonRef = React.useRef(null);
561
+ const [showCustomButtonContent, setShowCustomButtonContent] = React.useState(false);
562
+ React.useEffect(() => {
563
+ if ((buttonElement?.childNodes?.length ?? 0) > 2) {
564
+ buttonRef.current.appendChild(buttonElement?.childNodes[0]);
565
+ setShowCustomButtonContent(true);
566
+ }
567
+ }, [buttonElement?.childNodes]);
568
+ return /*#__PURE__*/React__default["default"].createElement("button", {
569
+ ref: buttonRef,
570
+ type: "button",
571
+ className: `react-input-emoji--button${showPicker ? " react-input-emoji--button__show" : ""}`,
572
+ onClick: toggleShowPicker
573
+ }, !showCustomButtonContent && /*#__PURE__*/React__default["default"].createElement("svg", {
574
+ xmlns: "http://www.w3.org/2000/svg",
575
+ viewBox: "0 0 24 24",
576
+ width: "24",
577
+ height: "24",
578
+ className: "react-input-emoji--button--icon"
579
+ }, /*#__PURE__*/React__default["default"].createElement("path", {
580
+ 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"
581
+ }), /*#__PURE__*/React__default["default"].createElement("path", {
582
+ 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"
583
+ })));
584
+ }
585
+
507
586
  var compressed = true;
508
587
  var categories$1 = [
509
588
  {
@@ -49308,23 +49387,20 @@ function _defineProperties(target, props) {
49308
49387
  function _createClass(Constructor, protoProps, staticProps) {
49309
49388
  if (protoProps) _defineProperties(Constructor.prototype, protoProps);
49310
49389
  if (staticProps) _defineProperties(Constructor, staticProps);
49390
+ Object.defineProperty(Constructor, "prototype", {
49391
+ writable: false
49392
+ });
49311
49393
  return Constructor;
49312
49394
  }
49313
49395
 
49314
49396
  function _typeof(obj) {
49315
49397
  "@babel/helpers - typeof";
49316
49398
 
49317
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
49318
- _typeof = function _typeof(obj) {
49319
- return typeof obj;
49320
- };
49321
- } else {
49322
- _typeof = function _typeof(obj) {
49323
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
49324
- };
49325
- }
49326
-
49327
- return _typeof(obj);
49399
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
49400
+ return typeof obj;
49401
+ } : function (obj) {
49402
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
49403
+ }, _typeof(obj);
49328
49404
  }
49329
49405
 
49330
49406
  var mapping = {
@@ -49414,8 +49490,8 @@ var stringFromCodePoint = _String.fromCodePoint || function stringFromCodePoint(
49414
49490
  codePoint > 0x10ffff || // not a valid Unicode code point
49415
49491
  Math.floor(codePoint) != codePoint // not an integer
49416
49492
  ) {
49417
- throw RangeError('Invalid code point: ' + codePoint);
49418
- }
49493
+ throw RangeError('Invalid code point: ' + codePoint);
49494
+ }
49419
49495
 
49420
49496
  if (codePoint <= 0xffff) {
49421
49497
  // BMP code point
@@ -50018,7 +50094,7 @@ function _defineProperty(obj, key, value) {
50018
50094
  }
50019
50095
 
50020
50096
  function _extends() {
50021
- _extends = Object.assign || function (target) {
50097
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
50022
50098
  for (var i = 1; i < arguments.length; i++) {
50023
50099
  var source = arguments[i];
50024
50100
 
@@ -50031,7 +50107,6 @@ function _extends() {
50031
50107
 
50032
50108
  return target;
50033
50109
  };
50034
-
50035
50110
  return _extends.apply(this, arguments);
50036
50111
  }
50037
50112
 
@@ -50046,24 +50121,25 @@ function _assertThisInitialized(self) {
50046
50121
  function _possibleConstructorReturn(self, call) {
50047
50122
  if (call && (_typeof(call) === "object" || typeof call === "function")) {
50048
50123
  return call;
50124
+ } else if (call !== void 0) {
50125
+ throw new TypeError("Derived constructors may only return object or undefined");
50049
50126
  }
50050
50127
 
50051
50128
  return _assertThisInitialized(self);
50052
50129
  }
50053
50130
 
50054
50131
  function _getPrototypeOf(o) {
50055
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
50132
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
50056
50133
  return o.__proto__ || Object.getPrototypeOf(o);
50057
50134
  };
50058
50135
  return _getPrototypeOf(o);
50059
50136
  }
50060
50137
 
50061
50138
  function _setPrototypeOf(o, p) {
50062
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
50139
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
50063
50140
  o.__proto__ = p;
50064
50141
  return o;
50065
50142
  };
50066
-
50067
50143
  return _setPrototypeOf(o, p);
50068
50144
  }
50069
50145
 
@@ -50079,36 +50155,39 @@ function _inherits(subClass, superClass) {
50079
50155
  configurable: true
50080
50156
  }
50081
50157
  });
50158
+ Object.defineProperty(subClass, "prototype", {
50159
+ writable: false
50160
+ });
50082
50161
  if (superClass) _setPrototypeOf(subClass, superClass);
50083
50162
  }
50084
50163
 
50085
50164
  var categories = {
50086
50165
  activity: function activity() {
50087
- return React__default['default'].createElement("svg", {
50166
+ return React__default["default"].createElement("svg", {
50088
50167
  xmlns: "http://www.w3.org/2000/svg",
50089
50168
  viewBox: "0 0 24 24",
50090
50169
  width: "24",
50091
50170
  height: "24"
50092
- }, React__default['default'].createElement("path", {
50171
+ }, React__default["default"].createElement("path", {
50093
50172
  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"
50094
50173
  }));
50095
50174
  },
50096
50175
  custom: function custom() {
50097
- return React__default['default'].createElement("svg", {
50176
+ return React__default["default"].createElement("svg", {
50098
50177
  xmlns: "http://www.w3.org/2000/svg",
50099
50178
  viewBox: "0 0 24 24",
50100
50179
  width: "24",
50101
50180
  height: "24"
50102
- }, React__default['default'].createElement("g", {
50181
+ }, React__default["default"].createElement("g", {
50103
50182
  transform: "translate(2.000000, 1.000000)"
50104
- }, React__default['default'].createElement("rect", {
50183
+ }, React__default["default"].createElement("rect", {
50105
50184
  id: "Rectangle",
50106
50185
  x: "8",
50107
50186
  y: "0",
50108
50187
  width: "3",
50109
50188
  height: "21",
50110
50189
  rx: "1.5"
50111
- }), React__default['default'].createElement("rect", {
50190
+ }), React__default["default"].createElement("rect", {
50112
50191
  id: "Rectangle",
50113
50192
  transform: "translate(9.843, 10.549) rotate(60) translate(-9.843, -10.549) ",
50114
50193
  x: "8.343",
@@ -50116,7 +50195,7 @@ var categories = {
50116
50195
  width: "3",
50117
50196
  height: "21",
50118
50197
  rx: "1.5"
50119
- }), React__default['default'].createElement("rect", {
50198
+ }), React__default["default"].createElement("rect", {
50120
50199
  id: "Rectangle",
50121
50200
  transform: "translate(9.843, 10.549) rotate(-60) translate(-9.843, -10.549) ",
50122
50201
  x: "8.343",
@@ -50127,116 +50206,116 @@ var categories = {
50127
50206
  })));
50128
50207
  },
50129
50208
  flags: function flags() {
50130
- return React__default['default'].createElement("svg", {
50209
+ return React__default["default"].createElement("svg", {
50131
50210
  xmlns: "http://www.w3.org/2000/svg",
50132
50211
  viewBox: "0 0 24 24",
50133
50212
  width: "24",
50134
50213
  height: "24"
50135
- }, React__default['default'].createElement("path", {
50214
+ }, React__default["default"].createElement("path", {
50136
50215
  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"
50137
50216
  }));
50138
50217
  },
50139
50218
  foods: function foods() {
50140
- return React__default['default'].createElement("svg", {
50219
+ return React__default["default"].createElement("svg", {
50141
50220
  xmlns: "http://www.w3.org/2000/svg",
50142
50221
  viewBox: "0 0 24 24",
50143
50222
  width: "24",
50144
50223
  height: "24"
50145
- }, React__default['default'].createElement("path", {
50224
+ }, React__default["default"].createElement("path", {
50146
50225
  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"
50147
50226
  }));
50148
50227
  },
50149
50228
  nature: function nature() {
50150
- return React__default['default'].createElement("svg", {
50229
+ return React__default["default"].createElement("svg", {
50151
50230
  xmlns: "http://www.w3.org/2000/svg",
50152
50231
  viewBox: "0 0 24 24",
50153
50232
  width: "24",
50154
50233
  height: "24"
50155
- }, React__default['default'].createElement("path", {
50234
+ }, React__default["default"].createElement("path", {
50156
50235
  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"
50157
- }), React__default['default'].createElement("path", {
50236
+ }), React__default["default"].createElement("path", {
50158
50237
  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"
50159
50238
  }));
50160
50239
  },
50161
50240
  objects: function objects() {
50162
- return React__default['default'].createElement("svg", {
50241
+ return React__default["default"].createElement("svg", {
50163
50242
  xmlns: "http://www.w3.org/2000/svg",
50164
50243
  viewBox: "0 0 24 24",
50165
50244
  width: "24",
50166
50245
  height: "24"
50167
- }, React__default['default'].createElement("path", {
50246
+ }, React__default["default"].createElement("path", {
50168
50247
  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"
50169
- }), React__default['default'].createElement("path", {
50248
+ }), React__default["default"].createElement("path", {
50170
50249
  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"
50171
50250
  }));
50172
50251
  },
50173
50252
  people: function people() {
50174
- return React__default['default'].createElement("svg", {
50253
+ return React__default["default"].createElement("svg", {
50175
50254
  xmlns: "http://www.w3.org/2000/svg",
50176
50255
  viewBox: "0 0 24 24",
50177
50256
  width: "24",
50178
50257
  height: "24"
50179
- }, React__default['default'].createElement("path", {
50258
+ }, React__default["default"].createElement("path", {
50180
50259
  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"
50181
- }), React__default['default'].createElement("path", {
50260
+ }), React__default["default"].createElement("path", {
50182
50261
  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"
50183
50262
  }));
50184
50263
  },
50185
50264
  places: function places() {
50186
- return React__default['default'].createElement("svg", {
50265
+ return React__default["default"].createElement("svg", {
50187
50266
  xmlns: "http://www.w3.org/2000/svg",
50188
50267
  viewBox: "0 0 24 24",
50189
50268
  width: "24",
50190
50269
  height: "24"
50191
- }, React__default['default'].createElement("path", {
50270
+ }, React__default["default"].createElement("path", {
50192
50271
  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"
50193
- }), React__default['default'].createElement("path", {
50272
+ }), React__default["default"].createElement("path", {
50194
50273
  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"
50195
50274
  }));
50196
50275
  },
50197
50276
  recent: function recent() {
50198
- return React__default['default'].createElement("svg", {
50277
+ return React__default["default"].createElement("svg", {
50199
50278
  xmlns: "http://www.w3.org/2000/svg",
50200
50279
  viewBox: "0 0 24 24",
50201
50280
  width: "24",
50202
50281
  height: "24"
50203
- }, React__default['default'].createElement("path", {
50282
+ }, React__default["default"].createElement("path", {
50204
50283
  d: "M13 4h-2l-.001 7H9v2h2v2h2v-2h4v-2h-4z"
50205
- }), React__default['default'].createElement("path", {
50284
+ }), React__default["default"].createElement("path", {
50206
50285
  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"
50207
50286
  }));
50208
50287
  },
50209
50288
  symbols: function symbols() {
50210
- return React__default['default'].createElement("svg", {
50289
+ return React__default["default"].createElement("svg", {
50211
50290
  xmlns: "http://www.w3.org/2000/svg",
50212
50291
  viewBox: "0 0 24 24",
50213
50292
  width: "24",
50214
50293
  height: "24"
50215
- }, React__default['default'].createElement("path", {
50294
+ }, React__default["default"].createElement("path", {
50216
50295
  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"
50217
50296
  }));
50218
50297
  }
50219
50298
  };
50220
50299
  var search = {
50221
50300
  search: function search() {
50222
- return React__default['default'].createElement("svg", {
50301
+ return React__default["default"].createElement("svg", {
50223
50302
  xmlns: "http://www.w3.org/2000/svg",
50224
50303
  width: "13",
50225
50304
  height: "13",
50226
50305
  viewBox: "0 0 20 20",
50227
50306
  opacity: "0.5"
50228
- }, React__default['default'].createElement("path", {
50307
+ }, React__default["default"].createElement("path", {
50229
50308
  d: "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"
50230
50309
  }));
50231
50310
  },
50232
50311
  "delete": function _delete() {
50233
- return React__default['default'].createElement("svg", {
50312
+ return React__default["default"].createElement("svg", {
50234
50313
  xmlns: "http://www.w3.org/2000/svg",
50235
50314
  width: "13",
50236
50315
  height: "13",
50237
50316
  viewBox: "0 0 20 20",
50238
50317
  opacity: "0.5"
50239
- }, React__default['default'].createElement("path", {
50318
+ }, React__default["default"].createElement("path", {
50240
50319
  d: "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"
50241
50320
  }));
50242
50321
  }
@@ -50249,68 +50328,68 @@ var icons = /*#__PURE__*/Object.freeze({
50249
50328
  });
50250
50329
 
50251
50330
  var EmojiPropTypes = {
50252
- data: PropTypes__default['default'].object.isRequired,
50253
- onOver: PropTypes__default['default'].func,
50254
- onLeave: PropTypes__default['default'].func,
50255
- onClick: PropTypes__default['default'].func,
50256
- fallback: PropTypes__default['default'].func,
50257
- backgroundImageFn: PropTypes__default['default'].func,
50258
- "native": PropTypes__default['default'].bool,
50259
- forceSize: PropTypes__default['default'].bool,
50260
- tooltip: PropTypes__default['default'].bool,
50261
- useButton: PropTypes__default['default'].bool,
50262
- skin: PropTypes__default['default'].oneOf([1, 2, 3, 4, 5, 6]),
50263
- sheetSize: PropTypes__default['default'].oneOf([16, 20, 32, 64]),
50264
- sheetColumns: PropTypes__default['default'].number,
50265
- sheetRows: PropTypes__default['default'].number,
50266
- set: PropTypes__default['default'].oneOf(['apple', 'google', 'twitter', 'facebook']),
50267
- size: PropTypes__default['default'].number.isRequired,
50268
- emoji: PropTypes__default['default'].oneOfType([PropTypes__default['default'].string, PropTypes__default['default'].object]).isRequired
50331
+ data: PropTypes__default["default"].object.isRequired,
50332
+ onOver: PropTypes__default["default"].func,
50333
+ onLeave: PropTypes__default["default"].func,
50334
+ onClick: PropTypes__default["default"].func,
50335
+ fallback: PropTypes__default["default"].func,
50336
+ backgroundImageFn: PropTypes__default["default"].func,
50337
+ "native": PropTypes__default["default"].bool,
50338
+ forceSize: PropTypes__default["default"].bool,
50339
+ tooltip: PropTypes__default["default"].bool,
50340
+ useButton: PropTypes__default["default"].bool,
50341
+ skin: PropTypes__default["default"].oneOf([1, 2, 3, 4, 5, 6]),
50342
+ sheetSize: PropTypes__default["default"].oneOf([16, 20, 32, 64]),
50343
+ sheetColumns: PropTypes__default["default"].number,
50344
+ sheetRows: PropTypes__default["default"].number,
50345
+ set: PropTypes__default["default"].oneOf(['apple', 'google', 'twitter', 'facebook']),
50346
+ size: PropTypes__default["default"].number.isRequired,
50347
+ emoji: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].object]).isRequired
50269
50348
  };
50270
50349
  var PickerPropTypes = {
50271
- onClick: PropTypes__default['default'].func,
50272
- onSelect: PropTypes__default['default'].func,
50273
- onSkinChange: PropTypes__default['default'].func,
50274
- perLine: PropTypes__default['default'].number,
50275
- emojiSize: PropTypes__default['default'].number,
50276
- i18n: PropTypes__default['default'].object,
50277
- style: PropTypes__default['default'].object,
50278
- title: PropTypes__default['default'].string,
50279
- emoji: PropTypes__default['default'].string,
50280
- color: PropTypes__default['default'].string,
50350
+ onClick: PropTypes__default["default"].func,
50351
+ onSelect: PropTypes__default["default"].func,
50352
+ onSkinChange: PropTypes__default["default"].func,
50353
+ perLine: PropTypes__default["default"].number,
50354
+ emojiSize: PropTypes__default["default"].number,
50355
+ i18n: PropTypes__default["default"].object,
50356
+ style: PropTypes__default["default"].object,
50357
+ title: PropTypes__default["default"].string,
50358
+ emoji: PropTypes__default["default"].string,
50359
+ color: PropTypes__default["default"].string,
50281
50360
  set: EmojiPropTypes.set,
50282
50361
  skin: EmojiPropTypes.skin,
50283
- "native": PropTypes__default['default'].bool,
50362
+ "native": PropTypes__default["default"].bool,
50284
50363
  backgroundImageFn: EmojiPropTypes.backgroundImageFn,
50285
50364
  sheetSize: EmojiPropTypes.sheetSize,
50286
- emojisToShowFilter: PropTypes__default['default'].func,
50287
- showPreview: PropTypes__default['default'].bool,
50288
- showSkinTones: PropTypes__default['default'].bool,
50365
+ emojisToShowFilter: PropTypes__default["default"].func,
50366
+ showPreview: PropTypes__default["default"].bool,
50367
+ showSkinTones: PropTypes__default["default"].bool,
50289
50368
  emojiTooltip: EmojiPropTypes.tooltip,
50290
50369
  useButton: EmojiPropTypes.useButton,
50291
- theme: PropTypes__default['default'].oneOf(['auto', 'light', 'dark']),
50292
- include: PropTypes__default['default'].arrayOf(PropTypes__default['default'].string),
50293
- exclude: PropTypes__default['default'].arrayOf(PropTypes__default['default'].string),
50294
- recent: PropTypes__default['default'].arrayOf(PropTypes__default['default'].string),
50295
- autoFocus: PropTypes__default['default'].bool,
50296
- enableFrequentEmojiSort: PropTypes__default['default'].bool,
50297
- custom: PropTypes__default['default'].arrayOf(PropTypes__default['default'].shape({
50298
- name: PropTypes__default['default'].string.isRequired,
50299
- short_names: PropTypes__default['default'].arrayOf(PropTypes__default['default'].string).isRequired,
50300
- emoticons: PropTypes__default['default'].arrayOf(PropTypes__default['default'].string),
50301
- keywords: PropTypes__default['default'].arrayOf(PropTypes__default['default'].string),
50302
- imageUrl: PropTypes__default['default'].string,
50303
- spriteUrl: PropTypes__default['default'].string,
50304
- sheet_x: PropTypes__default['default'].number,
50305
- sheet_y: PropTypes__default['default'].number,
50306
- size: PropTypes__default['default'].number,
50307
- sheetColumns: PropTypes__default['default'].number,
50308
- sheetRows: PropTypes__default['default'].number
50370
+ theme: PropTypes__default["default"].oneOf(['auto', 'light', 'dark']),
50371
+ include: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string),
50372
+ exclude: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string),
50373
+ recent: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string),
50374
+ autoFocus: PropTypes__default["default"].bool,
50375
+ enableFrequentEmojiSort: PropTypes__default["default"].bool,
50376
+ custom: PropTypes__default["default"].arrayOf(PropTypes__default["default"].shape({
50377
+ name: PropTypes__default["default"].string.isRequired,
50378
+ short_names: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string).isRequired,
50379
+ emoticons: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string),
50380
+ keywords: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string),
50381
+ imageUrl: PropTypes__default["default"].string,
50382
+ spriteUrl: PropTypes__default["default"].string,
50383
+ sheet_x: PropTypes__default["default"].number,
50384
+ sheet_y: PropTypes__default["default"].number,
50385
+ size: PropTypes__default["default"].number,
50386
+ sheetColumns: PropTypes__default["default"].number,
50387
+ sheetRows: PropTypes__default["default"].number
50309
50388
  })),
50310
- skinEmoji: PropTypes__default['default'].string,
50311
- notFound: PropTypes__default['default'].func,
50312
- notFoundEmoji: PropTypes__default['default'].string,
50313
- icons: PropTypes__default['default'].object
50389
+ skinEmoji: PropTypes__default["default"].string,
50390
+ notFound: PropTypes__default["default"].func,
50391
+ notFoundEmoji: PropTypes__default["default"].string,
50392
+ icons: PropTypes__default["default"].object
50314
50393
  };
50315
50394
 
50316
50395
  var Anchors = /*#__PURE__*/function (_React$PureComponent) {
@@ -50352,7 +50431,7 @@ var Anchors = /*#__PURE__*/function (_React$PureComponent) {
50352
50431
  i18n = _this$props2.i18n,
50353
50432
  icons = _this$props2.icons,
50354
50433
  selected = this.state.selected;
50355
- return React__default['default'].createElement("nav", {
50434
+ return React__default["default"].createElement("nav", {
50356
50435
  className: "emoji-mart-anchors",
50357
50436
  "aria-label": i18n.categorieslabel
50358
50437
  }, categories.map(function (category, i) {
@@ -50366,7 +50445,7 @@ var Anchors = /*#__PURE__*/function (_React$PureComponent) {
50366
50445
  }
50367
50446
 
50368
50447
  var iconId = id.startsWith('custom-') ? 'custom' : id;
50369
- return React__default['default'].createElement("button", {
50448
+ return React__default["default"].createElement("button", {
50370
50449
  key: id,
50371
50450
  "aria-label": i18n.categories[iconId],
50372
50451
  title: i18n.categories[iconId],
@@ -50377,9 +50456,9 @@ var Anchors = /*#__PURE__*/function (_React$PureComponent) {
50377
50456
  style: {
50378
50457
  color: isSelected ? color : null
50379
50458
  }
50380
- }, React__default['default'].createElement("div", {
50459
+ }, React__default["default"].createElement("div", {
50381
50460
  className: "emoji-mart-anchor-icon"
50382
- }, icons.categories[iconId]()), React__default['default'].createElement("span", {
50461
+ }, icons.categories[iconId]()), React__default["default"].createElement("span", {
50383
50462
  className: "emoji-mart-anchor-bar",
50384
50463
  style: {
50385
50464
  backgroundColor: color
@@ -50390,13 +50469,13 @@ var Anchors = /*#__PURE__*/function (_React$PureComponent) {
50390
50469
  }]);
50391
50470
 
50392
50471
  return Anchors;
50393
- }(React__default['default'].PureComponent);
50472
+ }(React__default["default"].PureComponent);
50394
50473
  Anchors.propTypes
50395
50474
  /* remove-proptypes */
50396
50475
  = {
50397
- categories: PropTypes__default['default'].array,
50398
- onAnchorClick: PropTypes__default['default'].func,
50399
- icons: PropTypes__default['default'].object
50476
+ categories: PropTypes__default["default"].array,
50477
+ onAnchorClick: PropTypes__default["default"].func,
50478
+ icons: PropTypes__default["default"].object
50400
50479
  };
50401
50480
  Anchors.defaultProps = {
50402
50481
  categories: [],
@@ -50679,7 +50758,7 @@ var NimbleEmoji = function NimbleEmoji(props) {
50679
50758
  style = _convertStyleToCSS(style);
50680
50759
  return "<".concat(Tag.name, " style='").concat(style, "' aria-label='").concat(label, "' ").concat(title ? "title='".concat(title, "'") : '', " class='").concat(className, "'>").concat(children || '', "</").concat(Tag.name, ">");
50681
50760
  } else {
50682
- return React__default['default'].createElement(Tag.name, _extends({
50761
+ return React__default["default"].createElement(Tag.name, _extends({
50683
50762
  onClick: function onClick(e) {
50684
50763
  return _handleClick(e, props);
50685
50764
  },
@@ -50692,7 +50771,7 @@ var NimbleEmoji = function NimbleEmoji(props) {
50692
50771
  "aria-label": label,
50693
50772
  title: title,
50694
50773
  className: className
50695
- }, Tag.props), React__default['default'].createElement("span", {
50774
+ }, Tag.props), React__default["default"].createElement("span", {
50696
50775
  style: style
50697
50776
  }, children));
50698
50777
  }
@@ -50701,7 +50780,7 @@ var NimbleEmoji = function NimbleEmoji(props) {
50701
50780
  NimbleEmoji.propTypes
50702
50781
  /* remove-proptypes */
50703
50782
  = _objectSpread$6({}, EmojiPropTypes, {
50704
- data: PropTypes__default['default'].object.isRequired
50783
+ data: PropTypes__default["default"].object.isRequired
50705
50784
  });
50706
50785
  NimbleEmoji.defaultProps = EmojiDefaultProps;
50707
50786
 
@@ -50757,7 +50836,7 @@ var NotFound = /*#__PURE__*/function (_React$PureComponent) {
50757
50836
  i18n = _this$props.i18n,
50758
50837
  notFound = _this$props.notFound,
50759
50838
  notFoundEmoji = _this$props.notFoundEmoji;
50760
- var component = notFound && notFound() || React__default['default'].createElement("div", {
50839
+ var component = notFound && notFound() || React__default["default"].createElement("div", {
50761
50840
  className: "emoji-mart-no-results"
50762
50841
  }, NimbleEmoji(_objectSpread$5({
50763
50842
  data: data
@@ -50767,7 +50846,7 @@ var NotFound = /*#__PURE__*/function (_React$PureComponent) {
50767
50846
  onOver: null,
50768
50847
  onLeave: null,
50769
50848
  onClick: null
50770
- })), React__default['default'].createElement("div", {
50849
+ })), React__default["default"].createElement("div", {
50771
50850
  className: "emoji-mart-no-results-label"
50772
50851
  }, i18n.notfound));
50773
50852
  return component;
@@ -50775,12 +50854,12 @@ var NotFound = /*#__PURE__*/function (_React$PureComponent) {
50775
50854
  }]);
50776
50855
 
50777
50856
  return NotFound;
50778
- }(React__default['default'].PureComponent);
50857
+ }(React__default["default"].PureComponent);
50779
50858
  NotFound.propTypes
50780
50859
  /* remove-proptypes */
50781
50860
  = {
50782
- notFound: PropTypes__default['default'].func.isRequired,
50783
- emojiProps: PropTypes__default['default'].object.isRequired
50861
+ notFound: PropTypes__default["default"].func.isRequired,
50862
+ emojiProps: PropTypes__default["default"].object.isRequired
50784
50863
  };
50785
50864
 
50786
50865
  function ownKeys$4(object, enumerableOnly) {
@@ -51018,31 +51097,31 @@ var Category = /*#__PURE__*/function (_React$Component) {
51018
51097
  }
51019
51098
 
51020
51099
  var label = i18n.categories[id] || name;
51021
- return React__default['default'].createElement("section", {
51100
+ return React__default["default"].createElement("section", {
51022
51101
  ref: this.setContainerRef,
51023
51102
  className: "emoji-mart-category",
51024
51103
  "aria-label": label,
51025
51104
  style: containerStyles
51026
- }, React__default['default'].createElement("div", {
51105
+ }, React__default["default"].createElement("div", {
51027
51106
  style: labelStyles,
51028
51107
  "data-name": name,
51029
51108
  className: "emoji-mart-category-label"
51030
- }, React__default['default'].createElement("span", {
51109
+ }, React__default["default"].createElement("span", {
51031
51110
  style: labelSpanStyles,
51032
51111
  ref: this.setLabelRef,
51033
51112
  "aria-hidden": true
51034
51113
  /* already labeled by the section aria-label */
51035
51114
 
51036
- }, label)), React__default['default'].createElement("ul", {
51115
+ }, label)), React__default["default"].createElement("ul", {
51037
51116
  className: "emoji-mart-category-list"
51038
51117
  }, emojis && emojis.map(function (emoji) {
51039
- return React__default['default'].createElement("li", {
51118
+ return React__default["default"].createElement("li", {
51040
51119
  key: emoji.short_names && emoji.short_names.join('_') || emoji
51041
51120
  }, NimbleEmoji(_objectSpread$4({
51042
51121
  emoji: emoji,
51043
51122
  data: _this3.data
51044
51123
  }, emojiProps)));
51045
- })), emojis && !emojis.length && React__default['default'].createElement(NotFound, {
51124
+ })), emojis && !emojis.length && React__default["default"].createElement(NotFound, {
51046
51125
  i18n: i18n,
51047
51126
  notFound: notFound,
51048
51127
  notFoundEmoji: notFoundEmoji,
@@ -51053,19 +51132,19 @@ var Category = /*#__PURE__*/function (_React$Component) {
51053
51132
  }]);
51054
51133
 
51055
51134
  return Category;
51056
- }(React__default['default'].Component);
51135
+ }(React__default["default"].Component);
51057
51136
  Category.propTypes
51058
51137
  /* remove-proptypes */
51059
51138
  = {
51060
- emojis: PropTypes__default['default'].array,
51061
- hasStickyPosition: PropTypes__default['default'].bool,
51062
- name: PropTypes__default['default'].string.isRequired,
51063
- "native": PropTypes__default['default'].bool.isRequired,
51064
- perLine: PropTypes__default['default'].number.isRequired,
51065
- emojiProps: PropTypes__default['default'].object.isRequired,
51066
- recent: PropTypes__default['default'].arrayOf(PropTypes__default['default'].string),
51067
- notFound: PropTypes__default['default'].func,
51068
- notFoundEmoji: PropTypes__default['default'].string.isRequired
51139
+ emojis: PropTypes__default["default"].array,
51140
+ hasStickyPosition: PropTypes__default["default"].bool,
51141
+ name: PropTypes__default["default"].string.isRequired,
51142
+ "native": PropTypes__default["default"].bool.isRequired,
51143
+ perLine: PropTypes__default["default"].number.isRequired,
51144
+ emojiProps: PropTypes__default["default"].object.isRequired,
51145
+ recent: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string),
51146
+ notFound: PropTypes__default["default"].func,
51147
+ notFoundEmoji: PropTypes__default["default"].string.isRequired
51069
51148
  };
51070
51149
  Category.defaultProps = {
51071
51150
  emojis: [],
@@ -51115,12 +51194,12 @@ var Skins = /*#__PURE__*/function (_React$PureComponent) {
51115
51194
  }]);
51116
51195
 
51117
51196
  return Skins;
51118
- }(React__default['default'].PureComponent);
51197
+ }(React__default["default"].PureComponent);
51119
51198
  Skins.propTypes
51120
51199
  /* remove-proptypes */
51121
51200
  = {
51122
- onChange: PropTypes__default['default'].func,
51123
- skin: PropTypes__default['default'].number.isRequired
51201
+ onChange: PropTypes__default["default"].func,
51202
+ skin: PropTypes__default["default"].number.isRequired
51124
51203
  };
51125
51204
  Skins.defaultProps = {
51126
51205
  onChange: function onChange() {}
@@ -51153,10 +51232,10 @@ var SkinsEmoji = /*#__PURE__*/function (_Skins) {
51153
51232
 
51154
51233
  for (var skinTone = 1; skinTone <= 6; skinTone++) {
51155
51234
  var selected = skinTone === skin;
51156
- skinToneNodes.push(React__default['default'].createElement("span", {
51235
+ skinToneNodes.push(React__default["default"].createElement("span", {
51157
51236
  key: "skin-tone-".concat(skinTone),
51158
51237
  className: "emoji-mart-skin-swatch custom".concat(selected ? ' selected' : '')
51159
- }, React__default['default'].createElement("span", {
51238
+ }, React__default["default"].createElement("span", {
51160
51239
  onClick: this.handleClick,
51161
51240
  "data-skin": skinTone,
51162
51241
  className: "emoji-mart-skin-tone-".concat(skinTone)
@@ -51172,9 +51251,9 @@ var SkinsEmoji = /*#__PURE__*/function (_Skins) {
51172
51251
  }))));
51173
51252
  }
51174
51253
 
51175
- return React__default['default'].createElement("div", {
51254
+ return React__default["default"].createElement("div", {
51176
51255
  className: "emoji-mart-skin-swatches custom".concat(opened ? ' opened' : '')
51177
- }, React__default['default'].createElement("div", {
51256
+ }, React__default["default"].createElement("div", {
51178
51257
  className: "emoji-mart-skin-text".concat(opened ? ' opened' : '')
51179
51258
  }, i18n.skintext), skinToneNodes);
51180
51259
  }
@@ -51185,12 +51264,12 @@ var SkinsEmoji = /*#__PURE__*/function (_Skins) {
51185
51264
  SkinsEmoji.propTypes
51186
51265
  /* remove-proptypes */
51187
51266
  = {
51188
- onChange: PropTypes__default['default'].func,
51189
- skin: PropTypes__default['default'].number.isRequired,
51190
- emojiProps: PropTypes__default['default'].object.isRequired,
51191
- skinTone: PropTypes__default['default'].number,
51192
- skinEmoji: PropTypes__default['default'].string.isRequired,
51193
- i18n: PropTypes__default['default'].object
51267
+ onChange: PropTypes__default["default"].func,
51268
+ skin: PropTypes__default["default"].number.isRequired,
51269
+ emojiProps: PropTypes__default["default"].object.isRequired,
51270
+ skinTone: PropTypes__default["default"].number,
51271
+ skinEmoji: PropTypes__default["default"].string.isRequired,
51272
+ i18n: PropTypes__default["default"].object
51194
51273
  };
51195
51274
  SkinsEmoji.defaultProps = {
51196
51275
  onChange: function onChange() {},
@@ -51232,14 +51311,14 @@ var SkinsDot = /*#__PURE__*/function (_Skins) {
51232
51311
  for (var skinTone = 1; skinTone <= 6; skinTone++) {
51233
51312
  var selected = skinTone === skin;
51234
51313
  var visible = opened || selected;
51235
- skinToneNodes.push(React__default['default'].createElement("span", _extends({
51314
+ skinToneNodes.push(React__default["default"].createElement("span", _extends({
51236
51315
  key: "skin-tone-".concat(skinTone),
51237
51316
  className: "emoji-mart-skin-swatch".concat(selected ? ' selected' : ''),
51238
51317
  "aria-label": i18n.skintones[skinTone],
51239
51318
  "aria-hidden": !visible
51240
51319
  }, opened ? {
51241
51320
  role: 'menuitem'
51242
- } : {}), React__default['default'].createElement("span", _extends({
51321
+ } : {}), React__default["default"].createElement("span", _extends({
51243
51322
  onClick: this.handleClick,
51244
51323
  onKeyDown: this.handleKeyDown,
51245
51324
  role: "button"
@@ -51257,10 +51336,10 @@ var SkinsDot = /*#__PURE__*/function (_Skins) {
51257
51336
  }))));
51258
51337
  }
51259
51338
 
51260
- return React__default['default'].createElement("section", {
51339
+ return React__default["default"].createElement("section", {
51261
51340
  className: "emoji-mart-skin-swatches".concat(opened ? ' opened' : ''),
51262
51341
  "aria-label": i18n.skintext
51263
- }, React__default['default'].createElement("div", opened ? {
51342
+ }, React__default["default"].createElement("div", opened ? {
51264
51343
  role: 'menubar'
51265
51344
  } : {}, skinToneNodes));
51266
51345
  }
@@ -51271,9 +51350,9 @@ var SkinsDot = /*#__PURE__*/function (_Skins) {
51271
51350
  SkinsDot.propTypes
51272
51351
  /* remove-proptypes */
51273
51352
  = {
51274
- onChange: PropTypes__default['default'].func,
51275
- skin: PropTypes__default['default'].number.isRequired,
51276
- i18n: PropTypes__default['default'].object
51353
+ onChange: PropTypes__default["default"].func,
51354
+ skin: PropTypes__default["default"].number.isRequired,
51355
+ i18n: PropTypes__default["default"].object
51277
51356
  };
51278
51357
  SkinsDot.defaultProps = {
51279
51358
  onChange: function onChange() {}
@@ -51356,59 +51435,59 @@ var Preview = /*#__PURE__*/function (_React$PureComponent) {
51356
51435
  knownEmoticons.push(emoticon.toLowerCase());
51357
51436
  listedEmoticons.push(emoticon);
51358
51437
  });
51359
- return React__default['default'].createElement("div", {
51438
+ return React__default["default"].createElement("div", {
51360
51439
  className: "emoji-mart-preview"
51361
- }, React__default['default'].createElement("div", {
51440
+ }, React__default["default"].createElement("div", {
51362
51441
  className: "emoji-mart-preview-emoji",
51363
51442
  "aria-hidden": "true"
51364
51443
  }, NimbleEmoji(_objectSpread$3({
51365
51444
  key: emoji.id,
51366
51445
  emoji: emoji,
51367
51446
  data: this.data
51368
- }, emojiProps))), React__default['default'].createElement("div", {
51447
+ }, emojiProps))), React__default["default"].createElement("div", {
51369
51448
  className: "emoji-mart-preview-data",
51370
51449
  "aria-hidden": "true"
51371
- }, React__default['default'].createElement("div", {
51450
+ }, React__default["default"].createElement("div", {
51372
51451
  className: "emoji-mart-preview-name"
51373
- }, emoji.name), React__default['default'].createElement("div", {
51452
+ }, emoji.name), React__default["default"].createElement("div", {
51374
51453
  className: "emoji-mart-preview-shortnames"
51375
51454
  }, emojiData.short_names.map(function (short_name) {
51376
- return React__default['default'].createElement("span", {
51455
+ return React__default["default"].createElement("span", {
51377
51456
  key: short_name,
51378
51457
  className: "emoji-mart-preview-shortname"
51379
51458
  }, ":", short_name, ":");
51380
- })), React__default['default'].createElement("div", {
51459
+ })), React__default["default"].createElement("div", {
51381
51460
  className: "emoji-mart-preview-emoticons"
51382
51461
  }, listedEmoticons.map(function (emoticon) {
51383
- return React__default['default'].createElement("span", {
51462
+ return React__default["default"].createElement("span", {
51384
51463
  key: emoticon,
51385
51464
  className: "emoji-mart-preview-emoticon"
51386
51465
  }, emoticon);
51387
51466
  }))));
51388
51467
  } else {
51389
- return React__default['default'].createElement("div", {
51468
+ return React__default["default"].createElement("div", {
51390
51469
  className: "emoji-mart-preview"
51391
- }, React__default['default'].createElement("div", {
51470
+ }, React__default["default"].createElement("div", {
51392
51471
  className: "emoji-mart-preview-emoji",
51393
51472
  "aria-hidden": "true"
51394
51473
  }, idleEmoji && idleEmoji.length && NimbleEmoji(_objectSpread$3({
51395
51474
  emoji: idleEmoji,
51396
51475
  data: this.data
51397
- }, emojiProps))), React__default['default'].createElement("div", {
51476
+ }, emojiProps))), React__default["default"].createElement("div", {
51398
51477
  className: "emoji-mart-preview-data",
51399
51478
  "aria-hidden": "true"
51400
- }, React__default['default'].createElement("span", {
51479
+ }, React__default["default"].createElement("span", {
51401
51480
  className: "emoji-mart-title-label"
51402
- }, title)), showSkinTones && React__default['default'].createElement("div", {
51481
+ }, title)), showSkinTones && React__default["default"].createElement("div", {
51403
51482
  className: "emoji-mart-preview-skins".concat(skinsProps.skinEmoji ? ' custom' : '')
51404
- }, skinsProps.skinEmoji ? React__default['default'].createElement(SkinsEmoji, {
51483
+ }, skinsProps.skinEmoji ? React__default["default"].createElement(SkinsEmoji, {
51405
51484
  skin: skinsProps.skin,
51406
51485
  emojiProps: emojiProps,
51407
51486
  data: this.data,
51408
51487
  skinEmoji: skinsProps.skinEmoji,
51409
51488
  i18n: i18n,
51410
51489
  onChange: skinsProps.onChange
51411
- }) : React__default['default'].createElement(SkinsDot, {
51490
+ }) : React__default["default"].createElement(SkinsDot, {
51412
51491
  skin: skinsProps.skin,
51413
51492
  i18n: i18n,
51414
51493
  onChange: skinsProps.onChange
@@ -51418,15 +51497,15 @@ var Preview = /*#__PURE__*/function (_React$PureComponent) {
51418
51497
  }]);
51419
51498
 
51420
51499
  return Preview;
51421
- }(React__default['default'].PureComponent);
51500
+ }(React__default["default"].PureComponent);
51422
51501
  Preview.propTypes
51423
51502
  /* remove-proptypes */
51424
51503
  = {
51425
- showSkinTones: PropTypes__default['default'].bool,
51426
- title: PropTypes__default['default'].string.isRequired,
51427
- emoji: PropTypes__default['default'].string.isRequired,
51428
- emojiProps: PropTypes__default['default'].object.isRequired,
51429
- skinsProps: PropTypes__default['default'].object.isRequired
51504
+ showSkinTones: PropTypes__default["default"].bool,
51505
+ title: PropTypes__default["default"].string.isRequired,
51506
+ emoji: PropTypes__default["default"].string.isRequired,
51507
+ emojiProps: PropTypes__default["default"].object.isRequired,
51508
+ skinsProps: PropTypes__default["default"].object.isRequired
51430
51509
  };
51431
51510
  Preview.defaultProps = {
51432
51511
  showSkinTones: true,
@@ -51524,20 +51603,20 @@ var Search = /*#__PURE__*/function (_React$PureComponent) {
51524
51603
  isSearching = _this$state.isSearching,
51525
51604
  id = _this$state.id;
51526
51605
  var inputId = "emoji-mart-search-".concat(id);
51527
- return React__default['default'].createElement("section", {
51606
+ return React__default["default"].createElement("section", {
51528
51607
  className: "emoji-mart-search",
51529
51608
  "aria-label": i18n.search
51530
- }, React__default['default'].createElement("input", {
51609
+ }, React__default["default"].createElement("input", {
51531
51610
  id: inputId,
51532
51611
  ref: this.setRef,
51533
51612
  type: "search",
51534
51613
  onChange: this.handleChange,
51535
51614
  placeholder: i18n.search,
51536
51615
  autoFocus: autoFocus
51537
- }), React__default['default'].createElement("label", {
51616
+ }), React__default["default"].createElement("label", {
51538
51617
  className: "emoji-mart-sr-only",
51539
51618
  htmlFor: inputId
51540
- }, i18n.search), React__default['default'].createElement("button", {
51619
+ }, i18n.search), React__default["default"].createElement("button", {
51541
51620
  className: "emoji-mart-search-icon",
51542
51621
  onClick: this.clear,
51543
51622
  onKeyUp: this.handleKeyUp,
@@ -51548,14 +51627,14 @@ var Search = /*#__PURE__*/function (_React$PureComponent) {
51548
51627
  }]);
51549
51628
 
51550
51629
  return Search;
51551
- }(React__default['default'].PureComponent);
51630
+ }(React__default["default"].PureComponent);
51552
51631
  Search.propTypes
51553
51632
  /* remove-proptypes */
51554
51633
  = {
51555
- onSearch: PropTypes__default['default'].func,
51556
- maxResults: PropTypes__default['default'].number,
51557
- emojisToShowFilter: PropTypes__default['default'].func,
51558
- autoFocus: PropTypes__default['default'].bool
51634
+ onSearch: PropTypes__default["default"].func,
51635
+ maxResults: PropTypes__default["default"].number,
51636
+ emojisToShowFilter: PropTypes__default["default"].func,
51637
+ autoFocus: PropTypes__default["default"].bool
51559
51638
  };
51560
51639
  Search.defaultProps = {
51561
51640
  onSearch: function onSearch() {},
@@ -52149,16 +52228,16 @@ var NimblePicker = /*#__PURE__*/function (_React$PureComponent) {
52149
52228
  var width = perLine * (emojiSize + 12) + 12 + 2 + measureScrollbar();
52150
52229
  var theme = this.getPreferredTheme();
52151
52230
  var skin = this.props.skin || this.state.skin || store.get('skin') || this.props.defaultSkin;
52152
- return React__default['default'].createElement("section", {
52231
+ return React__default["default"].createElement("section", {
52153
52232
  style: _objectSpread$2({
52154
52233
  width: width
52155
52234
  }, style),
52156
52235
  className: "emoji-mart emoji-mart-".concat(theme),
52157
52236
  "aria-label": title,
52158
52237
  onKeyDown: this.handleKeyDown
52159
- }, React__default['default'].createElement("div", {
52238
+ }, React__default["default"].createElement("div", {
52160
52239
  className: "emoji-mart-bar"
52161
- }, React__default['default'].createElement(Anchors, {
52240
+ }, React__default["default"].createElement(Anchors, {
52162
52241
  ref: this.setAnchorsRef,
52163
52242
  data: this.data,
52164
52243
  i18n: this.i18n,
@@ -52166,7 +52245,7 @@ var NimblePicker = /*#__PURE__*/function (_React$PureComponent) {
52166
52245
  categories: this.categories,
52167
52246
  onAnchorClick: this.handleAnchorClick,
52168
52247
  icons: this.icons
52169
- })), React__default['default'].createElement(Search, {
52248
+ })), React__default["default"].createElement(Search, {
52170
52249
  ref: this.setSearchRef,
52171
52250
  onSearch: this.handleSearch,
52172
52251
  data: this.data,
@@ -52176,12 +52255,12 @@ var NimblePicker = /*#__PURE__*/function (_React$PureComponent) {
52176
52255
  exclude: exclude,
52177
52256
  custom: this.CUSTOM,
52178
52257
  autoFocus: autoFocus
52179
- }), React__default['default'].createElement("div", {
52258
+ }), React__default["default"].createElement("div", {
52180
52259
  ref: this.setScrollRef,
52181
52260
  className: "emoji-mart-scroll",
52182
52261
  onScroll: this.handleScroll
52183
52262
  }, this.getCategories().map(function (category, i) {
52184
- return React__default['default'].createElement(Category, {
52263
+ return React__default["default"].createElement(Category, {
52185
52264
  ref: _this4.setCategoryRef.bind(_this4, "category-".concat(i)),
52186
52265
  key: category.name,
52187
52266
  id: category.id,
@@ -52213,9 +52292,9 @@ var NimblePicker = /*#__PURE__*/function (_React$PureComponent) {
52213
52292
  notFound: notFound,
52214
52293
  notFoundEmoji: notFoundEmoji
52215
52294
  });
52216
- })), (showPreview || showSkinTones) && React__default['default'].createElement("div", {
52295
+ })), (showPreview || showSkinTones) && React__default["default"].createElement("div", {
52217
52296
  className: "emoji-mart-bar"
52218
- }, React__default['default'].createElement(Preview, {
52297
+ }, React__default["default"].createElement(Preview, {
52219
52298
  ref: this.setPreviewRef,
52220
52299
  data: this.data,
52221
52300
  title: title,
@@ -52243,11 +52322,11 @@ var NimblePicker = /*#__PURE__*/function (_React$PureComponent) {
52243
52322
  }]);
52244
52323
 
52245
52324
  return NimblePicker;
52246
- }(React__default['default'].PureComponent);
52325
+ }(React__default["default"].PureComponent);
52247
52326
  NimblePicker.propTypes
52248
52327
  /* remove-proptypes */
52249
52328
  = _objectSpread$2({}, PickerPropTypes, {
52250
- data: PropTypes__default['default'].object.isRequired
52329
+ data: PropTypes__default["default"].object.isRequired
52251
52330
  });
52252
52331
  NimblePicker.defaultProps = _objectSpread$2({}, PickerDefaultProps);
52253
52332
 
@@ -52297,12 +52376,12 @@ var Picker = /*#__PURE__*/function (_React$PureComponent) {
52297
52376
  _createClass(Picker, [{
52298
52377
  key: "render",
52299
52378
  value: function render() {
52300
- return React__default['default'].createElement(NimblePicker, _extends({}, this.props, this.state));
52379
+ return React__default["default"].createElement(NimblePicker, _extends({}, this.props, this.state));
52301
52380
  }
52302
52381
  }]);
52303
52382
 
52304
52383
  return Picker;
52305
- }(React__default['default'].PureComponent);
52384
+ }(React__default["default"].PureComponent);
52306
52385
  Picker.propTypes
52307
52386
  /* remove-proptypes */
52308
52387
  = PickerPropTypes;
@@ -52356,7 +52435,7 @@ styleInject(css_248z);
52356
52435
  * @property {'light' | 'dark' | 'auto'} theme
52357
52436
  * @property {function(import("../types/types").EmojiMartItem): void} onSelectEmoji
52358
52437
  * @property {boolean} disableRecent
52359
- * @property {object[]} customEmojis
52438
+ * @property {import("emoji-mart").CustomEmoji[]=} customEmojis
52360
52439
  */
52361
52440
 
52362
52441
  /**
@@ -52382,7 +52461,7 @@ function EmojiPicker(props) {
52382
52461
 
52383
52462
  return exclude;
52384
52463
  }, [disableRecent]);
52385
- return /*#__PURE__*/React__default['default'].createElement(Picker, {
52464
+ return /*#__PURE__*/React__default["default"].createElement(Picker, {
52386
52465
  theme: theme,
52387
52466
  set: "apple",
52388
52467
  showPreview: false,
@@ -52394,13 +52473,50 @@ function EmojiPicker(props) {
52394
52473
  }
52395
52474
 
52396
52475
  EmojiPicker.propTypes = {
52397
- theme: PropTypes__default['default'].oneOf(['light', 'dark', 'auto']),
52398
- onSelectEmoji: PropTypes__default['default'].func,
52399
- disableRecent: PropTypes__default['default'].bool,
52400
- customEmojis: PropTypes__default['default'].array
52476
+ theme: PropTypes__default["default"].oneOf(['light', 'dark', 'auto']),
52477
+ onSelectEmoji: PropTypes__default["default"].func,
52478
+ disableRecent: PropTypes__default["default"].bool,
52479
+ customEmojis: PropTypes__default["default"].array
52401
52480
  };
52402
52481
  var EmojiPicker$1 = /*#__PURE__*/React.memo(EmojiPicker);
52403
52482
 
52483
+ /**
52484
+ * @typedef {object} Props
52485
+ * @property {boolean} showPicker
52486
+ * @property {'light' | 'dark' | 'auto'} theme
52487
+ * @property {(emoji: import("../types/types").EmojiMartItem) => void} handleSelectEmoji
52488
+ * @property {boolean} disableRecent
52489
+ * @property {import("emoji-mart").CustomEmoji[]=} customEmojis
52490
+ */
52491
+
52492
+ /**
52493
+ * Emoji Picker Button Component
52494
+ * @param {Props} props
52495
+ * @return {JSX.Element}
52496
+ */
52497
+
52498
+ function EmojiPickerContainer({
52499
+ showPicker,
52500
+ theme,
52501
+ handleSelectEmoji,
52502
+ disableRecent,
52503
+ customEmojis
52504
+ }) {
52505
+ return /*#__PURE__*/React__default["default"].createElement("div", {
52506
+ className: "react-emoji-picker--container"
52507
+ }, showPicker && /*#__PURE__*/React__default["default"].createElement("div", {
52508
+ className: "react-emoji-picker--wrapper",
52509
+ onClick: evt => evt.stopPropagation()
52510
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
52511
+ className: "react-emoji-picker"
52512
+ }, /*#__PURE__*/React__default["default"].createElement(EmojiPicker$1, {
52513
+ theme: theme,
52514
+ onSelectEmoji: handleSelectEmoji,
52515
+ disableRecent: disableRecent,
52516
+ customEmojis: customEmojis
52517
+ }))));
52518
+ }
52519
+
52404
52520
  // @ts-check
52405
52521
  /**
52406
52522
  * @typedef {import('../types/types').SanitizeFn} SanitizeFn
@@ -52415,10 +52531,11 @@ var EmojiPicker$1 = /*#__PURE__*/React.memo(EmojiPicker);
52415
52531
  * @property {'light' | 'dark' | 'auto'} theme
52416
52532
  * @property {boolean} keepOpened
52417
52533
  * @property {boolean} disableRecent
52418
- * @property {object[]=} customEmojis
52534
+ * @property {import("emoji-mart").CustomEmoji[]=} customEmojis
52419
52535
  * @property {(fn: SanitizeFn) => void} addSanitizeFn
52420
52536
  * @property {(fn: PolluteFn) => void} addPolluteFn
52421
52537
  * @property {(html: string) => void} appendContent
52538
+ * @property {HTMLDivElement=} buttonElement
52422
52539
  */
52423
52540
  // eslint-disable-next-line valid-jsdoc
52424
52541
 
@@ -52432,9 +52549,13 @@ const EmojiPickerWrapper = props => {
52432
52549
  customEmojis,
52433
52550
  addSanitizeFn,
52434
52551
  addPolluteFn,
52435
- appendContent
52552
+ appendContent,
52553
+ buttonElement
52436
52554
  } = props;
52437
52555
  const [showPicker, setShowPicker] = React.useState(false);
52556
+ /** @type {[HTMLDivElement | undefined, React.Dispatch<React.SetStateAction<HTMLDivElement | undefined>>]} */
52557
+
52558
+ const [customButton, setCustomButton] = React.useState();
52438
52559
  React.useEffect(() => {
52439
52560
  addSanitizeFn(replaceAllTextEmojiToString);
52440
52561
  }, [addSanitizeFn]);
@@ -52488,33 +52609,32 @@ const EmojiPickerWrapper = props => {
52488
52609
  }
52489
52610
  }
52490
52611
 
52491
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
52492
- className: "react-emoji-picker--container"
52493
- }, showPicker && /*#__PURE__*/React__default['default'].createElement("div", {
52494
- className: "react-emoji-picker--wrapper",
52495
- onClick: evt => evt.stopPropagation()
52496
- }, /*#__PURE__*/React__default['default'].createElement("div", {
52497
- className: "react-emoji-picker"
52498
- }, /*#__PURE__*/React__default['default'].createElement(EmojiPicker$1, {
52612
+ React.useEffect(() => {
52613
+ if (buttonElement?.style) {
52614
+ buttonElement.style.position = "relative";
52615
+ setCustomButton(buttonElement);
52616
+ }
52617
+ }, [buttonElement]);
52618
+ return customButton ? /*#__PURE__*/ReactDOM__default["default"].createPortal( /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(EmojiPickerContainer, {
52619
+ showPicker: showPicker,
52499
52620
  theme: theme,
52500
- onSelectEmoji: handleSelectEmoji,
52621
+ handleSelectEmoji: handleSelectEmoji,
52501
52622
  disableRecent: disableRecent,
52502
52623
  customEmojis: customEmojis
52503
- })))), /*#__PURE__*/React__default['default'].createElement("button", {
52504
- type: "button",
52505
- className: `react-input-emoji--button${showPicker ? " react-input-emoji--button__show" : ""}`,
52506
- onClick: toggleShowPicker
52507
- }, /*#__PURE__*/React__default['default'].createElement("svg", {
52508
- xmlns: "http://www.w3.org/2000/svg",
52509
- viewBox: "0 0 24 24",
52510
- width: "24",
52511
- height: "24",
52512
- className: "react-input-emoji--button--icon"
52513
- }, /*#__PURE__*/React__default['default'].createElement("path", {
52514
- 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"
52515
- }), /*#__PURE__*/React__default['default'].createElement("path", {
52516
- 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"
52517
- }))));
52624
+ }), /*#__PURE__*/React__default["default"].createElement(EmojiPickerButton, {
52625
+ showPicker: showPicker,
52626
+ toggleShowPicker: toggleShowPicker,
52627
+ buttonElement: customButton
52628
+ })), customButton) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(EmojiPickerContainer, {
52629
+ showPicker: showPicker,
52630
+ theme: theme,
52631
+ handleSelectEmoji: handleSelectEmoji,
52632
+ disableRecent: disableRecent,
52633
+ customEmojis: customEmojis
52634
+ }), /*#__PURE__*/React__default["default"].createElement(EmojiPickerButton, {
52635
+ showPicker: showPicker,
52636
+ toggleShowPicker: toggleShowPicker
52637
+ }));
52518
52638
  };
52519
52639
 
52520
52640
  // @ts-check
@@ -52613,7 +52733,7 @@ function getElementWithFocus() {
52613
52733
 
52614
52734
  function getSelectionStart() {
52615
52735
  const node = document.getSelection().anchorNode;
52616
- return (node === null || node === void 0 ? void 0 : node.nodeType) == 3 ? node : null;
52736
+ return node?.nodeType == 3 ? node : null;
52617
52737
  }
52618
52738
 
52619
52739
  // @ts-check
@@ -52658,11 +52778,9 @@ function useMention(searchMention) {
52658
52778
  /** @type {(event: React.KeyboardEvent) => void} */
52659
52779
 
52660
52780
  const onKeyUp = React.useCallback(async event => {
52661
- var _getElementWithFocus;
52662
-
52663
52781
  if (typeof searchMention !== "function") return;
52664
52782
 
52665
- if (event.key === "Backspace" && (_getElementWithFocus = getElementWithFocus()) !== null && _getElementWithFocus !== void 0 && _getElementWithFocus.element.parentElement.hasAttribute("data-mention-id")) {
52783
+ if (event.key === "Backspace" && getElementWithFocus()?.element.parentElement.hasAttribute("data-mention-id")) {
52666
52784
  const elementWithFocus = getElementWithFocus();
52667
52785
  elementWithFocus.element.parentElement.remove();
52668
52786
  } else if (!["ArrowUp", "ArrowDown", "Esc", "Escape"].includes(event.key)) {
@@ -52799,20 +52917,20 @@ const MentionUserList = ({
52799
52917
  unsubscribe();
52800
52918
  };
52801
52919
  }, [addEventListener, onSelect, selectedUser, usersFiltered]);
52802
- return /*#__PURE__*/React__default['default'].createElement("ul", {
52920
+ return /*#__PURE__*/React__default["default"].createElement("ul", {
52803
52921
  className: "react-input-emoji--mention--list",
52804
52922
  "data-testid": "mention-user-list"
52805
- }, usersFiltered.map((user, index) => /*#__PURE__*/React__default['default'].createElement("li", {
52923
+ }, usersFiltered.map((user, index) => /*#__PURE__*/React__default["default"].createElement("li", {
52806
52924
  key: user.id
52807
- }, /*#__PURE__*/React__default['default'].createElement("button", {
52925
+ }, /*#__PURE__*/React__default["default"].createElement("button", {
52808
52926
  type: "button",
52809
52927
  onClick: handleClick(user),
52810
52928
  className: `react-input-emoji--mention--item${selectedUser === index ? " react-input-emoji--mention--item__selected" : ""}`,
52811
52929
  onMouseOver: () => setSelectedUser(index)
52812
- }, /*#__PURE__*/React__default['default'].createElement("img", {
52930
+ }, /*#__PURE__*/React__default["default"].createElement("img", {
52813
52931
  className: "react-input-emoji--mention--item--img",
52814
52932
  src: user.image
52815
- }), /*#__PURE__*/React__default['default'].createElement("div", {
52933
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
52816
52934
  className: "react-input-emoji--mention--item--name",
52817
52935
  dangerouslySetInnerHTML: {
52818
52936
  __html: user.nameHtml
@@ -52822,7 +52940,7 @@ const MentionUserList = ({
52822
52940
 
52823
52941
  const MentionUserListWithRef = /*#__PURE__*/React.forwardRef(MentionUserList);
52824
52942
  MentionUserListWithRef.propTypes = {
52825
- users: PropTypes__default['default'].array.isRequired
52943
+ users: PropTypes__default["default"].array.isRequired
52826
52944
  };
52827
52945
 
52828
52946
  // @ts-check
@@ -52951,16 +53069,16 @@ const MentionWrapper = ({
52951
53069
  appendContent(`<span class="react-input-emoji--mention--text" data-mention-id="${user.id}" data-mention-name="${user.name}">@${user.name}</span> `);
52952
53070
  }
52953
53071
 
52954
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, loading ? /*#__PURE__*/React__default['default'].createElement("div", {
53072
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, loading ? /*#__PURE__*/React__default["default"].createElement("div", {
52955
53073
  className: "react-input-emoji--mention--container"
52956
- }, /*#__PURE__*/React__default['default'].createElement("div", {
53074
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
52957
53075
  className: "react-input-emoji--mention--loading"
52958
- }, /*#__PURE__*/React__default['default'].createElement("div", {
53076
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
52959
53077
  className: "react-input-emoji--mention--loading--spinner"
52960
- }, "Loading..."))) : showUserList && /*#__PURE__*/React__default['default'].createElement("div", {
53078
+ }, "Loading..."))) : showUserList && /*#__PURE__*/React__default["default"].createElement("div", {
52961
53079
  className: "react-input-emoji--mention--container",
52962
53080
  onClick: evt => evt.stopPropagation()
52963
- }, /*#__PURE__*/React__default['default'].createElement(MentionUserListWithRef, {
53081
+ }, /*#__PURE__*/React__default["default"].createElement(MentionUserListWithRef, {
52964
53082
  ref: metionUserListRef,
52965
53083
  mentionSearchText: mentionSearchText,
52966
53084
  users: mentionUsers,
@@ -53013,7 +53131,8 @@ function useEventListeners() {
53013
53131
  arrowUp: createObserver(),
53014
53132
  arrowDown: createObserver(),
53015
53133
  enter: createObserver(),
53016
- focus: createObserver()
53134
+ focus: createObserver(),
53135
+ blur: createObserver()
53017
53136
  }), []);
53018
53137
  /**
53019
53138
  * @template {keyof TextInputListeners} T, K
@@ -53079,6 +53198,7 @@ function usePollute() {
53079
53198
  * @property {(size: {width: number, height: number}) => void} onResize
53080
53199
  * @property {() => void} onClick
53081
53200
  * @property {() => void} onFocus
53201
+ * @property {() => void=} onBlur
53082
53202
  * @property {number} maxLength
53083
53203
  * @property {boolean} keepOpened
53084
53204
  * @property {(event: KeyboardEvent) => void} onKeyDown
@@ -53092,6 +53212,7 @@ function usePollute() {
53092
53212
  * @property {string} fontFamily
53093
53213
  * @property {object[]=} customEmojis
53094
53214
  * @property {(text: string) => Promise<MetionUser[]>=} searchMention
53215
+ * @property {HTMLDivElement=} buttonElement
53095
53216
  */
53096
53217
 
53097
53218
  /**
@@ -53108,6 +53229,7 @@ function InputEmoji(props, ref) {
53108
53229
  onResize,
53109
53230
  onClick,
53110
53231
  onFocus,
53232
+ onBlur,
53111
53233
  onKeyDown,
53112
53234
  theme,
53113
53235
  cleanOnEnter,
@@ -53120,13 +53242,14 @@ function InputEmoji(props, ref) {
53120
53242
  value,
53121
53243
  customEmojis,
53122
53244
  searchMention,
53245
+ buttonElement,
53123
53246
  // style
53124
53247
  borderRadius,
53125
53248
  borderColor,
53126
53249
  fontSize,
53127
53250
  fontFamily
53128
53251
  } = props;
53129
- /** @type {React.MutableRefObject<import('./text-input').Ref>} */
53252
+ /** @type {React.MutableRefObject<import('./text-input').Ref | null>} */
53130
53253
 
53131
53254
  const textInputRef = React.useRef(null);
53132
53255
  const {
@@ -53143,6 +53266,7 @@ function InputEmoji(props, ref) {
53143
53266
  pollute
53144
53267
  } = usePollute();
53145
53268
  const updateHTML = React.useCallback((nextValue = "") => {
53269
+ if (textInputRef.current === null) return;
53146
53270
  textInputRef.current.html = replaceAllTextEmojis(nextValue);
53147
53271
  sanitizedTextRef.current = nextValue;
53148
53272
  }, [sanitizedTextRef]);
@@ -53171,11 +53295,11 @@ function InputEmoji(props, ref) {
53171
53295
  * @return {boolean}
53172
53296
  */
53173
53297
  function handleKeydown(event) {
53174
- if (typeof maxLength !== "undefined" && event.key !== "Backspace" && totalCharacters(textInputRef.current) >= maxLength) {
53298
+ if (typeof maxLength !== "undefined" && event.key !== "Backspace" && textInputRef.current !== null && totalCharacters(textInputRef.current) >= maxLength) {
53175
53299
  event.preventDefault();
53176
53300
  }
53177
53301
 
53178
- if (event.key === "Enter") {
53302
+ if (event.key === "Enter" && textInputRef.current) {
53179
53303
  event.preventDefault();
53180
53304
  const text = sanitize(textInputRef.current.html);
53181
53305
  emitChange(sanitizedTextRef.current);
@@ -53224,6 +53348,19 @@ function InputEmoji(props, ref) {
53224
53348
  unsubscribe();
53225
53349
  };
53226
53350
  }, [addEventListener, onClick, onFocus]);
53351
+ React.useEffect(() => {
53352
+ /** */
53353
+ function handleBlur() {
53354
+ if (typeof onBlur === "function") {
53355
+ onBlur();
53356
+ }
53357
+ }
53358
+
53359
+ const unsubscribe = addEventListener("blur", handleBlur);
53360
+ return () => {
53361
+ unsubscribe();
53362
+ };
53363
+ }, [addEventListener, onBlur]);
53227
53364
  /**
53228
53365
  *
53229
53366
  * @param {string} html
@@ -53240,11 +53377,13 @@ function InputEmoji(props, ref) {
53240
53377
 
53241
53378
 
53242
53379
  function appendContent(html) {
53243
- if (typeof maxLength !== "undefined" && totalCharacters(textInputRef.current) >= maxLength) {
53380
+ if (typeof maxLength !== "undefined" && textInputRef.current !== null && totalCharacters(textInputRef.current) >= maxLength) {
53244
53381
  return;
53245
53382
  }
53246
53383
 
53247
- textInputRef.current.appendContent(html);
53384
+ if (textInputRef.current !== null) {
53385
+ textInputRef.current.appendContent(html);
53386
+ }
53248
53387
  }
53249
53388
  /**
53250
53389
  * Handle copy of current selected text
@@ -53273,17 +53412,18 @@ function InputEmoji(props, ref) {
53273
53412
  }
53274
53413
  }
53275
53414
 
53276
- return /*#__PURE__*/React__default['default'].createElement("div", {
53415
+ return /*#__PURE__*/React__default["default"].createElement("div", {
53277
53416
  className: "react-emoji"
53278
- }, /*#__PURE__*/React__default['default'].createElement(MentionWrapper, {
53417
+ }, /*#__PURE__*/React__default["default"].createElement(MentionWrapper, {
53279
53418
  searchMention: searchMention,
53280
53419
  addEventListener: addEventListener,
53281
53420
  appendContent: appendContent,
53282
53421
  addSanitizeFn: addSanitizeFn
53283
- }), /*#__PURE__*/React__default['default'].createElement(TextInputWithRef, {
53422
+ }), /*#__PURE__*/React__default["default"].createElement(TextInputWithRef, {
53284
53423
  ref: textInputRef,
53285
53424
  onCopy: handleCopy,
53286
53425
  onPaste: handlePaste,
53426
+ onBlur: listeners.blur.publish,
53287
53427
  onFocus: listeners.focus.publish,
53288
53428
  onArrowUp: listeners.arrowUp.publish,
53289
53429
  onArrowDown: listeners.arrowDown.publish,
@@ -53300,14 +53440,15 @@ function InputEmoji(props, ref) {
53300
53440
  tabIndex: tabIndex,
53301
53441
  className: inputClass,
53302
53442
  onChange: handleTextInputChange
53303
- }), /*#__PURE__*/React__default['default'].createElement(EmojiPickerWrapper, {
53443
+ }), /*#__PURE__*/React__default["default"].createElement(EmojiPickerWrapper, {
53304
53444
  theme: theme,
53305
53445
  keepOpened: keepOpened,
53306
53446
  disableRecent: disableRecent,
53307
53447
  customEmojis: customEmojis,
53308
53448
  addSanitizeFn: addSanitizeFn,
53309
53449
  addPolluteFn: addPolluteFn,
53310
- appendContent: appendContent
53450
+ appendContent: appendContent,
53451
+ buttonElement: buttonElement
53311
53452
  }));
53312
53453
  }
53313
53454