@astral/ui 4.71.3 → 4.72.0
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/components/PageContent/PageContentHeader/Description/Description.d.ts +2 -1
- package/components/PageContent/PageContentHeader/Description/Description.js +4 -4
- package/components/PageContent/PageContentHeader/PageContentHeader.js +2 -1
- package/components/PageContent/PageContentHeader/constants.d.ts +4 -0
- package/components/PageContent/PageContentHeader/constants.js +5 -0
- package/components/PageContent/PageContentHeader/styles.js +7 -0
- package/components/ThemeProvider/ThemeProvider.d.ts +6 -0
- package/components/ThemeProvider/ThemeProvider.js +8 -1
- package/node/components/PageContent/PageContentHeader/Description/Description.d.ts +2 -1
- package/node/components/PageContent/PageContentHeader/Description/Description.js +4 -4
- package/node/components/PageContent/PageContentHeader/PageContentHeader.js +2 -1
- package/node/components/PageContent/PageContentHeader/constants.d.ts +4 -0
- package/node/components/PageContent/PageContentHeader/constants.js +8 -0
- package/node/components/PageContent/PageContentHeader/styles.js +7 -0
- package/node/components/ThemeProvider/ThemeProvider.d.ts +6 -0
- package/node/components/ThemeProvider/ThemeProvider.js +8 -1
- package/package.json +1 -1
- package/components/ErrorBoundary/ErrorBoundary.stubs.d.ts +0 -12
- package/components/ErrorBoundary/ErrorBoundary.stubs.js +0 -50
- package/node/components/ErrorBoundary/ErrorBoundary.stubs.d.ts +0 -12
- package/node/components/ErrorBoundary/ErrorBoundary.stubs.js +0 -56
|
@@ -2,6 +2,7 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
type DescriptionProps = {
|
|
3
3
|
description?: ReactNode;
|
|
4
4
|
isLoading?: boolean;
|
|
5
|
+
className?: string;
|
|
5
6
|
};
|
|
6
|
-
export declare const Description: ({ description, isLoading }: DescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const Description: ({ className, description, isLoading, }: DescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Skeleton } from '../../../Skeleton';
|
|
3
3
|
import { Typography } from '../../../Typography';
|
|
4
|
-
export const Description = ({ description, isLoading }) => {
|
|
4
|
+
export const Description = ({ className, description, isLoading, }) => {
|
|
5
5
|
if (!description && isLoading) {
|
|
6
|
-
return _jsx(Skeleton, { height: 20, width: 300 });
|
|
6
|
+
return _jsx(Skeleton, { className: className, height: 20, width: 300 });
|
|
7
7
|
}
|
|
8
8
|
if (typeof description === 'string') {
|
|
9
|
-
return _jsx(Typography, { variant: "body1", children: description });
|
|
9
|
+
return (_jsx(Typography, { className: className, variant: "body1", children: description }));
|
|
10
10
|
}
|
|
11
|
-
return (_jsx(Typography, { component: "div", variant: "body1", children: description }));
|
|
11
|
+
return (_jsx(Typography, { className: className, component: "div", variant: "body1", children: description }));
|
|
12
12
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { pageContentHeaderClassnames } from './constants';
|
|
2
3
|
import { Description } from './Description';
|
|
3
4
|
import { TitleBlock, Wrapper } from './styles';
|
|
4
5
|
import { Title } from './Title';
|
|
5
6
|
export const PageContentHeader = ({ title, description, actions, children, isLoading, }) => {
|
|
6
|
-
return (_jsxs(Wrapper, { children: [_jsxs(TitleBlock, { children: [_jsx(Title, { title: title, isLoading: isLoading, children: children }), _jsx(Description, { description: description, isLoading: isLoading })] }), actions && actions] }));
|
|
7
|
+
return (_jsxs(Wrapper, { className: pageContentHeaderClassnames.pageContentHeader, children: [_jsxs(TitleBlock, { children: [_jsx(Title, { title: title, isLoading: isLoading, children: children }), _jsx(Description, { className: pageContentHeaderClassnames.description, description: description, isLoading: isLoading })] }), actions && actions] }));
|
|
7
8
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { styled } from '../../styled';
|
|
2
|
+
import { pageContentHeaderClassnames } from './constants';
|
|
2
3
|
export const Wrapper = styled.header `
|
|
3
4
|
display: flex;
|
|
4
5
|
gap: ${({ theme }) => theme.spacing(2)};
|
|
@@ -23,4 +24,10 @@ export const TitleBlock = styled.div `
|
|
|
23
24
|
overflow: hidden;
|
|
24
25
|
display: flex;
|
|
25
26
|
flex-direction: column;
|
|
27
|
+
|
|
28
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
29
|
+
& .${pageContentHeaderClassnames.description} {
|
|
30
|
+
display: none;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
26
33
|
`;
|
|
@@ -15,4 +15,10 @@ export type ThemeProviderProps = {
|
|
|
15
15
|
*/
|
|
16
16
|
withScopedStyles?: boolean;
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Содержит:
|
|
20
|
+
* - Provider для доступа к theme
|
|
21
|
+
* - Установка глобальных стилей
|
|
22
|
+
* - ErrorBoundary для отлова ошибок рендера, включая ошибки загрузка js chunk
|
|
23
|
+
*/
|
|
18
24
|
export declare const ThemeProvider: (props: PropsWithChildren<ThemeProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ThemeProvider as EmotionThemeProvider } from '@emotion/react';
|
|
3
3
|
import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
|
|
4
|
+
import { ErrorBoundary } from '../ErrorBoundary';
|
|
4
5
|
import { GlobalStyles } from '../GlobalStyles';
|
|
6
|
+
/**
|
|
7
|
+
* Содержит:
|
|
8
|
+
* - Provider для доступа к theme
|
|
9
|
+
* - Установка глобальных стилей
|
|
10
|
+
* - ErrorBoundary для отлова ошибок рендера, включая ошибки загрузка js chunk
|
|
11
|
+
*/
|
|
5
12
|
export const ThemeProvider = (props) => {
|
|
6
13
|
const { children, theme, withScopedStyles = false } = props;
|
|
7
|
-
return (_jsx(MuiThemeProvider, { theme: theme, children: _jsx(EmotionThemeProvider, { theme: theme, children: _jsx(GlobalStyles, { withScopedStyles: withScopedStyles, children: children }) }) }));
|
|
14
|
+
return (_jsx(ErrorBoundary, { children: _jsx(MuiThemeProvider, { theme: theme, children: _jsx(EmotionThemeProvider, { theme: theme, children: _jsx(GlobalStyles, { withScopedStyles: withScopedStyles, children: children }) }) }) }));
|
|
8
15
|
};
|
|
@@ -2,6 +2,7 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
type DescriptionProps = {
|
|
3
3
|
description?: ReactNode;
|
|
4
4
|
isLoading?: boolean;
|
|
5
|
+
className?: string;
|
|
5
6
|
};
|
|
6
|
-
export declare const Description: ({ description, isLoading }: DescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const Description: ({ className, description, isLoading, }: DescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
|
@@ -4,13 +4,13 @@ exports.Description = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const Skeleton_1 = require("../../../Skeleton");
|
|
6
6
|
const Typography_1 = require("../../../Typography");
|
|
7
|
-
const Description = ({ description, isLoading }) => {
|
|
7
|
+
const Description = ({ className, description, isLoading, }) => {
|
|
8
8
|
if (!description && isLoading) {
|
|
9
|
-
return (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { height: 20, width: 300 });
|
|
9
|
+
return (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { className: className, height: 20, width: 300 });
|
|
10
10
|
}
|
|
11
11
|
if (typeof description === 'string') {
|
|
12
|
-
return (0, jsx_runtime_1.jsx)(Typography_1.Typography, { variant: "body1", children: description });
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(Typography_1.Typography, { className: className, variant: "body1", children: description }));
|
|
13
13
|
}
|
|
14
|
-
return ((0, jsx_runtime_1.jsx)(Typography_1.Typography, { component: "div", variant: "body1", children: description }));
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(Typography_1.Typography, { className: className, component: "div", variant: "body1", children: description }));
|
|
15
15
|
};
|
|
16
16
|
exports.Description = Description;
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PageContentHeader = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
5
6
|
const Description_1 = require("./Description");
|
|
6
7
|
const styles_1 = require("./styles");
|
|
7
8
|
const Title_1 = require("./Title");
|
|
8
9
|
const PageContentHeader = ({ title, description, actions, children, isLoading, }) => {
|
|
9
|
-
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { children: [(0, jsx_runtime_1.jsxs)(styles_1.TitleBlock, { children: [(0, jsx_runtime_1.jsx)(Title_1.Title, { title: title, isLoading: isLoading, children: children }), (0, jsx_runtime_1.jsx)(Description_1.Description, { description: description, isLoading: isLoading })] }), actions && actions] }));
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: constants_1.pageContentHeaderClassnames.pageContentHeader, children: [(0, jsx_runtime_1.jsxs)(styles_1.TitleBlock, { children: [(0, jsx_runtime_1.jsx)(Title_1.Title, { title: title, isLoading: isLoading, children: children }), (0, jsx_runtime_1.jsx)(Description_1.Description, { className: constants_1.pageContentHeaderClassnames.description, description: description, isLoading: isLoading })] }), actions && actions] }));
|
|
10
11
|
};
|
|
11
12
|
exports.PageContentHeader = PageContentHeader;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pageContentHeaderClassnames = void 0;
|
|
4
|
+
const createUIKitClassname_1 = require("../../utils/createUIKitClassname");
|
|
5
|
+
exports.pageContentHeaderClassnames = {
|
|
6
|
+
pageContentHeader: (0, createUIKitClassname_1.createUIKitClassname)('page-content-header'),
|
|
7
|
+
description: (0, createUIKitClassname_1.createUIKitClassname)('page-content-header__description'),
|
|
8
|
+
};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TitleBlock = exports.Wrapper = void 0;
|
|
4
4
|
const styled_1 = require("../../styled");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
5
6
|
exports.Wrapper = styled_1.styled.header `
|
|
6
7
|
display: flex;
|
|
7
8
|
gap: ${({ theme }) => theme.spacing(2)};
|
|
@@ -26,4 +27,10 @@ exports.TitleBlock = styled_1.styled.div `
|
|
|
26
27
|
overflow: hidden;
|
|
27
28
|
display: flex;
|
|
28
29
|
flex-direction: column;
|
|
30
|
+
|
|
31
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
32
|
+
& .${constants_1.pageContentHeaderClassnames.description} {
|
|
33
|
+
display: none;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
29
36
|
`;
|
|
@@ -15,4 +15,10 @@ export type ThemeProviderProps = {
|
|
|
15
15
|
*/
|
|
16
16
|
withScopedStyles?: boolean;
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Содержит:
|
|
20
|
+
* - Provider для доступа к theme
|
|
21
|
+
* - Установка глобальных стилей
|
|
22
|
+
* - ErrorBoundary для отлова ошибок рендера, включая ошибки загрузка js chunk
|
|
23
|
+
*/
|
|
18
24
|
export declare const ThemeProvider: (props: PropsWithChildren<ThemeProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,9 +4,16 @@ exports.ThemeProvider = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("@emotion/react");
|
|
6
6
|
const styles_1 = require("@mui/material/styles");
|
|
7
|
+
const ErrorBoundary_1 = require("../ErrorBoundary");
|
|
7
8
|
const GlobalStyles_1 = require("../GlobalStyles");
|
|
9
|
+
/**
|
|
10
|
+
* Содержит:
|
|
11
|
+
* - Provider для доступа к theme
|
|
12
|
+
* - Установка глобальных стилей
|
|
13
|
+
* - ErrorBoundary для отлова ошибок рендера, включая ошибки загрузка js chunk
|
|
14
|
+
*/
|
|
8
15
|
const ThemeProvider = (props) => {
|
|
9
16
|
const { children, theme, withScopedStyles = false } = props;
|
|
10
|
-
return ((0, jsx_runtime_1.jsx)(styles_1.ThemeProvider, { theme: theme, children: (0, jsx_runtime_1.jsx)(react_1.ThemeProvider, { theme: theme, children: (0, jsx_runtime_1.jsx)(GlobalStyles_1.GlobalStyles, { withScopedStyles: withScopedStyles, children: children }) }) }));
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(ErrorBoundary_1.ErrorBoundary, { children: (0, jsx_runtime_1.jsx)(styles_1.ThemeProvider, { theme: theme, children: (0, jsx_runtime_1.jsx)(react_1.ThemeProvider, { theme: theme, children: (0, jsx_runtime_1.jsx)(GlobalStyles_1.GlobalStyles, { withScopedStyles: withScopedStyles, children: children }) }) }) }));
|
|
11
18
|
};
|
|
12
19
|
exports.ThemeProvider = ThemeProvider;
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Кнопка для вызова ошибки type = Default
|
|
3
|
-
*/
|
|
4
|
-
export declare const BuggyButton: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
/**
|
|
6
|
-
* Кнопка для вызова ошибки чанков ErrorChunkError c type = OutdatedRelease
|
|
7
|
-
*/
|
|
8
|
-
export declare const ChunkLoadErrorButton: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
/**
|
|
10
|
-
* Кнопка для вызова ошибки чанков Failed to fetch dynamically imported module c type = OutdatedRelease
|
|
11
|
-
*/
|
|
12
|
-
export declare const FailedFetchModuleButton: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { Button } from '../Button';
|
|
4
|
-
/**
|
|
5
|
-
* Кастомная ошибка подгрузки чанков при релизах
|
|
6
|
-
*/
|
|
7
|
-
class OutdatedReleaseError extends Error {
|
|
8
|
-
constructor(message = '') {
|
|
9
|
-
super(message);
|
|
10
|
-
this.name = 'ChunkLoadError';
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Компонент, который выбрасывает ошибку при рендере
|
|
15
|
-
*/
|
|
16
|
-
const ThrowError = ({ error, children, }) => {
|
|
17
|
-
throw error;
|
|
18
|
-
// biome-ignore lint/correctness/noUnreachable: Необходимо для теста
|
|
19
|
-
return _jsx(_Fragment, { children: children });
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Кнопка для вызова ошибки type = Default
|
|
23
|
-
*/
|
|
24
|
-
export const BuggyButton = () => {
|
|
25
|
-
const [count, setCount] = useState(0);
|
|
26
|
-
const onClick = () => {
|
|
27
|
-
setCount(count + 1);
|
|
28
|
-
};
|
|
29
|
-
return (_jsxs(_Fragment, { children: [count === 2 && (_jsx(ThrowError, { error: new Error('Кнопка сломалась на 2 клике') })), _jsx(Button, { onClick: onClick, children: "\u0421\u043B\u043E\u043C\u0430\u044E\u0441\u044C \u043D\u0430 2 \u043A\u043B\u0438\u043A\u0435" })] }));
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Кнопка для вызова ошибки чанков ErrorChunkError c type = OutdatedRelease
|
|
33
|
-
*/
|
|
34
|
-
export const ChunkLoadErrorButton = () => {
|
|
35
|
-
const [isClicked, setIsClicked] = useState(false);
|
|
36
|
-
const onClick = () => {
|
|
37
|
-
setIsClicked(true);
|
|
38
|
-
};
|
|
39
|
-
return (_jsxs(_Fragment, { children: [isClicked && (_jsx(ThrowError, { error: new OutdatedReleaseError('Ошибка загрузки приложения') })), _jsx(Button, { onClick: onClick, children: "\u0412\u044B\u0437\u043E\u0432\u0443 \u043E\u0448\u0438\u0431\u043A\u0443 \u0440\u0435\u043B\u0438\u0437\u0430" })] }));
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Кнопка для вызова ошибки чанков Failed to fetch dynamically imported module c type = OutdatedRelease
|
|
43
|
-
*/
|
|
44
|
-
export const FailedFetchModuleButton = () => {
|
|
45
|
-
const [isClicked, setIsClicked] = useState(false);
|
|
46
|
-
const onClick = () => {
|
|
47
|
-
setIsClicked(true);
|
|
48
|
-
};
|
|
49
|
-
return (_jsxs(_Fragment, { children: [isClicked && (_jsx(ThrowError, { error: new Error('Failed to fetch dynamically imported module') })), _jsx(Button, { onClick: onClick, children: "\u0412\u044B\u0437\u043E\u0432\u0443 \u043E\u0448\u0438\u0431\u043A\u0443 \u0440\u0435\u043B\u0438\u0437\u0430" })] }));
|
|
50
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Кнопка для вызова ошибки type = Default
|
|
3
|
-
*/
|
|
4
|
-
export declare const BuggyButton: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
/**
|
|
6
|
-
* Кнопка для вызова ошибки чанков ErrorChunkError c type = OutdatedRelease
|
|
7
|
-
*/
|
|
8
|
-
export declare const ChunkLoadErrorButton: () => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
/**
|
|
10
|
-
* Кнопка для вызова ошибки чанков Failed to fetch dynamically imported module c type = OutdatedRelease
|
|
11
|
-
*/
|
|
12
|
-
export declare const FailedFetchModuleButton: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FailedFetchModuleButton = exports.ChunkLoadErrorButton = exports.BuggyButton = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const Button_1 = require("../Button");
|
|
7
|
-
/**
|
|
8
|
-
* Кастомная ошибка подгрузки чанков при релизах
|
|
9
|
-
*/
|
|
10
|
-
class OutdatedReleaseError extends Error {
|
|
11
|
-
constructor(message = '') {
|
|
12
|
-
super(message);
|
|
13
|
-
this.name = 'ChunkLoadError';
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Компонент, который выбрасывает ошибку при рендере
|
|
18
|
-
*/
|
|
19
|
-
const ThrowError = ({ error, children, }) => {
|
|
20
|
-
throw error;
|
|
21
|
-
// biome-ignore lint/correctness/noUnreachable: Необходимо для теста
|
|
22
|
-
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
|
|
23
|
-
};
|
|
24
|
-
/**
|
|
25
|
-
* Кнопка для вызова ошибки type = Default
|
|
26
|
-
*/
|
|
27
|
-
const BuggyButton = () => {
|
|
28
|
-
const [count, setCount] = (0, react_1.useState)(0);
|
|
29
|
-
const onClick = () => {
|
|
30
|
-
setCount(count + 1);
|
|
31
|
-
};
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [count === 2 && ((0, jsx_runtime_1.jsx)(ThrowError, { error: new Error('Кнопка сломалась на 2 клике') })), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onClick, children: "\u0421\u043B\u043E\u043C\u0430\u044E\u0441\u044C \u043D\u0430 2 \u043A\u043B\u0438\u043A\u0435" })] }));
|
|
33
|
-
};
|
|
34
|
-
exports.BuggyButton = BuggyButton;
|
|
35
|
-
/**
|
|
36
|
-
* Кнопка для вызова ошибки чанков ErrorChunkError c type = OutdatedRelease
|
|
37
|
-
*/
|
|
38
|
-
const ChunkLoadErrorButton = () => {
|
|
39
|
-
const [isClicked, setIsClicked] = (0, react_1.useState)(false);
|
|
40
|
-
const onClick = () => {
|
|
41
|
-
setIsClicked(true);
|
|
42
|
-
};
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isClicked && ((0, jsx_runtime_1.jsx)(ThrowError, { error: new OutdatedReleaseError('Ошибка загрузки приложения') })), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onClick, children: "\u0412\u044B\u0437\u043E\u0432\u0443 \u043E\u0448\u0438\u0431\u043A\u0443 \u0440\u0435\u043B\u0438\u0437\u0430" })] }));
|
|
44
|
-
};
|
|
45
|
-
exports.ChunkLoadErrorButton = ChunkLoadErrorButton;
|
|
46
|
-
/**
|
|
47
|
-
* Кнопка для вызова ошибки чанков Failed to fetch dynamically imported module c type = OutdatedRelease
|
|
48
|
-
*/
|
|
49
|
-
const FailedFetchModuleButton = () => {
|
|
50
|
-
const [isClicked, setIsClicked] = (0, react_1.useState)(false);
|
|
51
|
-
const onClick = () => {
|
|
52
|
-
setIsClicked(true);
|
|
53
|
-
};
|
|
54
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isClicked && ((0, jsx_runtime_1.jsx)(ThrowError, { error: new Error('Failed to fetch dynamically imported module') })), (0, jsx_runtime_1.jsx)(Button_1.Button, { onClick: onClick, children: "\u0412\u044B\u0437\u043E\u0432\u0443 \u043E\u0448\u0438\u0431\u043A\u0443 \u0440\u0435\u043B\u0438\u0437\u0430" })] }));
|
|
55
|
-
};
|
|
56
|
-
exports.FailedFetchModuleButton = FailedFetchModuleButton;
|