@equinor/fusion-react-errorboundary 0.1.0-beta.0 → 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/ErrorMessage.d.ts +2 -2
- package/dist/ErrorMessage.d.ts.map +1 -1
- package/dist/ErrorMessage.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -11
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/ErrorMessage.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
2
|
import type { ErrorMessageProps } from './types';
|
|
3
|
-
export declare const ErrorMessage: ({ hasError, errorType, message, resourceName, title, children, icon, action, onTakeAction, }:
|
|
3
|
+
export declare const ErrorMessage: ({ hasError, errorType, message, resourceName, title, children, icon, action, onTakeAction, }: PropsWithChildren<ErrorMessageProps>) => JSX.Element;
|
|
4
4
|
export default ErrorMessage;
|
|
5
5
|
//# sourceMappingURL=ErrorMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorMessage.d.ts","sourceRoot":"","sources":["../src/ErrorMessage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorMessage.d.ts","sourceRoot":"","sources":["../src/ErrorMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAQnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,eAAO,MAAM,YAAY,iGAUtB,kBAAkB,iBAAiB,CAAC,KAAG,WAgEzC,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
package/dist/ErrorMessage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorMessage.js","sourceRoot":"","sources":["../src/ErrorMessage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"ErrorMessage.js","sourceRoot":"","sources":["../src/ErrorMessage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAqB,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAK9C,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,SAAS,GAAG,OAAO,EACnB,OAAO,EACP,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,YAAY,GACyB,EAAe,EAAE;IACtD,MAAM,MAAM,GAAG,cAAc,EAAE,CAAC;IAChC,MAAM,sBAAsB,GAAG,CAAC,SAAiB,EAAE,EAAE;QACnD,MAAM,SAAS,GAAG;YAChB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,SAAS;SACjB,CAAC;QAEF,QAAQ,SAAS,EAAE;YACjB,KAAK,cAAc;gBACjB,OAAO;oBACL,KAAK,EAAE,qDAAqD;oBAC5D,IAAI,EAAE,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,KAAK,SAAS,GAAI;iBAC3C,CAAC;YACJ,KAAK,UAAU;gBACb,OAAO;oBACL,KAAK,EAAE,OAAO,YAAY,qBAAqB;oBAC/C,IAAI,EAAE,KAAC,IAAI,IAAC,IAAI,EAAC,kBAAkB,KAAK,SAAS,GAAI;iBACtD,CAAC;YACJ,KAAK,QAAQ;gBACX,OAAO;oBACL,KAAK,EAAE,8DAA8D;oBACrE,IAAI,EAAE,KAAC,IAAI,IAAC,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}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Component } from 'react';
|
|
1
|
+
import { Component, PropsWithChildren } from 'react';
|
|
2
2
|
import type { ErrorMessageProps } from './types';
|
|
3
|
-
export declare class ErrorBoundary extends Component<ErrorMessageProps
|
|
3
|
+
export declare class ErrorBoundary extends Component<PropsWithChildren<ErrorMessageProps>> {
|
|
4
4
|
state: {
|
|
5
|
-
|
|
5
|
+
hasError: boolean;
|
|
6
6
|
};
|
|
7
|
-
render(): JSX.Element;
|
|
8
7
|
componentDidCatch(): void;
|
|
8
|
+
render(): JSX.Element;
|
|
9
9
|
}
|
|
10
10
|
export default ErrorBoundary;
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,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
|
|
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 = {
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
if (this.state.didCatch) {
|
|
13
|
-
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" })] }) }));
|
|
14
|
-
}
|
|
15
|
-
return _jsx(ErrorMessage, { ...this.props, children: this.props.children });
|
|
7
|
+
this.state = { hasError: false };
|
|
16
8
|
}
|
|
17
9
|
componentDidCatch() {
|
|
18
|
-
this.setState({
|
|
10
|
+
this.setState({ hasError: true });
|
|
11
|
+
}
|
|
12
|
+
render() {
|
|
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,
|
|
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/dist/types.d.ts
CHANGED
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AACA,KAAK,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,kBAAkB,GAAG,UAAU,CAAC;AAErG,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AACA,KAAK,UAAU,GAAG,OAAO,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,kBAAkB,GAAG,UAAU,CAAC;AAErG,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC;CACvE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-react-errorboundary",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.2",
|
|
4
4
|
"description": "React component for errorboundary",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"errorboundary",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@equinor/fusion-react-styles": "^0.5.5",
|
|
40
40
|
"@equinor/fusion-react-utils": "^2.0.4"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "dd2fa8f4fb904e35f4d5fccdde7239487846b877"
|
|
43
43
|
}
|