emoji-picker-react 4.0.0-rc.15 → 4.0.0-rc.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { PickerConfig } from './config/config';
3
+ import './EmojiPickerReact.css';
4
+ export interface Props extends PickerConfig {
5
+ }
6
+ export default function EmojiPicker(props: Props): JSX.Element;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ export default class ErrorBoundary extends React.Component<{
3
+ children: React.ReactNode;
4
+ }, {
5
+ hasError: boolean;
6
+ }> {
7
+ constructor(props: {
8
+ children: React.ReactNode;
9
+ });
10
+ static getDerivedStateFromError(): {
11
+ hasError: boolean;
12
+ };
13
+ componentDidCatch(error: Error, errorInfo: any): void;
14
+ render(): number | boolean | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactFragment | null | undefined;
15
+ }
@@ -24,6 +24,21 @@ function _extends() {
24
24
  return _extends.apply(this, arguments);
25
25
  }
26
26
 
27
+ function _inheritsLoose(subClass, superClass) {
28
+ subClass.prototype = Object.create(superClass.prototype);
29
+ subClass.prototype.constructor = subClass;
30
+
31
+ _setPrototypeOf(subClass, superClass);
32
+ }
33
+
34
+ function _setPrototypeOf(o, p) {
35
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
36
+ o.__proto__ = p;
37
+ return o;
38
+ };
39
+ return _setPrototypeOf(o, p);
40
+ }
41
+
27
42
  function _objectWithoutPropertiesLoose(source, excluded) {
28
43
  if (source == null) return {};
29
44
  var target = {};
@@ -16816,5 +16831,45 @@ function EmojiPicker(props) {
16816
16831
  return React.createElement(ElementRefContextProvider, null, React.createElement(PickerConfigProvider, Object.assign({}, props), React.createElement(PickerMain, null, React.createElement(Header, null), React.createElement(Body, null), React.createElement(Preview, null))));
16817
16832
  }
16818
16833
 
16819
- exports.default = EmojiPicker;
16834
+ var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
16835
+ _inheritsLoose(ErrorBoundary, _React$Component);
16836
+
16837
+ function ErrorBoundary(props) {
16838
+ var _this;
16839
+
16840
+ _this = _React$Component.call(this, props) || this;
16841
+ _this.state = {
16842
+ hasError: false
16843
+ };
16844
+ return _this;
16845
+ }
16846
+
16847
+ ErrorBoundary.getDerivedStateFromError = function getDerivedStateFromError() {
16848
+ return {
16849
+ hasError: true
16850
+ };
16851
+ };
16852
+
16853
+ var _proto = ErrorBoundary.prototype;
16854
+
16855
+ _proto.componentDidCatch = function componentDidCatch(error, errorInfo) {
16856
+ console.error('Emoji Picker React failed to render:', error, errorInfo);
16857
+ };
16858
+
16859
+ _proto.render = function render() {
16860
+ if (this.state.hasError) {
16861
+ return null;
16862
+ }
16863
+
16864
+ return this.props.children;
16865
+ };
16866
+
16867
+ return ErrorBoundary;
16868
+ }(React.Component);
16869
+
16870
+ function EmojiPicker$1(props) {
16871
+ return React.createElement(ErrorBoundary, null, React.createElement(EmojiPicker, Object.assign({}, props)));
16872
+ }
16873
+
16874
+ exports.default = EmojiPicker$1;
16820
16875
  //# sourceMappingURL=emoji-picker-react.cjs.development.js.map