@atlaskit/link-picker 1.9.3 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/link-picker
2
2
 
3
+ ## 1.9.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`81ac9ce10ff`](https://bitbucket.org/atlassian/atlassian-frontend/commits/81ac9ce10ff) - Update error boundary implementation to replace analytic instrumentation for uncaught errors.
8
+
3
9
  ## 1.9.3
4
10
 
5
11
  ### Patch Changes
@@ -10,7 +10,7 @@ exports.default = void 0;
10
10
  *
11
11
  * Generates analytics utilities from the package analytics spec yaml
12
12
  *
13
- * @codegen <<SignedSource::e4f7029050ef6edde92cac3d9535cd4a>>
13
+ * @codegen <<SignedSource::3c46f1d8f463b6898a7a0e1e1f4676b4>>
14
14
  * @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
15
15
  */
16
16
  function createEventPayload(eventKey, attributes) {
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ exports.default = exports.BaseErrorBoundary = void 0;
11
+
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
+
14
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
+
16
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
17
+
18
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
+
20
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
21
+
22
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
23
+
24
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
+
26
+ var _react = _interopRequireWildcard(require("react"));
27
+
28
+ var _analyticsNext = require("@atlaskit/analytics-next");
29
+
30
+ var _analytics = _interopRequireDefault(require("../../analytics.codegen"));
31
+
32
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
33
+
34
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
+
36
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
37
+
38
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
39
+
40
+ // eslint-disable-next-line @repo/internal/react/no-class-components
41
+ var BaseErrorBoundary = /*#__PURE__*/function (_Component) {
42
+ (0, _inherits2.default)(BaseErrorBoundary, _Component);
43
+
44
+ var _super = _createSuper(BaseErrorBoundary);
45
+
46
+ function BaseErrorBoundary(props) {
47
+ var _this;
48
+
49
+ (0, _classCallCheck2.default)(this, BaseErrorBoundary);
50
+ _this = _super.call(this, props);
51
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "fireAnalytics", function (analyticsErrorPayload) {
52
+ var _window, _window$navigator, _analyticsErrorPayloa, _analyticsErrorPayloa2;
53
+
54
+ var _this$props = _this.props,
55
+ createAnalyticsEvent = _this$props.createAnalyticsEvent,
56
+ channel = _this$props.channel;
57
+ createAnalyticsEvent((0, _analytics.default)('ui.linkPicker.unhandledErrorCaught', {
58
+ browserInfo: ((_window = window) === null || _window === void 0 ? void 0 : (_window$navigator = _window.navigator) === null || _window$navigator === void 0 ? void 0 : _window$navigator.userAgent) || 'unknown',
59
+ error: analyticsErrorPayload.error.toString(),
60
+ componentStack: (_analyticsErrorPayloa = (_analyticsErrorPayloa2 = analyticsErrorPayload.info) === null || _analyticsErrorPayloa2 === void 0 ? void 0 : _analyticsErrorPayloa2.componentStack) !== null && _analyticsErrorPayloa !== void 0 ? _analyticsErrorPayloa : ''
61
+ })).fire(channel);
62
+ });
63
+ _this.state = {
64
+ hasError: false
65
+ };
66
+ return _this;
67
+ }
68
+
69
+ (0, _createClass2.default)(BaseErrorBoundary, [{
70
+ key: "componentDidCatch",
71
+ value: function componentDidCatch(error, info) {
72
+ var onError = this.props.onError;
73
+ var payload = {
74
+ error: error,
75
+ info: info
76
+ };
77
+ this.fireAnalytics(payload);
78
+ onError && onError(error, info);
79
+ this.setState({
80
+ hasError: true
81
+ });
82
+ }
83
+ }, {
84
+ key: "render",
85
+ value: function render() {
86
+ var _this$props2 = this.props,
87
+ children = _this$props2.children,
88
+ ErrorComponent = _this$props2.ErrorComponent;
89
+ var hasError = this.state.hasError;
90
+
91
+ if (hasError && ErrorComponent) {
92
+ return /*#__PURE__*/_react.default.createElement(ErrorComponent, null);
93
+ }
94
+
95
+ return children;
96
+ }
97
+ }]);
98
+ return BaseErrorBoundary;
99
+ }(_react.Component);
100
+
101
+ exports.BaseErrorBoundary = BaseErrorBoundary;
102
+ var ErrorBoundary = (0, _analyticsNext.withAnalyticsEvents)()(BaseErrorBoundary);
103
+ var _default = ErrorBoundary;
104
+ exports.default = _default;
@@ -11,14 +11,16 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
11
11
 
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
 
14
- var _analyticsNext = require("@atlaskit/analytics-next");
15
-
16
14
  var _reactLooselyLazy = require("react-loosely-lazy");
17
15
 
16
+ var _analyticsNext = require("@atlaskit/analytics-next");
17
+
18
18
  var _constants = require("../common/constants");
19
19
 
20
20
  var _version = require("../version.json");
21
21
 
22
+ var _errorBoundary = _interopRequireDefault(require("./error-boundary"));
23
+
22
24
  var _errorBoundaryFallback = require("./error-boundary-fallback");
23
25
 
24
26
  var _loaderFallback = require("./loader-fallback");
@@ -40,12 +42,13 @@ var LazyLinkPicker = (0, _reactLooselyLazy.lazyForPaint)(function () {
40
42
  });
41
43
  });
42
44
  var ComposedLinkPicker = /*#__PURE__*/(0, _react.memo)(function (props) {
43
- return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsErrorBoundary, {
45
+ return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsContext, {
46
+ data: PACKAGE_DATA
47
+ }, /*#__PURE__*/_react.default.createElement(_errorBoundary.default, {
44
48
  channel: _constants.ANALYTICS_CHANNEL,
45
- data: PACKAGE_DATA,
46
49
  ErrorComponent: _errorBoundaryFallback.ErrorBoundaryFallback
47
50
  }, /*#__PURE__*/_react.default.createElement(_reactLooselyLazy.LazySuspense, {
48
51
  fallback: _loaderFallback.LoaderFallback
49
- }, /*#__PURE__*/_react.default.createElement(LazyLinkPicker, props)));
52
+ }, /*#__PURE__*/_react.default.createElement(LazyLinkPicker, props))));
50
53
  });
51
54
  exports.ComposedLinkPicker = ComposedLinkPicker;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "sideEffects": false
5
5
  }
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates analytics utilities from the package analytics spec yaml
5
5
  *
6
- * @codegen <<SignedSource::e4f7029050ef6edde92cac3d9535cd4a>>
6
+ * @codegen <<SignedSource::3c46f1d8f463b6898a7a0e1e1f4676b4>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
8
8
  */
9
9
  function createEventPayload(eventKey, attributes) {
@@ -0,0 +1,62 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import React, { Component } from 'react';
3
+ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
4
+ import createEventPayload from '../../analytics.codegen';
5
+ // eslint-disable-next-line @repo/internal/react/no-class-components
6
+ export class BaseErrorBoundary extends Component {
7
+ constructor(props) {
8
+ super(props);
9
+
10
+ _defineProperty(this, "fireAnalytics", analyticsErrorPayload => {
11
+ var _window, _window$navigator, _analyticsErrorPayloa, _analyticsErrorPayloa2;
12
+
13
+ const {
14
+ createAnalyticsEvent,
15
+ channel
16
+ } = this.props;
17
+ createAnalyticsEvent(createEventPayload('ui.linkPicker.unhandledErrorCaught', {
18
+ browserInfo: ((_window = window) === null || _window === void 0 ? void 0 : (_window$navigator = _window.navigator) === null || _window$navigator === void 0 ? void 0 : _window$navigator.userAgent) || 'unknown',
19
+ error: analyticsErrorPayload.error.toString(),
20
+ componentStack: (_analyticsErrorPayloa = (_analyticsErrorPayloa2 = analyticsErrorPayload.info) === null || _analyticsErrorPayloa2 === void 0 ? void 0 : _analyticsErrorPayloa2.componentStack) !== null && _analyticsErrorPayloa !== void 0 ? _analyticsErrorPayloa : ''
21
+ })).fire(channel);
22
+ });
23
+
24
+ this.state = {
25
+ hasError: false
26
+ };
27
+ }
28
+
29
+ componentDidCatch(error, info) {
30
+ const {
31
+ onError
32
+ } = this.props;
33
+ const payload = {
34
+ error,
35
+ info
36
+ };
37
+ this.fireAnalytics(payload);
38
+ onError && onError(error, info);
39
+ this.setState({
40
+ hasError: true
41
+ });
42
+ }
43
+
44
+ render() {
45
+ const {
46
+ children,
47
+ ErrorComponent
48
+ } = this.props;
49
+ const {
50
+ hasError
51
+ } = this.state;
52
+
53
+ if (hasError && ErrorComponent) {
54
+ return /*#__PURE__*/React.createElement(ErrorComponent, null);
55
+ }
56
+
57
+ return children;
58
+ }
59
+
60
+ }
61
+ const ErrorBoundary = withAnalyticsEvents()(BaseErrorBoundary);
62
+ export default ErrorBoundary;
@@ -1,8 +1,9 @@
1
1
  import React, { memo } from 'react';
2
- import { AnalyticsErrorBoundary } from '@atlaskit/analytics-next';
3
2
  import { LazySuspense, lazyForPaint } from 'react-loosely-lazy';
3
+ import { AnalyticsContext } from '@atlaskit/analytics-next';
4
4
  import { COMPONENT_NAME, ANALYTICS_CHANNEL } from '../common/constants';
5
5
  import { name as packageName, version as packageVersion } from '../version.json';
6
+ import ErrorBoundary from './error-boundary';
6
7
  import { ErrorBoundaryFallback } from './error-boundary-fallback';
7
8
  import { LoaderFallback } from './loader-fallback';
8
9
  export const PACKAGE_DATA = {
@@ -14,10 +15,11 @@ export const PACKAGE_DATA = {
14
15
  const LazyLinkPicker = lazyForPaint(() => import(
15
16
  /* webpackChunkName: "@atlaskit-internal_link-picker" */
16
17
  './link-picker'));
17
- export const ComposedLinkPicker = /*#__PURE__*/memo(props => /*#__PURE__*/React.createElement(AnalyticsErrorBoundary, {
18
+ export const ComposedLinkPicker = /*#__PURE__*/memo(props => /*#__PURE__*/React.createElement(AnalyticsContext, {
19
+ data: PACKAGE_DATA
20
+ }, /*#__PURE__*/React.createElement(ErrorBoundary, {
18
21
  channel: ANALYTICS_CHANNEL,
19
- data: PACKAGE_DATA,
20
22
  ErrorComponent: ErrorBoundaryFallback
21
23
  }, /*#__PURE__*/React.createElement(LazySuspense, {
22
24
  fallback: LoaderFallback
23
- }, /*#__PURE__*/React.createElement(LazyLinkPicker, props))));
25
+ }, /*#__PURE__*/React.createElement(LazyLinkPicker, props)))));
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "sideEffects": false
5
5
  }
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates analytics utilities from the package analytics spec yaml
5
5
  *
6
- * @codegen <<SignedSource::e4f7029050ef6edde92cac3d9535cd4a>>
6
+ * @codegen <<SignedSource::3c46f1d8f463b6898a7a0e1e1f4676b4>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
8
8
  */
9
9
  function createEventPayload(eventKey, attributes) {
@@ -0,0 +1,81 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
+ import _inherits from "@babel/runtime/helpers/inherits";
5
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+
9
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
+
11
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
+
13
+ import React, { Component } from 'react';
14
+ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
15
+ import createEventPayload from '../../analytics.codegen';
16
+ // eslint-disable-next-line @repo/internal/react/no-class-components
17
+ export var BaseErrorBoundary = /*#__PURE__*/function (_Component) {
18
+ _inherits(BaseErrorBoundary, _Component);
19
+
20
+ var _super = _createSuper(BaseErrorBoundary);
21
+
22
+ function BaseErrorBoundary(props) {
23
+ var _this;
24
+
25
+ _classCallCheck(this, BaseErrorBoundary);
26
+
27
+ _this = _super.call(this, props);
28
+
29
+ _defineProperty(_assertThisInitialized(_this), "fireAnalytics", function (analyticsErrorPayload) {
30
+ var _window, _window$navigator, _analyticsErrorPayloa, _analyticsErrorPayloa2;
31
+
32
+ var _this$props = _this.props,
33
+ createAnalyticsEvent = _this$props.createAnalyticsEvent,
34
+ channel = _this$props.channel;
35
+ createAnalyticsEvent(createEventPayload('ui.linkPicker.unhandledErrorCaught', {
36
+ browserInfo: ((_window = window) === null || _window === void 0 ? void 0 : (_window$navigator = _window.navigator) === null || _window$navigator === void 0 ? void 0 : _window$navigator.userAgent) || 'unknown',
37
+ error: analyticsErrorPayload.error.toString(),
38
+ componentStack: (_analyticsErrorPayloa = (_analyticsErrorPayloa2 = analyticsErrorPayload.info) === null || _analyticsErrorPayloa2 === void 0 ? void 0 : _analyticsErrorPayloa2.componentStack) !== null && _analyticsErrorPayloa !== void 0 ? _analyticsErrorPayloa : ''
39
+ })).fire(channel);
40
+ });
41
+
42
+ _this.state = {
43
+ hasError: false
44
+ };
45
+ return _this;
46
+ }
47
+
48
+ _createClass(BaseErrorBoundary, [{
49
+ key: "componentDidCatch",
50
+ value: function componentDidCatch(error, info) {
51
+ var onError = this.props.onError;
52
+ var payload = {
53
+ error: error,
54
+ info: info
55
+ };
56
+ this.fireAnalytics(payload);
57
+ onError && onError(error, info);
58
+ this.setState({
59
+ hasError: true
60
+ });
61
+ }
62
+ }, {
63
+ key: "render",
64
+ value: function render() {
65
+ var _this$props2 = this.props,
66
+ children = _this$props2.children,
67
+ ErrorComponent = _this$props2.ErrorComponent;
68
+ var hasError = this.state.hasError;
69
+
70
+ if (hasError && ErrorComponent) {
71
+ return /*#__PURE__*/React.createElement(ErrorComponent, null);
72
+ }
73
+
74
+ return children;
75
+ }
76
+ }]);
77
+
78
+ return BaseErrorBoundary;
79
+ }(Component);
80
+ var ErrorBoundary = withAnalyticsEvents()(BaseErrorBoundary);
81
+ export default ErrorBoundary;
@@ -1,8 +1,9 @@
1
1
  import React, { memo } from 'react';
2
- import { AnalyticsErrorBoundary } from '@atlaskit/analytics-next';
3
2
  import { LazySuspense, lazyForPaint } from 'react-loosely-lazy';
3
+ import { AnalyticsContext } from '@atlaskit/analytics-next';
4
4
  import { COMPONENT_NAME, ANALYTICS_CHANNEL } from '../common/constants';
5
5
  import { name as packageName, version as packageVersion } from '../version.json';
6
+ import ErrorBoundary from './error-boundary';
6
7
  import { ErrorBoundaryFallback } from './error-boundary-fallback';
7
8
  import { LoaderFallback } from './loader-fallback';
8
9
  export var PACKAGE_DATA = {
@@ -17,11 +18,12 @@ var LazyLinkPicker = lazyForPaint(function () {
17
18
  './link-picker');
18
19
  });
19
20
  export var ComposedLinkPicker = /*#__PURE__*/memo(function (props) {
20
- return /*#__PURE__*/React.createElement(AnalyticsErrorBoundary, {
21
+ return /*#__PURE__*/React.createElement(AnalyticsContext, {
22
+ data: PACKAGE_DATA
23
+ }, /*#__PURE__*/React.createElement(ErrorBoundary, {
21
24
  channel: ANALYTICS_CHANNEL,
22
- data: PACKAGE_DATA,
23
25
  ErrorComponent: ErrorBoundaryFallback
24
26
  }, /*#__PURE__*/React.createElement(LazySuspense, {
25
27
  fallback: LoaderFallback
26
- }, /*#__PURE__*/React.createElement(LazyLinkPicker, props)));
28
+ }, /*#__PURE__*/React.createElement(LazyLinkPicker, props))));
27
29
  });
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "sideEffects": false
5
5
  }
@@ -3,9 +3,15 @@
3
3
  *
4
4
  * Generates analytics utilities from the package analytics spec yaml
5
5
  *
6
- * @codegen <<SignedSource::e4f7029050ef6edde92cac3d9535cd4a>>
6
+ * @codegen <<SignedSource::3c46f1d8f463b6898a7a0e1e1f4676b4>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
8
8
  */
9
+ export declare type PackageMetaDataType = {
10
+ packageName: '@atlaskit/link-picker';
11
+ packageVersion: string;
12
+ source: 'linkPicker';
13
+ componentName: 'linkPicker';
14
+ };
9
15
  export declare type LinkPickerAnalyticsContextType = {
10
16
  linkState: 'editLink' | 'newLink';
11
17
  linkFieldContent: 'url' | 'text_string' | null;
@@ -18,12 +24,18 @@ export declare type InlineDialogViewedLinkPickerAttributesType = {};
18
24
  export declare type InlineDialogClosedLinkPickerAttributesType = {};
19
25
  export declare type TextFieldUpdatedLinkFieldAttributesType = {};
20
26
  export declare type TextFieldUpdatedDisplayTextFieldAttributesType = {};
27
+ export declare type LinkPickerUnhandledErrorCaughtAttributesType = {
28
+ browserInfo: string;
29
+ error: string;
30
+ componentStack: string;
31
+ };
21
32
  declare type AnalyticsEventAttributes = {
22
33
  'ui.form.submitted.linkPicker': FormSubmittedLinkPickerAttributesType;
23
34
  'ui.inlineDialog.viewed.linkPicker': InlineDialogViewedLinkPickerAttributesType;
24
35
  'ui.inlineDialog.closed.linkPicker': InlineDialogClosedLinkPickerAttributesType;
25
36
  'ui.textField.updated.linkField': TextFieldUpdatedLinkFieldAttributesType;
26
37
  'ui.textField.updated.displayTextField': TextFieldUpdatedDisplayTextFieldAttributesType;
38
+ 'ui.linkPicker.unhandledErrorCaught': LinkPickerUnhandledErrorCaughtAttributesType;
27
39
  };
28
40
  declare function createEventPayload<K extends keyof AnalyticsEventAttributes>(eventKey: K, attributes: AnalyticsEventAttributes[K]): {
29
41
  eventType: string;
@@ -0,0 +1,27 @@
1
+ import React, { Component, ReactNode } from 'react';
2
+ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
+ declare type ErrorBoundaryErrorInfo = {
4
+ componentStack: string;
5
+ };
6
+ export interface ErrorBoundaryProps extends WithAnalyticsEventsProps {
7
+ children: ReactNode;
8
+ channel: string;
9
+ ErrorComponent?: React.ComponentType;
10
+ onError?: (error: Error, info?: ErrorBoundaryErrorInfo) => void;
11
+ }
12
+ declare type ErrorBoundaryPayload = {
13
+ error: Error | string;
14
+ info?: ErrorBoundaryErrorInfo;
15
+ [key: string]: any;
16
+ };
17
+ declare type ErrorBoundaryState = {
18
+ hasError: boolean;
19
+ };
20
+ export declare class BaseErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
21
+ constructor(props: ErrorBoundaryProps);
22
+ fireAnalytics: (analyticsErrorPayload: ErrorBoundaryPayload) => void;
23
+ componentDidCatch(error: Error, info?: ErrorBoundaryErrorInfo): void;
24
+ render(): React.ReactNode;
25
+ }
26
+ declare const ErrorBoundary: React.ForwardRefExoticComponent<Omit<ErrorBoundaryProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
27
+ export default ErrorBoundary;
@@ -1,9 +1,5 @@
1
1
  import React from 'react';
2
+ import { PackageMetaDataType } from '../analytics.codegen';
2
3
  import { LinkPickerProps } from './link-picker';
3
- export declare const PACKAGE_DATA: {
4
- packageName: any;
5
- packageVersion: any;
6
- componentName: string;
7
- source: string;
8
- };
4
+ export declare const PACKAGE_DATA: PackageMetaDataType;
9
5
  export declare const ComposedLinkPicker: React.MemoExoticComponent<(props: LinkPickerProps) => JSX.Element>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.9.3",
3
+ "version": "1.9.4",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {