@equinor/fusion-react-errorboundary 0.1.0-beta.1 → 0.1.0-beta.2

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/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import { Component, PropsWithChildren } from 'react';
2
2
  import type { ErrorMessageProps } from './types';
3
3
  export declare class ErrorBoundary extends Component<PropsWithChildren<ErrorMessageProps>> {
4
4
  state: {
5
- didCatch: boolean;
5
+ hasError: boolean;
6
6
  };
7
7
  componentDidCatch(): void;
8
8
  render(): JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAIrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAIjD,qBAAa,aAAc,SAAQ,SAAS,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAChF,KAAK;;MAAuB;IAE5B,iBAAiB;IAIjB,MAAM;CAeP;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,qBAAa,aAAc,SAAQ,SAAS,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IAChF,KAAK;;MAAuB;IAE5B,iBAAiB;IAIjB,MAAM;CAOP;AAED,eAAe,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,21 +1,16 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Component } from 'react';
3
3
  import ErrorMessage from './ErrorMessage';
4
- import useErrorStyles from './useErrorStyles';
5
- const styles = useErrorStyles();
6
4
  export class ErrorBoundary extends Component {
7
5
  constructor() {
8
6
  super(...arguments);
9
- this.state = { didCatch: false };
7
+ this.state = { hasError: false };
10
8
  }
11
9
  componentDidCatch() {
12
- this.setState({ didCatch: true });
10
+ this.setState({ hasError: true });
13
11
  }
14
12
  render() {
15
- if (this.state.didCatch) {
16
- return (_jsx("div", { className: styles.container, children: _jsxs("div", { className: styles.messageContainer, children: [_jsx("div", { className: styles.title, children: "Something went wrong" }), _jsx("div", { className: styles.message, children: "Please try refresh browser, if problem persists, please contact support through service now" })] }) }));
17
- }
18
- return _jsx(ErrorMessage, { ...this.props, children: this.props.children });
13
+ return (_jsx(ErrorMessage, { hasError: this.state.hasError, ...this.props, children: this.props.children }));
19
14
  }
20
15
  }
21
16
  export default ErrorBoundary;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAErD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAG9C,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;AAEhC,MAAM,OAAO,aAAc,SAAQ,SAA+C;IAAlF;;QACE,UAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAqB9B,CAAC;IAnBC,iBAAiB;QACf,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,MAAM;QACJ,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YACvB,OAAO,CACL,cAAK,SAAS,EAAE,MAAM,CAAC,SAAS,YAC9B,eAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,aACrC,cAAK,SAAS,EAAE,MAAM,CAAC,KAAK,qCAA4B,EACxD,cAAK,SAAS,EAAE,MAAM,CAAC,OAAO,4GAExB,IACF,GACF,CACP,CAAC;SACH;QACD,OAAO,KAAC,YAAY,OAAK,IAAI,CAAC,KAAK,YAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAgB,CAAC;IAC5E,CAAC;CACF;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAErD,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAG1C,MAAM,OAAO,aAAc,SAAQ,SAA+C;IAAlF;;QACE,UAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAa9B,CAAC;IAXC,iBAAiB;QACf,IAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,MAAM;QACJ,OAAO,CACL,KAAC,YAAY,IAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,KAAM,IAAI,CAAC,KAAK,YACxD,IAAI,CAAC,KAAK,CAAC,QAAQ,GACP,CAChB,CAAC;IACJ,CAAC;CACF;AAED,eAAe,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-react-errorboundary",
3
- "version": "0.1.0-beta.1",
3
+ "version": "0.1.0-beta.2",
4
4
  "description": "React component for errorboundary",
5
5
  "keywords": [
6
6
  "errorboundary",
@@ -37,8 +37,7 @@
37
37
  "@equinor/fusion-react-button": "^0.8.1",
38
38
  "@equinor/fusion-react-icon": "^0.2.15",
39
39
  "@equinor/fusion-react-styles": "^0.5.5",
40
- "@equinor/fusion-react-utils": "^2.0.4",
41
- "typescript": "^5.0.2"
40
+ "@equinor/fusion-react-utils": "^2.0.4"
42
41
  },
43
- "gitHead": "d1c7040fd22ed8cb63a142a7c5be8bd0c98d76f8"
42
+ "gitHead": "dd2fa8f4fb904e35f4d5fccdde7239487846b877"
44
43
  }