react-input-emoji 5.6.7 → 5.6.8

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -5,24 +5,6 @@ var ReactDOM = require('react-dom');
5
5
 
6
6
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
7
 
8
- function _interopNamespace(e) {
9
- if (e && e.__esModule) return e;
10
- var n = Object.create(null);
11
- if (e) {
12
- Object.keys(e).forEach(function (k) {
13
- if (k !== 'default') {
14
- var d = Object.getOwnPropertyDescriptor(e, k);
15
- Object.defineProperty(n, k, d.get ? d : {
16
- enumerable: true,
17
- get: function () { return e[k]; }
18
- });
19
- }
20
- });
21
- }
22
- n["default"] = e;
23
- return Object.freeze(n);
24
- }
25
-
26
8
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
27
9
  var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
28
10
 
@@ -3643,10 +3625,27 @@ function EmojiPicker(props) {
3643
3625
  i18n = _useState2[0],
3644
3626
  setI18n = _useState2[1];
3645
3627
  React.useEffect(function () {
3628
+ var _ref2;
3646
3629
  if (!language) {
3630
+ var _ref;
3647
3631
  // @ts-ignore
3648
- Promise.resolve().then(function () { return en$1; }).then(function (translations) {
3649
- setI18n(translations);
3632
+ fetch("https://cdn.jsdelivr.net/npm/@emoji-mart/data/i18n/en.json").then(function (_x) {
3633
+ return (_ref = _ref || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
3634
+ var translations;
3635
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
3636
+ while (1) switch (_context.prev = _context.next) {
3637
+ case 0:
3638
+ _context.next = 2;
3639
+ return data.json();
3640
+ case 2:
3641
+ translations = _context.sent;
3642
+ setI18n(translations);
3643
+ case 4:
3644
+ case "end":
3645
+ return _context.stop();
3646
+ }
3647
+ }, _callee);
3648
+ }))).apply(this, arguments);
3650
3649
  })["catch"](function (error) {
3651
3650
  console.error("Failed to load translations:", error);
3652
3651
  });
@@ -3654,8 +3653,23 @@ function EmojiPicker(props) {
3654
3653
  }
3655
3654
 
3656
3655
  // @ts-ignore
3657
- (function (t) { return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(t)); }); })("@emoji-mart/data/i18n/".concat(language, ".json")).then(function (translations) {
3658
- setI18n(translations);
3656
+ fetch("https://cdn.jsdelivr.net/npm/@emoji-mart/data/i18n/".concat(language, ".json")).then(function (_x2) {
3657
+ return (_ref2 = _ref2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(data) {
3658
+ var translations;
3659
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
3660
+ while (1) switch (_context2.prev = _context2.next) {
3661
+ case 0:
3662
+ _context2.next = 2;
3663
+ return data.json();
3664
+ case 2:
3665
+ translations = _context2.sent;
3666
+ setI18n(translations);
3667
+ case 4:
3668
+ case "end":
3669
+ return _context2.stop();
3670
+ }
3671
+ }, _callee2);
3672
+ }))).apply(this, arguments);
3659
3673
  })["catch"](function (error) {
3660
3674
  console.error("Failed to load translations:", error);
3661
3675
  });
@@ -4724,54 +4738,5 @@ InputEmojiWithRef.defaultProps = {
4724
4738
  language: undefined
4725
4739
  };
4726
4740
 
4727
- var search = "Search";
4728
- var search_no_results_1 = "Oh no!";
4729
- var search_no_results_2 = "That emoji couldn’t be found";
4730
- var pick = "Pick an emoji…";
4731
- var add_custom = "Add custom emoji";
4732
- var categories = {
4733
- activity: "Activity",
4734
- custom: "Custom",
4735
- flags: "Flags",
4736
- foods: "Food & Drink",
4737
- frequent: "Frequently used",
4738
- nature: "Animals & Nature",
4739
- objects: "Objects",
4740
- people: "Smileys & People",
4741
- places: "Travel & Places",
4742
- search: "Search Results",
4743
- symbols: "Symbols"
4744
- };
4745
- var skins = {
4746
- "1": "Default",
4747
- "2": "Light",
4748
- "3": "Medium-Light",
4749
- "4": "Medium",
4750
- "5": "Medium-Dark",
4751
- "6": "Dark",
4752
- choose: "Choose default skin tone"
4753
- };
4754
- var en = {
4755
- search: search,
4756
- search_no_results_1: search_no_results_1,
4757
- search_no_results_2: search_no_results_2,
4758
- pick: pick,
4759
- add_custom: add_custom,
4760
- categories: categories,
4761
- skins: skins
4762
- };
4763
-
4764
- var en$1 = /*#__PURE__*/Object.freeze({
4765
- __proto__: null,
4766
- search: search,
4767
- search_no_results_1: search_no_results_1,
4768
- search_no_results_2: search_no_results_2,
4769
- pick: pick,
4770
- add_custom: add_custom,
4771
- categories: categories,
4772
- skins: skins,
4773
- 'default': en
4774
- });
4775
-
4776
4741
  module.exports = InputEmojiWithRef;
4777
4742
  //# sourceMappingURL=index.js.map