@astral/ui 1.16.1 → 1.16.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/ConfigProvider/ConfigProvider.d.ts +2 -2
- package/ConfigProvider/ConfigProvider.js +1 -1
- package/ErrorBoundary/ErrorBoundary.d.ts +3 -3
- package/ErrorBoundary/ErrorBoundary.js +2 -2
- package/esm/ConfigProvider/ConfigProvider.d.ts +2 -2
- package/esm/ConfigProvider/ConfigProvider.js +1 -1
- package/esm/ErrorBoundary/ErrorBoundary.d.ts +3 -3
- package/esm/ErrorBoundary/ErrorBoundary.js +2 -2
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
export declare type ConfigContextProps = {
|
|
3
3
|
locale?: Locale;
|
|
4
|
-
captureException?: (
|
|
4
|
+
captureException?: (error: any) => void;
|
|
5
5
|
};
|
|
6
6
|
export declare type ConfigProviderProps = ConfigContextProps & {
|
|
7
7
|
children: ReactNode;
|
|
@@ -20,7 +20,7 @@ var react_1 = require("react");
|
|
|
20
20
|
var ru_1 = __importDefault(require("date-fns/locale/ru"));
|
|
21
21
|
exports.ConfigContext = (0, react_1.createContext)({
|
|
22
22
|
locale: ru_1.default,
|
|
23
|
-
captureException: function (
|
|
23
|
+
captureException: function (error) { return console.error(error); },
|
|
24
24
|
});
|
|
25
25
|
var ConfigProvider = function (_a) {
|
|
26
26
|
var children = _a.children, _b = _a.locale, locale = _b === void 0 ? ru_1.default : _b, captureException = _a.captureException;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
declare type Props = {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
captureException?: (
|
|
4
|
+
captureException?: (error: any) => void;
|
|
5
5
|
};
|
|
6
6
|
declare type State = {
|
|
7
7
|
error: boolean;
|
|
@@ -11,7 +11,7 @@ declare class ErrorBoundary extends React.Component<Props, State> {
|
|
|
11
11
|
static getDerivedStateFromError(): {
|
|
12
12
|
error: boolean;
|
|
13
13
|
};
|
|
14
|
-
componentDidCatch(error: Error
|
|
14
|
+
componentDidCatch(error: Error): void;
|
|
15
15
|
handleReloadPage(): void;
|
|
16
16
|
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
|
17
17
|
}
|
|
@@ -46,9 +46,9 @@ var ErrorBoundary = /** @class */ (function (_super) {
|
|
|
46
46
|
ErrorBoundary.getDerivedStateFromError = function () {
|
|
47
47
|
return { error: true };
|
|
48
48
|
};
|
|
49
|
-
ErrorBoundary.prototype.componentDidCatch = function (error
|
|
49
|
+
ErrorBoundary.prototype.componentDidCatch = function (error) {
|
|
50
50
|
var _a, _b;
|
|
51
|
-
(_b = (_a = this.props).captureException) === null || _b === void 0 ? void 0 : _b.call(_a,
|
|
51
|
+
(_b = (_a = this.props).captureException) === null || _b === void 0 ? void 0 : _b.call(_a, error);
|
|
52
52
|
};
|
|
53
53
|
ErrorBoundary.prototype.handleReloadPage = function () {
|
|
54
54
|
location.reload();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
export declare type ConfigContextProps = {
|
|
3
3
|
locale?: Locale;
|
|
4
|
-
captureException?: (
|
|
4
|
+
captureException?: (error: any) => void;
|
|
5
5
|
};
|
|
6
6
|
export declare type ConfigProviderProps = ConfigContextProps & {
|
|
7
7
|
children: ReactNode;
|
|
@@ -14,7 +14,7 @@ import { createContext, useEffect } from 'react';
|
|
|
14
14
|
import ru from 'date-fns/locale/ru';
|
|
15
15
|
export var ConfigContext = createContext({
|
|
16
16
|
locale: ru,
|
|
17
|
-
captureException: function (
|
|
17
|
+
captureException: function (error) { return console.error(error); },
|
|
18
18
|
});
|
|
19
19
|
export var ConfigProvider = function (_a) {
|
|
20
20
|
var children = _a.children, _b = _a.locale, locale = _b === void 0 ? ru : _b, captureException = _a.captureException;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
2
|
declare type Props = {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
captureException?: (
|
|
4
|
+
captureException?: (error: any) => void;
|
|
5
5
|
};
|
|
6
6
|
declare type State = {
|
|
7
7
|
error: boolean;
|
|
@@ -11,7 +11,7 @@ declare class ErrorBoundary extends React.Component<Props, State> {
|
|
|
11
11
|
static getDerivedStateFromError(): {
|
|
12
12
|
error: boolean;
|
|
13
13
|
};
|
|
14
|
-
componentDidCatch(error: Error
|
|
14
|
+
componentDidCatch(error: Error): void;
|
|
15
15
|
handleReloadPage(): void;
|
|
16
16
|
render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
|
|
17
17
|
}
|
|
@@ -41,9 +41,9 @@ var ErrorBoundary = /** @class */ (function (_super) {
|
|
|
41
41
|
ErrorBoundary.getDerivedStateFromError = function () {
|
|
42
42
|
return { error: true };
|
|
43
43
|
};
|
|
44
|
-
ErrorBoundary.prototype.componentDidCatch = function (error
|
|
44
|
+
ErrorBoundary.prototype.componentDidCatch = function (error) {
|
|
45
45
|
var _a, _b;
|
|
46
|
-
(_b = (_a = this.props).captureException) === null || _b === void 0 ? void 0 : _b.call(_a,
|
|
46
|
+
(_b = (_a = this.props).captureException) === null || _b === void 0 ? void 0 : _b.call(_a, error);
|
|
47
47
|
};
|
|
48
48
|
ErrorBoundary.prototype.handleReloadPage = function () {
|
|
49
49
|
location.reload();
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@astral/ui",
|
|
3
3
|
"browser": "./src/index.ts",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@astral/icons": "^1.16.
|
|
5
|
+
"@astral/icons": "^1.16.2",
|
|
6
6
|
"@emotion/cache": "11.7.1",
|
|
7
7
|
"@emotion/react": "11.9.0",
|
|
8
8
|
"@emotion/server": "11.4.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"require": "./server/index.js"
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
|
-
"version": "1.16.
|
|
34
|
+
"version": "1.16.2",
|
|
35
35
|
"author": "Astral.Soft",
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"repository": {
|